rake 10.5.0 → 13.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/macos.yml +22 -0
  3. data/.github/workflows/ubuntu-rvm.yml +28 -0
  4. data/.github/workflows/ubuntu.yml +20 -0
  5. data/.github/workflows/windows.yml +20 -0
  6. data/CONTRIBUTING.rdoc +13 -8
  7. data/Gemfile +10 -0
  8. data/History.rdoc +1997 -288
  9. data/README.rdoc +27 -11
  10. data/Rakefile +25 -65
  11. data/bin/bundle +105 -0
  12. data/bin/console +7 -0
  13. data/bin/rake +20 -24
  14. data/bin/rdoc +29 -0
  15. data/bin/rubocop +29 -0
  16. data/bin/setup +6 -0
  17. data/doc/jamis.rb +1 -0
  18. data/doc/rake.1 +139 -124
  19. data/doc/rakefile.rdoc +2 -4
  20. data/exe/rake +27 -0
  21. data/lib/rake/application.rb +124 -90
  22. data/lib/rake/backtrace.rb +3 -2
  23. data/lib/rake/clean.rb +7 -5
  24. data/lib/rake/cloneable.rb +1 -0
  25. data/lib/rake/cpu_counter.rb +10 -28
  26. data/lib/rake/default_loader.rb +1 -0
  27. data/lib/rake/dsl_definition.rb +5 -11
  28. data/lib/rake/early_time.rb +1 -0
  29. data/lib/rake/ext/core.rb +1 -0
  30. data/lib/rake/ext/string.rb +22 -21
  31. data/lib/rake/file_creation_task.rb +4 -3
  32. data/lib/rake/file_list.rb +34 -27
  33. data/lib/rake/file_task.rb +12 -4
  34. data/lib/rake/file_utils.rb +38 -32
  35. data/lib/rake/file_utils_ext.rb +8 -18
  36. data/lib/rake/invocation_chain.rb +1 -0
  37. data/lib/rake/invocation_exception_mixin.rb +1 -0
  38. data/lib/rake/late_time.rb +2 -1
  39. data/lib/rake/linked_list.rb +24 -15
  40. data/lib/rake/loaders/makefile.rb +5 -4
  41. data/lib/rake/multi_task.rb +2 -1
  42. data/lib/rake/name_space.rb +1 -1
  43. data/lib/rake/packagetask.rb +40 -17
  44. data/lib/rake/phony.rb +2 -1
  45. data/lib/rake/private_reader.rb +1 -0
  46. data/lib/rake/promise.rb +13 -12
  47. data/lib/rake/pseudo_status.rb +1 -0
  48. data/lib/rake/rake_module.rb +30 -1
  49. data/lib/rake/rake_test_loader.rb +18 -13
  50. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  51. data/lib/rake/scope.rb +3 -2
  52. data/lib/rake/task.rb +82 -31
  53. data/lib/rake/task_argument_error.rb +1 -0
  54. data/lib/rake/task_arguments.rb +15 -4
  55. data/lib/rake/task_manager.rb +54 -30
  56. data/lib/rake/tasklib.rb +2 -14
  57. data/lib/rake/testtask.rb +39 -28
  58. data/lib/rake/thread_history_display.rb +4 -3
  59. data/lib/rake/thread_pool.rb +16 -17
  60. data/lib/rake/trace_output.rb +2 -1
  61. data/lib/rake/version.rb +4 -1
  62. data/lib/rake/win32.rb +10 -15
  63. data/lib/rake.rb +35 -43
  64. data/rake.gemspec +43 -0
  65. metadata +33 -216
  66. data/.autotest +0 -7
  67. data/.rubocop.yml +0 -27
  68. data/.togglerc +0 -7
  69. data/Manifest.txt +0 -166
  70. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  71. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  72. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  73. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  74. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  75. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  76. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  77. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  78. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  79. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  80. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  81. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  82. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  83. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  84. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  85. data/doc/release_notes/rake-0.8.6.rdoc +0 -37
  86. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  87. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  88. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  89. data/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
  90. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  91. data/doc/release_notes/rake-0.9.3.rdoc +0 -102
  92. data/doc/release_notes/rake-0.9.4.rdoc +0 -60
  93. data/doc/release_notes/rake-0.9.5.rdoc +0 -55
  94. data/doc/release_notes/rake-0.9.6.rdoc +0 -64
  95. data/doc/release_notes/rake-10.0.0.rdoc +0 -178
  96. data/doc/release_notes/rake-10.0.1.rdoc +0 -58
  97. data/doc/release_notes/rake-10.0.2.rdoc +0 -53
  98. data/doc/release_notes/rake-10.0.3.rdoc +0 -191
  99. data/doc/release_notes/rake-10.1.0.rdoc +0 -61
  100. data/lib/rake/alt_system.rb +0 -110
  101. data/lib/rake/contrib/.document +0 -1
  102. data/lib/rake/contrib/compositepublisher.rb +0 -21
  103. data/lib/rake/contrib/ftptools.rb +0 -137
  104. data/lib/rake/contrib/publisher.rb +0 -81
  105. data/lib/rake/contrib/rubyforgepublisher.rb +0 -18
  106. data/lib/rake/contrib/sshpublisher.rb +0 -61
  107. data/lib/rake/contrib/sys.rb +0 -4
  108. data/lib/rake/ext/module.rb +0 -2
  109. data/lib/rake/ext/pathname.rb +0 -25
  110. data/lib/rake/ext/time.rb +0 -18
  111. data/lib/rake/gempackagetask.rb +0 -4
  112. data/lib/rake/pathmap.rb +0 -3
  113. data/lib/rake/rdoctask.rb +0 -4
  114. data/lib/rake/ruby182_test_unit_fix.rb +0 -29
  115. data/lib/rake/runtest.rb +0 -27
  116. data/rakelib/publish.rake +0 -20
  117. data/rakelib/test_times.rake +0 -25
  118. data/test/file_creation.rb +0 -34
  119. data/test/helper.rb +0 -129
  120. data/test/support/rakefile_definitions.rb +0 -478
  121. data/test/support/ruby_runner.rb +0 -34
  122. data/test/test_private_reader.rb +0 -42
  123. data/test/test_rake.rb +0 -40
  124. data/test/test_rake_application.rb +0 -643
  125. data/test/test_rake_application_options.rb +0 -468
  126. data/test/test_rake_backtrace.rb +0 -119
  127. data/test/test_rake_clean.rb +0 -61
  128. data/test/test_rake_cpu_counter.rb +0 -68
  129. data/test/test_rake_definitions.rb +0 -84
  130. data/test/test_rake_directory_task.rb +0 -76
  131. data/test/test_rake_dsl.rb +0 -40
  132. data/test/test_rake_early_time.rb +0 -31
  133. data/test/test_rake_extension.rb +0 -59
  134. data/test/test_rake_file_creation_task.rb +0 -56
  135. data/test/test_rake_file_list.rb +0 -670
  136. data/test/test_rake_file_list_path_map.rb +0 -8
  137. data/test/test_rake_file_task.rb +0 -197
  138. data/test/test_rake_file_utils.rb +0 -314
  139. data/test/test_rake_ftp_file.rb +0 -74
  140. data/test/test_rake_functional.rb +0 -482
  141. data/test/test_rake_invocation_chain.rb +0 -64
  142. data/test/test_rake_late_time.rb +0 -18
  143. data/test/test_rake_linked_list.rb +0 -84
  144. data/test/test_rake_makefile_loader.rb +0 -46
  145. data/test/test_rake_multi_task.rb +0 -64
  146. data/test/test_rake_name_space.rb +0 -57
  147. data/test/test_rake_package_task.rb +0 -79
  148. data/test/test_rake_path_map.rb +0 -168
  149. data/test/test_rake_path_map_explode.rb +0 -34
  150. data/test/test_rake_path_map_partial.rb +0 -18
  151. data/test/test_rake_pathname_extensions.rb +0 -15
  152. data/test/test_rake_pseudo_status.rb +0 -21
  153. data/test/test_rake_rake_test_loader.rb +0 -20
  154. data/test/test_rake_reduce_compat.rb +0 -26
  155. data/test/test_rake_require.rb +0 -40
  156. data/test/test_rake_rules.rb +0 -388
  157. data/test/test_rake_scope.rb +0 -44
  158. data/test/test_rake_task.rb +0 -393
  159. data/test/test_rake_task_argument_parsing.rb +0 -119
  160. data/test/test_rake_task_arguments.rb +0 -127
  161. data/test/test_rake_task_lib.rb +0 -9
  162. data/test/test_rake_task_manager.rb +0 -178
  163. data/test/test_rake_task_manager_argument_resolution.rb +0 -19
  164. data/test/test_rake_task_with_arguments.rb +0 -172
  165. data/test/test_rake_test_task.rb +0 -146
  166. data/test/test_rake_thread_pool.rb +0 -145
  167. data/test/test_rake_top_level_functions.rb +0 -71
  168. data/test/test_rake_win32.rb +0 -72
  169. data/test/test_thread_history_display.rb +0 -101
  170. data/test/test_trace_output.rb +0 -52
