summaryrefslogtreecommitdiff
path: root/lib/rake/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rake/contrib')
-rw-r--r--lib/rake/contrib/ftptools.rb8
-rw-r--r--lib/rake/contrib/publisher.rb16
-rw-r--r--lib/rake/contrib/rubyforgepublisher.rb4
-rw-r--r--lib/rake/contrib/sshpublisher.rb23
-rw-r--r--lib/rake/contrib/sys.rb2
5 files changed, 37 insertions, 16 deletions
diff --git a/lib/rake/contrib/ftptools.rb b/lib/rake/contrib/ftptools.rb
index 0dd50fdc8d..b178523bc6 100644
--- a/lib/rake/contrib/ftptools.rb
+++ b/lib/rake/contrib/ftptools.rb
@@ -9,9 +9,7 @@ require 'rake/file_list'
module Rake # :nodoc:
- ####################################################################
- # <b>Note:</b> <em> Not released for general use.</em>
- class FtpFile
+ class FtpFile # :nodoc: all
attr_reader :name, :size, :owner, :group, :time
def self.date
@@ -68,9 +66,9 @@ module Rake # :nodoc:
end
end
- ####################################################################
+ ##
# Manage the uploading of files to an FTP account.
- class FtpUploader
+ class FtpUploader # :nodoc:
# Log uploads to standard output when true.
attr_accessor :verbose
diff --git a/lib/rake/contrib/publisher.rb b/lib/rake/contrib/publisher.rb
index 8b11edb59c..f4ee1abf86 100644
--- a/lib/rake/contrib/publisher.rb
+++ b/lib/rake/contrib/publisher.rb
@@ -14,8 +14,10 @@ HostInfo = Struct.new(:name, :webdir, :pkgdir)
# :startdoc:
+# TODO: Move to contrib/sshpublisher
+#--
# Manage several publishers as a single entity.
-class CompositePublisher
+class CompositePublisher # :nodoc:
def initialize
@publishers = []
end
@@ -31,9 +33,11 @@ class CompositePublisher
end
end
+# TODO: Remove in Rake 11, duplicated
+#--
# Publish an entire directory to an existing remote directory using
# SSH.
-class SshDirPublisher
+class SshDirPublisher # :nodoc: all
def initialize(host, remote_dir, local_dir)
@host = host
@remote_dir = remote_dir
@@ -45,8 +49,10 @@ class SshDirPublisher
end
end
+# TODO: Remove in Rake 11, duplicated
+#--
# Publish an entire directory to a fresh remote directory using SSH.
-class SshFreshDirPublisher < SshDirPublisher
+class SshFreshDirPublisher < SshDirPublisher # :nodoc: all
def upload
run %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil
run %{ssh #{@host} mkdir #{@remote_dir}}
@@ -54,8 +60,10 @@ class SshFreshDirPublisher < SshDirPublisher
end
end
+# TODO: Remove in Rake 11, duplicated
+#--
# Publish a list of files to an existing remote directory.
-class SshFilePublisher
+class SshFilePublisher # :nodoc: all
# Create a publisher using the give host information.
def initialize(host, remote_dir, local_dir, *files)
@host = host
diff --git a/lib/rake/contrib/rubyforgepublisher.rb b/lib/rake/contrib/rubyforgepublisher.rb
index a4b96936c8..00889ad7b9 100644
--- a/lib/rake/contrib/rubyforgepublisher.rb
+++ b/lib/rake/contrib/rubyforgepublisher.rb
@@ -1,8 +1,10 @@
+# TODO: Remove in Rake 11
+
require 'rake/contrib/sshpublisher'
module Rake
- class RubyForgePublisher < SshDirPublisher
+ class RubyForgePublisher < SshDirPublisher # :nodoc: all
attr_reader :project, :proj_id, :user
def initialize(projname, user)
diff --git a/lib/rake/contrib/sshpublisher.rb b/lib/rake/contrib/sshpublisher.rb
index bd6adc127e..64f577017c 100644
--- a/lib/rake/contrib/sshpublisher.rb
+++ b/lib/rake/contrib/sshpublisher.rb
@@ -8,22 +8,30 @@ module Rake
class SshDirPublisher
include Rake::DSL
+ # Creates an SSH publisher which will scp all files in +local_dir+ to
+ # +remote_dir+ on +host+
+
def initialize(host, remote_dir, local_dir)
@host = host
@remote_dir = remote_dir
@local_dir = local_dir
end
+ # Uploads the files
+
def upload
- sh %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}}
+ sh "scp", "-rq", "#{@local_dir}/*", "#{@host}:#{@remote_dir}"
end
end
# Publish an entire directory to a fresh remote directory using SSH.
class SshFreshDirPublisher < SshDirPublisher
+
+ # Uploads the files after removing the existing remote directory.
+
def upload
- sh %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil
- sh %{ssh #{@host} mkdir #{@remote_dir}}
+ sh "ssh", @host, "rm", "-rf", @remote_dir rescue nil
+ sh "ssh", @host, "mkdir", @remote_dir
super
end
end
@@ -32,7 +40,9 @@ module Rake
class SshFilePublisher
include Rake::DSL
- # Create a publisher using the give host information.
+ # Creates an SSH publisher which will scp all +files+ in +local_dir+ to
+ # +remote_dir+ on +host+.
+
def initialize(host, remote_dir, local_dir, *files)
@host = host
@remote_dir = remote_dir
@@ -40,10 +50,11 @@ module Rake
@files = files
end
- # Upload the local directory to the remote directory.
+ # Uploads the files
+
def upload
@files.each do |fn|
- sh %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}
+ sh "scp", "-q", "#{@local_dir}/#{fn}", "#{@host}:#{@remote_dir}"
end
end
end
diff --git a/lib/rake/contrib/sys.rb b/lib/rake/contrib/sys.rb
index a3a9f69e25..8d4c735434 100644
--- a/lib/rake/contrib/sys.rb
+++ b/lib/rake/contrib/sys.rb
@@ -1,2 +1,4 @@
+# TODO: Remove in Rake 11
+
fail "ERROR: 'rake/contrib/sys' is obsolete and no longer supported. " +
"Use 'FileUtils' instead."