1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
hsbt 2014-07-15 03:07:37 +00:00
parent 031e1570b9
commit 6361928083
63 changed files with 1077 additions and 307 deletions

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -1,2 +1,4 @@
# TODO: Remove in Rake 11
fail "ERROR: 'rake/contrib/sys' is obsolete and no longer supported. " +
"Use 'FileUtils' instead."