summaryrefslogtreecommitdiff
path: root/lib/rake/contrib
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-15 03:07:37 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-15 03:07:37 +0000
commit6361928083d01906ab9d8782b6533b4ed7c834a0 (patch)
tree172488be8a74c9313d35b9cd7d53999cd55f561d /lib/rake/contrib
parent031e1570b934d6b3a1e17ae8eb78a44dac8186d3 (diff)
* lib/rake.rb, lib/rake/*.rb: Upgrade to rake-10.3.2
[fix GH-668] * test/rake/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 0dd50fd..b178523 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 8b11edb..f4ee1ab 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 a4b9693..00889ad 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 bd6adc1..64f5770 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 a3a9f69..8d4c735 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."