@@ -1,61 +0,0 @@
1
- = Rake 10.1.0 Released
2
-
3
- == Changes in Version 10.1
4
-
5
- === New Features
6
-
7
- * Add support for variable length task argument lists. If more actual
8
- arguments are supplied than named arguments, then the extra
9
- arguments values will be in args.extras.
10
-
11
- * Application name is not displayed in the help banner. (Previously
12
- "rake" was hardcoded, now rake-based applications can display their
13
- own names).
14
-
15
- === Bug Fixes
16
-
17
- Bug fixes include:
18
-
19
- * Fix backtrace suppression issues.
20
-
21
- * Rules now explicit get task arguments passed to them.
22
-
23
- * Rename FileList#exclude? to FileList#exclude_from_list? to avoid
24
- conflict with new Rails method.
25
-
26
- * Clean / Clobber tasks now report failure to remove files.
27
-
28
- * Plus heaps of internal code cleanup.
29
-
30
- == What is Rake
31
-
32
- Rake is a build tool similar to the make program in many ways. But
33
- instead of cryptic make recipes, Rake uses standard Ruby code to
34
- declare tasks and dependencies. You have the full power of a modern
35
- scripting language built right into your build tool.
36
-
37
- == Availability
38
-
39
- The easiest way to get and install rake is via RubyGems ...
40
-
41
- gem install rake (you may need root/admin privileges)
42
-
43
- Otherwise, you can get it from the more from GitHub:
44
-
45
- GitHub:: git://github.com/jimweirich/rake.git
46
-
47
- == Thanks
48
-
49
- As usual, it was input from users that drove a lot of these changes.
50
- The following people contributed patches, made suggestions or made
51
- otherwise helpful comments. Thanks to ...
52
-
53
- * Michael Nikitochkin (general code cleanup)
54
- * Vipul A M (general code cleanup)
55
- * Dennis Bell (variable length task argument lists)
56
- * Jacob Swanner (rules arguments)
57
- * Rafael Rosa Fu (documentation typo)
58
- * Stuart Nelson (install.rb fixes)
59
- * Lee Hambley (application name in help banner)
60
-
61
- -- Jim Weirich
@@ -1,110 +0,0 @@
1
- #
2
- # Copyright (c) 2008 James M. Lawrence
3
- #
4
- # Permission is hereby granted, free of charge, to any person
5
- # obtaining a copy of this software and associated documentation files
6
- # (the "Software"), to deal in the Software without restriction,
7
- # including without limitation the rights to use, copy, modify, merge,
8
- # publish, distribute, sublicense, and/or sell copies of the Software,
9
- # and to permit persons to whom the Software is furnished to do so,
10
- # subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be
13
- # included in all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19
- # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20
- # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- #
24
-
25
- require 'rbconfig'
26
-
27
- ##
28
- # Alternate implementations of system() and backticks `` on Windows
29
- # for ruby-1.8 and earlier.
30
- #--
31
- # TODO: Remove in Rake 11
32
-
33
- module Rake::AltSystem # :nodoc: all
34
- WINDOWS = RbConfig::CONFIG["host_os"] =~
35
- %r!(msdos|mswin|djgpp|mingw|[Ww]indows)!
36
-
37
- class << self
38
- def define_module_function(name, &block)
39
- define_method(name, &block)
40
- module_function(name)
41
- end
42
- end
43
-
44
- if WINDOWS && RUBY_VERSION < "1.9.0"
45
- RUNNABLE_EXTS = %w[com exe bat cmd]
46
- RUNNABLE_PATTERN = %r!\.(#{RUNNABLE_EXTS.join('|')})\Z!i
47
-
48
- define_module_function :kernel_system, &Kernel.method(:system)
49
- define_module_function :kernel_backticks, &Kernel.method(:'`')
50
-
51
- module_function
52
-
53
- def repair_command(cmd)
54
- "call " + (
55
- if cmd =~ %r!\A\s*\".*?\"!
56
- # already quoted
57
- cmd
58
- elsif match = cmd.match(%r!\A\s*(\S+)!)
59
- if match[1] =~ %r!/!
60
- # avoid x/y.bat interpretation as x with option /y
61
- %Q!"#{match[1]}"! + match.post_match
62
- else
63
- # a shell command will fail if quoted
64
- cmd
65
- end
66
- else
67
- # empty or whitespace
68
- cmd
69
- end
70
- )
71
- end
72
-
73
- def find_runnable(file)
74
- if file =~ RUNNABLE_PATTERN
75
- file
76
- else
77
- RUNNABLE_EXTS.each { |ext|
78
- test = "#{file}.#{ext}"
79
- return test if File.exist?(test)
80
- }
81
- nil
82
- end
83
- end
84
-
85
- def system(cmd, *args)
86
- repaired = (
87
- if args.empty?
88
- [repair_command(cmd)]
89
- elsif runnable = find_runnable(cmd)
90
- [File.expand_path(runnable), *args]
91
- else
92
- # non-existent file
93
- [cmd, *args]
94
- end
95
- )
96
- kernel_system(*repaired)
97
- end
98
-
99
- def backticks(cmd)
100
- kernel_backticks(repair_command(cmd))
101
- end
102
-
103
- define_module_function :'`', &method(:backticks)
104
- else
105
- # Non-Windows or ruby-1.9+: same as Kernel versions
106
- define_module_function :system, &Kernel.method(:system)
107
- define_module_function :backticks, &Kernel.method(:'`')
108
- define_module_function :'`', &Kernel.method(:'`')
109
- end
110
- end
@@ -1 +0,0 @@
1
-
@@ -1,21 +0,0 @@
1
- module Rake
2
-
3
- # Manage several publishers as a single entity.
4
- class CompositePublisher
5
- def initialize
6
- @publishers = []
7
- end
8
-
9
- # Add a publisher to the composite.
10
- def add(pub)
11
- @publishers << pub
12
- end
13
-
14
- # Upload all the individual publishers.
15
- def upload
16
- @publishers.each { |p| p.upload }
17
- end
18
- end
19
-
20
- end
21
-
@@ -1,137 +0,0 @@
1
- # = Tools for FTP uploading.
2
- #
3
- # This file is still under development and is not released for general
4
- # use.
5
-
6
- require 'date'
7
- require 'net/ftp'
8
- require 'rake/file_list'
9
-
10
- module Rake # :nodoc:
11
-
12
- class FtpFile # :nodoc: all
13
- attr_reader :name, :size, :owner, :group, :time
14
-
15
- def self.date
16
- @date_class ||= Date
17
- end
18
-
19
- def self.time
20
- @time_class ||= Time
21
- end
22
-
23
- def initialize(path, entry)
24
- @path = path
25
- @mode, _, @owner, @group, size, d1, d2, d3, @name = entry.split(' ')
26
- @size = size.to_i
27
- @time = determine_time(d1, d2, d3)
28
- end
29
-
30
- def path
31
- File.join(@path, @name)
32
- end
33
-
34
- def directory?
35
- @mode[0] == ?d
36
- end
37
-
38
- def mode
39
- parse_mode(@mode)
40
- end
41
-
42
- def symlink?
43
- @mode[0] == ?l
44
- end
45
-
46
- private # --------------------------------------------------------
47
-
48
- def parse_mode(m)
49
- result = 0
50
- (1..9).each do |i|
51
- result = 2 * result + ((m[i] == ?-) ? 0 : 1)
52
- end
53
- result
54
- end
55
-
56
- def determine_time(d1, d2, d3)
57
- now = self.class.time.now
58
- if /:/ !~ d3
59
- result = Time.parse("#{d1} #{d2} #{d3}")
60
- else
61
- result = Time.parse("#{d1} #{d2} #{now.year} #{d3}")
62
- result = Time.parse("#{d1} #{d2} #{now.year - 1} #{d3}") if
63
- result > now
64
- end
65
- result
66
- end
67
- end
68
-
69
- ##
70
- # Manage the uploading of files to an FTP account.
71
- class FtpUploader # :nodoc:
72
-
73
- # Log uploads to standard output when true.
74
- attr_accessor :verbose
75
-
76
- class << FtpUploader
77
- # Create an uploader and pass it to the given block as +up+.
78
- # When the block is complete, close the uploader.
79
- def connect(path, host, account, password)
80
- up = self.new(path, host, account, password)
81
- begin
82
- yield(up)
83
- ensure
84
- up.close
85
- end
86
- end
87
- end
88
-
89
- # Create an FTP uploader targeting the directory +path+ on +host+
90
- # using the given account and password. +path+ will be the root
91
- # path of the uploader.
92
- def initialize(path, host, account, password)
93
- @created = Hash.new
94
- @path = path
95
- @ftp = Net::FTP.new(host, account, password)
96
- makedirs(@path)
97
- @ftp.chdir(@path)
98
- end
99
-
100
- # Create the directory +path+ in the uploader root path.
101
- def makedirs(path)
102
- route = []
103
- File.split(path).each do |dir|
104
- route << dir
105
- current_dir = File.join(route)
106
- if @created[current_dir].nil?
107
- @created[current_dir] = true
108
- $stderr.puts "Creating Directory #{current_dir}" if @verbose
109
- @ftp.mkdir(current_dir) rescue nil
110
- end
111
- end
112
- end
113
-
114
- # Upload all files matching +wildcard+ to the uploader's root
115
- # path.
116
- def upload_files(wildcard)
117
- FileList.glob(wildcard).each do |fn|
118
- upload(fn)
119
- end
120
- end
121
-
122
- # Close the uploader.
123
- def close
124
- @ftp.close
125
- end
126
-
127
- private # --------------------------------------------------------
128
-
129
- # Upload a single file to the uploader's root path.
130
- def upload(file)
131
- $stderr.puts "Uploading #{file}" if @verbose
132
- dir = File.dirname(file)
133
- makedirs(dir)
134
- @ftp.putbinaryfile(file, file) unless File.directory?(file)
135
- end
136
- end
137
- end
@@ -1,81 +0,0 @@
1
- # Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com)
2
- # All rights reserved.
3
-
4
- # :stopdoc:
5
-
6
- # Configuration information about an upload host system.
7
- # name :: Name of host system.
8
- # webdir :: Base directory for the web information for the
9
- # application. The application name (APP) is appended to
10
- # this directory before using.
11
- # pkgdir :: Directory on the host system where packages can be
12
- # placed.
13
- HostInfo = Struct.new(:name, :webdir, :pkgdir)
14
-
15
- # :startdoc:
16
-
17
- # TODO: Move to contrib/sshpublisher
18
- #--
19
- # Manage several publishers as a single entity.
20
- class CompositePublisher # :nodoc:
21
- def initialize
22
- @publishers = []
23
- end
24
-
25
- # Add a publisher to the composite.
26
- def add(pub)
27
- @publishers << pub
28
- end
29
-
30
- # Upload all the individual publishers.
31
- def upload
32
- @publishers.each { |p| p.upload }
33
- end
34
- end
35
-
36
- # TODO: Remove in Rake 11, duplicated
37
- #--
38
- # Publish an entire directory to an existing remote directory using
39
- # SSH.
40
- class SshDirPublisher # :nodoc: all
41
- def initialize(host, remote_dir, local_dir)
42
- @host = host
43
- @remote_dir = remote_dir
44
- @local_dir = local_dir
45
- end
46
-
47
- def upload
48
- run %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}}
49
- end
50
- end
51
-
52
- # TODO: Remove in Rake 11, duplicated
53
- #--
54
- # Publish an entire directory to a fresh remote directory using SSH.
55
- class SshFreshDirPublisher < SshDirPublisher # :nodoc: all
56
- def upload
57
- run %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil
58
- run %{ssh #{@host} mkdir #{@remote_dir}}
59
- super
60
- end
61
- end
62
-
63
- # TODO: Remove in Rake 11, duplicated
64
- #--
65
- # Publish a list of files to an existing remote directory.
66
- class SshFilePublisher # :nodoc: all
67
- # Create a publisher using the give host information.
68
- def initialize(host, remote_dir, local_dir, *files)
69
- @host = host
70
- @remote_dir = remote_dir
71
- @local_dir = local_dir
72
- @files = files
73
- end
74
-
75
- # Upload the local directory to the remote directory.
76
- def upload
77
- @files.each do |fn|
78
- run %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}
79
- end
80
- end
81
- end
@@ -1,18 +0,0 @@
1
- # TODO: Remove in Rake 11
2
-
3
- require 'rake/contrib/sshpublisher'
4
-
5
- module Rake
6
-
7
- class RubyForgePublisher < SshDirPublisher # :nodoc: all
8
- attr_reader :project, :proj_id, :user
9
-
10
- def initialize(projname, user)
11
- super(
12
- "#{user}@rubyforge.org",
13
- "/var/www/gforge-projects/#{projname}",
14
- "html")
15
- end
16
- end
17
-
18
- end
@@ -1,61 +0,0 @@
1
- require 'rake/dsl_definition'
2
- require 'rake/contrib/compositepublisher'
3
-
4
- module Rake
5
-
6
- # Publish an entire directory to an existing remote directory using
7
- # SSH.
8
- class SshDirPublisher
9
- include Rake::DSL
10
-
11
- # Creates an SSH publisher which will scp all files in +local_dir+ to
12
- # +remote_dir+ on +host+
13
-
14
- def initialize(host, remote_dir, local_dir)
15
- @host = host
16
- @remote_dir = remote_dir
17
- @local_dir = local_dir
18
- end
19
-
20
- # Uploads the files
21
-
22
- def upload
23
- sh "scp", "-rq", "#{@local_dir}/*", "#{@host}:#{@remote_dir}"
24
- end
25
- end
26
-
27
- # Publish an entire directory to a fresh remote directory using SSH.
28
- class SshFreshDirPublisher < SshDirPublisher
29
-
30
- # Uploads the files after removing the existing remote directory.
31
-
32
- def upload
33
- sh "ssh", @host, "rm", "-rf", @remote_dir rescue nil
34
- sh "ssh", @host, "mkdir", @remote_dir
35
- super
36
- end
37
- end
38
-
39
- # Publish a list of files to an existing remote directory.
40
- class SshFilePublisher
41
- include Rake::DSL
42
-
43
- # Creates an SSH publisher which will scp all +files+ in +local_dir+ to
44
- # +remote_dir+ on +host+.
45
-
46
- def initialize(host, remote_dir, local_dir, *files)
47
- @host = host
48
- @remote_dir = remote_dir
49
- @local_dir = local_dir
50
- @files = files
51
- end
52
-
53
- # Uploads the files
54
-
55
- def upload
56
- @files.each do |fn|
57
- sh "scp", "-q", "#{@local_dir}/#{fn}", "#{@host}:#{@remote_dir}"
58
- end
59
- end
60
- end
61
- end
@@ -1,4 +0,0 @@
1
- # TODO: Remove in Rake 11
2
-
3
- fail "ERROR: 'rake/contrib/sys' is obsolete and no longer supported. " +
4
- "Use 'FileUtils' instead."
@@ -1,2 +0,0 @@
1
-
2
- # TODO: remove in Rake 11
@@ -1,25 +0,0 @@
1
- require 'rake/ext/core'
2
- require 'pathname'
3
-
4
- class Pathname
5
-
6
- rake_extension("ext") do
7
- # Return a new Pathname with <tt>String#ext</tt> applied to it.
8
- #
9
- # This Pathname extension comes from Rake
10
- def ext(newext='')
11
- Pathname.new(Rake.from_pathname(self).ext(newext))
12
- end
13
- end
14
-
15
- rake_extension("pathmap") do
16
- # Apply the pathmap spec to the Pathname, returning a
17
- # new Pathname with the modified paths. (See String#pathmap for
18
- # details.)
19
- #
20
- # This Pathname extension comes from Rake
21
- def pathmap(spec=nil, &block)
22
- Pathname.new(Rake.from_pathname(self).pathmap(spec, &block))
23
- end
24
- end
25
- end
data/lib/rake/ext/time.rb DELETED
@@ -1,18 +0,0 @@
1
- #--
2
- # Extensions to time to allow comparisons with early and late time classes.
3
-
4
- require 'rake/early_time'
5
- require 'rake/late_time'
6
-
7
- if RUBY_VERSION < "1.9"
8
- class Time # :nodoc: all
9
- alias rake_original_time_compare :<=>
10
- def <=>(other)
11
- if Rake::EarlyTime === other || Rake::LateTime === other
12
- - other.<=>(self)
13
- else
14
- rake_original_time_compare(other)
15
- end
16
- end
17
- end
18
- end
@@ -1,4 +0,0 @@
1
- # TODO: Remove in Rake 11
2
-
3
- fail "ERROR: 'rake/gempackagetask' is obsolete and no longer supported. " +
4
- "Use 'rubygems/package_task' instead."
data/lib/rake/pathmap.rb DELETED
@@ -1,3 +0,0 @@
1
- # TODO: Remove in Rake 11
2
-
3
- require 'rake/ext/string'
data/lib/rake/rdoctask.rb DELETED
@@ -1,4 +0,0 @@
1
- # TODO: Remove in Rake 11
2
-
3
- fail "ERROR: 'rake/rdoctask' is obsolete and no longer supported. " +
4
- "Use 'rdoc/task' (available in RDoc 2.4.2+) instead."
@@ -1,29 +0,0 @@
1
- # TODO: Remove in rake 11
2
-
3
- # Local Rake override to fix bug in Ruby 0.8.2
4
- module Test # :nodoc:
5
- # Local Rake override to fix bug in Ruby 0.8.2
6
- module Unit # :nodoc:
7
- # Local Rake override to fix bug in Ruby 0.8.2
8
- module Collector # :nodoc:
9
- # Local Rake override to fix bug in Ruby 0.8.2
10
- class Dir # :nodoc:
11
- undef collect_file
12
- def collect_file(name, suites, already_gathered) # :nodoc:
13
- dir = File.dirname(File.expand_path(name))
14
- $:.unshift(dir) unless $:.first == dir
15
- if @req
16
- @req.require(name)
17
- else
18
- require(name)
19
- end
20
- find_test_cases(already_gathered).each do |t|
21
- add_suite(suites, t.suite)
22
- end
23
- ensure
24
- $:.delete_at $:.rindex(dir)
25
- end
26
- end
27
- end
28
- end
29
- end
data/lib/rake/runtest.rb DELETED
@@ -1,27 +0,0 @@
1
- require 'test/unit'
2
- require 'test/unit/assertions'
3
- require 'rake/file_list'
4
-
5
- module Rake
6
- include Test::Unit::Assertions
7
-
8
- ##
9
- # Deprecated way of running tests in process, but only for Test::Unit.
10
- #--
11
- # TODO: Remove in rake 11
12
-
13
- def run_tests(pattern='test/test*.rb', log_enabled=false) # :nodoc:
14
- FileList.glob(pattern).each do |fn|
15
- $stderr.puts fn if log_enabled
16
- begin
17
- require fn
18
- rescue Exception => ex
19
- $stderr.puts "Error in #{fn}: #{ex.message}"
20
- $stderr.puts ex.backtrace
21
- assert false
22
- end
23
- end
24
- end
25
-
26
- extend self
27
- end
data/rakelib/publish.rake DELETED
@@ -1,20 +0,0 @@
1
- # Optional publish task for Rake
2
-
3
- begin
4
- require 'rake/contrib/sshpublisher'
5
- require 'rake/contrib/rubyforgepublisher'
6
-
7
- publisher = Rake::SshDirPublisher.new(
8
- 'linode',
9
- 'htdocs/software/rake',
10
- 'html')
11
-
12
- desc "Publish the Documentation to RubyForge."
13
- task :publish => [:rdoc] do
14
- publisher.upload
15
- end
16
-
17
- rescue LoadError => ex
18
- puts "#{ex.message} (#{ex.class})"
19
- puts "No Publisher Task Available"
20
- end
@@ -1,25 +0,0 @@
1
- module TestTimes
2
- def self.run(test_results, limit=0)
3
- limit = limit.nonzero? || 10
4
- tests = []
5
- test_results.split(/\n/).each do |line|
6
- if line =~ /^(.+?#[^:]+): ([0-9.]+) s: \.$/
7
- tests << [$1, $2.to_f, line]
8
- end
9
- end
10
-
11
- puts "#{limit} Slowest tests"
12
- puts tests.sort_by { |item|
13
- item[1]
14
- }.reverse[0...limit].map { |item|
15
- "%6.3f: %-s\n" % [item[1], item[0]]
16
- }
17
- end
18
- end
19
-
20
- namespace :test do
21
- desc "Find the slowest unit tests"
22
- task :times, [:limit] do |t, args|
23
- TestTimes.run `rake test:units TESTOPTS='--verbose'`, args.limit.to_i
24
- end
25
- end