summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2010-03-27 15:56:52 -0800
committerRyan Davis <ryand@zenspider.com>2010-03-27 15:56:52 -0800
commit68c414d1992179637ba5b7cf03437e3905b51b74 (patch)
tree9ce02ade3b6c90803f819bcbbc5998b474b7c58e
parent0366fd739959226d4c238f790c4ecfbab1ed2cb1 (diff)
downloadhoe-68c414d1992179637ba5b7cf03437e3905b51b74.tar.gz
+ Added rdoc_locations array to the publish plugin to allow for multiple arbitrary rdoc locations
[git-p4: depot-paths = "//src/hoe/dev/": change = 5711]
-rw-r--r--lib/hoe/publish.rb24
-rw-r--r--lib/hoe/rubyforge.rb9
2 files changed, 24 insertions, 9 deletions
diff --git a/lib/hoe/publish.rb b/lib/hoe/publish.rb
index c12a8c8..15c614e 100644
--- a/lib/hoe/publish.rb
+++ b/lib/hoe/publish.rb
@@ -48,6 +48,15 @@ module Hoe::Publish
attr_accessor :need_rdoc
##
+ # Optional: An array of remote (rsync) paths to copy rdoc to.
+ #
+ # eg:
+ #
+ # rdoc_locations << "user@server:Sites/rdoc/#{remote_rdoc_dir}"
+
+ attr_accessor :rdoc_locations
+
+ ##
# Optional: Name of RDoc destination directory on Rubyforge. [default: +name+]
attr_accessor :remote_rdoc_dir
@@ -77,6 +86,7 @@ module Hoe::Publish
self.blog_categories ||= [self.name]
self.local_rdoc_dir ||= 'doc'
self.need_rdoc ||= true
+ self.rdoc_locations ||= []
self.remote_rdoc_dir ||= self.name
self.rsync_args ||= '-av --delete'
end
@@ -117,16 +127,12 @@ module Hoe::Publish
end
end
- desc 'Publish RDoc to RubyForge.'
+ desc "Publish RDoc to wherever you want."
task :publish_docs => [:clean, :docs] do
- path = File.expand_path("~/.rubyforge/user-config.yml")
- config = YAML.load(File.read(path))
- host = "#{config["username"]}@rubyforge.org"
-
- remote_dir = "/var/www/gforge-projects/#{rubyforge_name}/#{remote_rdoc_dir}"
- local_dir = local_rdoc_dir
-
- sh %{rsync #{rsync_args} #{local_dir}/ #{host}:#{remote_dir}}
+ warn "no rdoc_location values" if rdoc_locations.empty?
+ self.rdoc_locations.each do |dest|
+ sh %{rsync #{rsync_args} #{local_rdoc_dir}/ #{dest}}
+ end
end
# no doco for this one
diff --git a/lib/hoe/rubyforge.rb b/lib/hoe/rubyforge.rb
index e5a7d90..6ec893d 100644
--- a/lib/hoe/rubyforge.rb
+++ b/lib/hoe/rubyforge.rb
@@ -38,5 +38,14 @@ module Hoe::RubyForge
puts "Releasing #{name} v. #{version}"
rf.add_release rubyforge_name, name, version, *files
end
+
+ if Hoe.plugins.include? :publish then
+ path = File.expand_path("~/.rubyforge/user-config.yml")
+ config = YAML.load(File.read(path))
+ base = "/var/www/gforge-projects"
+ dir = "#{base}/#{rubyforge_name}/#{remote_rdoc_dir}"
+
+ rdoc_locations << "#{config["username"]}@rubyforge.org:#{dir}"
+ end
end
end