rake 10.5.0 → 11.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rake might be problematic. Click here for more details.

Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/History.rdoc +34 -0
  3. data/Manifest.txt +1 -13
  4. data/README.rdoc +20 -2
  5. data/Rakefile +3 -2
  6. data/lib/rake.rb +2 -8
  7. data/lib/rake/application.rb +2 -5
  8. data/lib/rake/contrib/sshpublisher.rb +0 -1
  9. data/lib/rake/cpu_counter.rb +4 -9
  10. data/lib/rake/dsl_definition.rb +0 -7
  11. data/lib/rake/ext/fixnum.rb +18 -0
  12. data/lib/rake/file_list.rb +22 -14
  13. data/lib/rake/file_utils.rb +1 -6
  14. data/lib/rake/linked_list.rb +23 -15
  15. data/lib/rake/task.rb +9 -1
  16. data/lib/rake/task_arguments.rb +4 -0
  17. data/lib/rake/task_manager.rb +0 -4
  18. data/lib/rake/tasklib.rb +0 -13
  19. data/lib/rake/testtask.rb +3 -11
  20. data/lib/rake/thread_pool.rb +1 -2
  21. data/lib/rake/trace_output.rb +1 -1
  22. data/lib/rake/win32.rb +2 -8
  23. data/test/helper.rb +15 -10
  24. data/test/support/rakefile_definitions.rb +1 -3
  25. data/test/test_rake_application.rb +16 -0
  26. data/test/test_rake_application_options.rb +1 -1
  27. data/test/test_rake_file_list.rb +17 -0
  28. data/test/test_rake_file_list_path_map.rb +7 -0
  29. data/test/test_rake_file_utils.rb +4 -0
  30. data/test/test_rake_functional.rb +4 -2
  31. data/test/test_rake_task.rb +37 -0
  32. data/test/test_rake_task_arguments.rb +7 -0
  33. data/test/test_rake_test_task.rb +8 -23
  34. metadata +7 -17
  35. data/lib/rake/alt_system.rb +0 -110
  36. data/lib/rake/contrib/publisher.rb +0 -81
  37. data/lib/rake/contrib/rubyforgepublisher.rb +0 -18
  38. data/lib/rake/contrib/sys.rb +0 -4
  39. data/lib/rake/ext/module.rb +0 -2
  40. data/lib/rake/ext/time.rb +0 -18
  41. data/lib/rake/gempackagetask.rb +0 -4
  42. data/lib/rake/pathmap.rb +0 -3
  43. data/lib/rake/rdoctask.rb +0 -4
  44. data/lib/rake/ruby182_test_unit_fix.rb +0 -29
  45. data/lib/rake/runtest.rb +0 -27
  46. data/rakelib/publish.rake +0 -20
  47. data/test/test_rake_task_lib.rb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf5f8a6372c47a0e92776d846d4101f6caf9f9b8
4
- data.tar.gz: 1d42fb2ecdd29aab1b383266afe3ae9241b297f8
3
+ metadata.gz: 11cd090d55f1c1fd3a271a49887194f6b4a99095
4
+ data.tar.gz: 1d62850876318ab0378d03ecd2d11ac677adca21
5
5
  SHA512:
6
- metadata.gz: 47849658b050f0cc282ed7e43159b26d5e7a981623e866b063e2705fd824f75d0e4cf52990c8ea0cc2ffeb827f08da4d2ee2295505987e33a5cedfc33e9a56d5
7
- data.tar.gz: c93f0cdca921cf567929d737ff91d2ea5f5e0c342029a48183d3cad2246da9a65e2ea3649781da77b366f12c90f21b67d1ddc07171ae2c17e0a2ef3cb21001dd
6
+ metadata.gz: 2e90cdc8ce5c29fb960dadd30947bb0e447f30d77685df2834f3027ea09a3810cbf837b3bb62130e26a526d2df065ba64c3ec84e0c668eeb76fd758ae465881f
7
+ data.tar.gz: 7ff231f226fc5e252aac680f0eaa5de895a23ee3fdf11d6d142b3ab7ae0c38aad29afa5ff03d52b4362806c48a68159c71024f1d7a320e7648f536d4284fc7a6
@@ -1,3 +1,37 @@
1
+ === 11.0.0(dev) / 2016-
2
+
3
+ Bug fixes:
4
+
5
+ * Correctly handle bad encoding in exception messages. Pull request #113
6
+ by Tomer Brisker
7
+ * Fix verbose option at TestTask. Pull request #67 by Mike Blumtritt
8
+
9
+ Enhancements:
10
+
11
+ * Make FileList#exclude more analogous to FileList#include.
12
+ * Use IO.open instead of Open3.popen3 for CPU counter.
13
+ * Make Rake::Task#already_invoked publicly accessible.
14
+ Pull request #93 by Joe Rafaniello
15
+ * Lookup prerequisites with same name outside of scope instead of
16
+ matching self. Pull request #96 by Sandy Vanderbleek
17
+ * Make FileList#pathmap behave like String#pathmap.
18
+ Pull request #61 by Daniel Tamai
19
+ * Add fetch method to task arguments.
20
+ Pull request #12 by Chris Keathley
21
+ * Use ruby warnings by default. Pull request #97 by Harold Giménez
22
+
23
+ Compatibility Changes:
24
+
25
+ * Removed to support Ruby 1.8.x
26
+ * Removed constant named `RAKEVERSION`
27
+ * Removed Rake::AltSystem
28
+ * Removed Rake::RubyForgePublisher
29
+ * Removed Rake::TaskManager#last_comment. Use last_description.
30
+ * Removed Rake::TaskLib#paste
31
+ * Removed Top-level SshDirPublisher, SshFreshDirPublisher, SshFilePublisher
32
+ and CompositePublisher from lib/rake/contrib/publisher.rb
33
+ * Removed "rake/runtest.rb"
34
+
1
35
  === 10.5.0 / 2016-01-13
2
36
 
3
37
  Enhancements:
@@ -51,7 +51,6 @@ doc/release_notes/rake-10.0.2.rdoc
51
51
  doc/release_notes/rake-10.0.3.rdoc
52
52
  doc/release_notes/rake-10.1.0.rdoc
53
53
  lib/rake.rb
54
- lib/rake/alt_system.rb
55
54
  lib/rake/application.rb
56
55
  lib/rake/backtrace.rb
57
56
  lib/rake/clean.rb
@@ -59,25 +58,20 @@ lib/rake/cloneable.rb
59
58
  lib/rake/contrib/.document
60
59
  lib/rake/contrib/compositepublisher.rb
61
60
  lib/rake/contrib/ftptools.rb
62
- lib/rake/contrib/publisher.rb
63
- lib/rake/contrib/rubyforgepublisher.rb
64
61
  lib/rake/contrib/sshpublisher.rb
65
- lib/rake/contrib/sys.rb
66
62
  lib/rake/cpu_counter.rb
67
63
  lib/rake/default_loader.rb
68
64
  lib/rake/dsl_definition.rb
69
65
  lib/rake/early_time.rb
70
66
  lib/rake/ext/core.rb
71
- lib/rake/ext/module.rb
67
+ lib/rake/ext/fixnum.rb
72
68
  lib/rake/ext/pathname.rb
73
69
  lib/rake/ext/string.rb
74
- lib/rake/ext/time.rb
75
70
  lib/rake/file_creation_task.rb
76
71
  lib/rake/file_list.rb
77
72
  lib/rake/file_task.rb
78
73
  lib/rake/file_utils.rb
79
74
  lib/rake/file_utils_ext.rb
80
- lib/rake/gempackagetask.rb
81
75
  lib/rake/invocation_chain.rb
82
76
  lib/rake/invocation_exception_mixin.rb
83
77
  lib/rake/late_time.rb
@@ -86,17 +80,13 @@ lib/rake/loaders/makefile.rb
86
80
  lib/rake/multi_task.rb
87
81
  lib/rake/name_space.rb
88
82
  lib/rake/packagetask.rb
89
- lib/rake/pathmap.rb
90
83
  lib/rake/phony.rb
91
84
  lib/rake/private_reader.rb
92
85
  lib/rake/promise.rb
93
86
  lib/rake/pseudo_status.rb
94
87
  lib/rake/rake_module.rb
95
88
  lib/rake/rake_test_loader.rb
96
- lib/rake/rdoctask.rb
97
- lib/rake/ruby182_test_unit_fix.rb
98
89
  lib/rake/rule_recursion_overflow_error.rb
99
- lib/rake/runtest.rb
100
90
  lib/rake/scope.rb
101
91
  lib/rake/task.rb
102
92
  lib/rake/task_argument_error.rb
@@ -109,7 +99,6 @@ lib/rake/thread_pool.rb
109
99
  lib/rake/trace_output.rb
110
100
  lib/rake/version.rb
111
101
  lib/rake/win32.rb
112
- rakelib/publish.rake
113
102
  rakelib/test_times.rake
114
103
  test/file_creation.rb
115
104
  test/helper.rb
@@ -154,7 +143,6 @@ test/test_rake_scope.rb
154
143
  test/test_rake_task.rb
155
144
  test/test_rake_task_argument_parsing.rb
156
145
  test/test_rake_task_arguments.rb
157
- test/test_rake_task_lib.rb
158
146
  test/test_rake_task_manager.rb
159
147
  test/test_rake_task_manager_argument_resolution.rb
160
148
  test/test_rake_task_with_arguments.rb
@@ -3,7 +3,7 @@
3
3
  home :: https://github.com/ruby/rake
4
4
  bugs :: https://github.com/ruby/rake/issues
5
5
  docs :: http://docs.seattlerb.org/rake/
6
- build :: {<img src="https://travis-ci.org/ruby/rake.svg?branch=master" alt="travis-ci">}[https://travis-ci.org/ruby/rake]
6
+ build status :: {<img src="https://travis-ci.org/ruby/rake.svg?branch=master" alt="travis-ci">}[https://travis-ci.org/ruby/rake] {<img src="https://ci.appveyor.com/api/projects/status/github/ruby/rake?branch=master&svg=true" alt="appveyor">}[https://ci.appveyor.com/project/ruby/rake]
7
7
 
8
8
  == Description
9
9
 
@@ -108,6 +108,8 @@ other projects with similar (and not so similar) goals.
108
108
 
109
109
  == Credits
110
110
 
111
+ [<b>Jim Weirich</b>] Who originally created Rake.
112
+
111
113
  [<b>Ryan Dlugosz</b>] For the initial conversation that sparked Rake.
112
114
 
113
115
  [<b>Nobuyoshi Nakada <nobu@ruby-lang.org></b>] For the initial patch for rule support.
@@ -116,6 +118,8 @@ other projects with similar (and not so similar) goals.
116
118
 
117
119
  [<b>Eric Hodel</b>] For aid in maintaining rake.
118
120
 
121
+ [<b>Hiroshi SHIBATA</b>] Maintainer of Rake 10.X and Rake 11.X
122
+
119
123
  == License
120
124
 
121
125
  Rake is available under an MIT-style license.
@@ -127,7 +131,7 @@ Rake is available under an MIT-style license.
127
131
  = Other stuff
128
132
 
129
133
  Author:: Jim Weirich <jim.weirich@gmail.com>
130
- Requires:: Ruby 1.8.7 or later
134
+ Requires:: Ruby 1.9.3 or later
131
135
  License:: Copyright Jim Weirich.
132
136
  Released under an MIT-style license. See the MIT-LICENSE
133
137
  file included in the distribution.
@@ -137,3 +141,17 @@ License:: Copyright Jim Weirich.
137
141
  This software is provided "as is" and without any express or implied
138
142
  warranties, including, without limitation, the implied warranties of
139
143
  merchantability and fitness for a particular purpose.
144
+
145
+ == Historical
146
+
147
+ Rake was originally created by Jim Weirich, who unfortunately passed away in
148
+ February 2014. This repository was originally hosted at
149
+ {github.com/jimweirich/rake}[https://github.com/jimweirich/rake/], however
150
+ with his passing, has been moved to {ruby/rake}[https://github.com/ruby/rake].
151
+
152
+ You can view Jim's last commit here:
153
+ https://github.com/jimweirich/rake/tree/336559f28f55bce418e2ebcc0a57548dcbac4025
154
+
155
+ You can {read more about Jim}[https://en.wikipedia.org/wiki/Jim_Weirich] at Wikipedia.
156
+
157
+ Thank you for this great tool, Jim. We'll remember you.
data/Rakefile CHANGED
@@ -20,12 +20,14 @@ require 'hoe'
20
20
  Hoe.plugin :git
21
21
  Hoe.plugin :minitest
22
22
  Hoe.plugin :travis
23
+ Hoe.plugin :gemspec
23
24
 
24
25
  hoe = Hoe.spec 'rake' do
26
+ developer 'Hiroshi SHIBATA', 'hsbt@ruby-lang.org'
25
27
  developer 'Eric Hodel', 'drbrain@segment7.net'
26
28
  developer 'Jim Weirich', ''
27
29
 
28
- require_ruby_version '>= 1.8.7'
30
+ require_ruby_version '>= 1.9.3'
29
31
  require_rubygems_version '>= 1.3.2'
30
32
 
31
33
  dependency 'minitest', '~> 5.0', :developer
@@ -78,4 +80,3 @@ begin
78
80
  rescue LoadError
79
81
  warn 'run `rake newb` to install rdoc'
80
82
  end
81
-
@@ -21,16 +21,11 @@
21
21
  #++
22
22
 
23
23
  module Rake
24
- VERSION = '10.5.0'
24
+ VERSION = '11.0.1'
25
25
  end
26
26
 
27
27
  require 'rake/version'
28
28
 
29
- # :stopdoc:
30
- # TODO: Remove in Rake 11
31
- RAKEVERSION = Rake::VERSION
32
- # :startdoc:
33
-
34
29
  require 'rbconfig'
35
30
  require 'fileutils'
36
31
  require 'singleton'
@@ -38,9 +33,8 @@ require 'monitor'
38
33
  require 'optparse'
39
34
  require 'ostruct'
40
35
 
41
- require 'rake/ext/module'
42
36
  require 'rake/ext/string'
43
- require 'rake/ext/time'
37
+ require 'rake/ext/fixnum'
44
38
 
45
39
  require 'rake/win32'
46
40
 
@@ -452,7 +452,7 @@ module Rake
452
452
  "(default is number of CPU cores + 4)",
453
453
  lambda { |value|
454
454
  if value.nil? || value == ''
455
- value = FIXNUM_MAX
455
+ value = Fixnum::MAX
456
456
  elsif value =~ /^\d+$/
457
457
  value = value.to_i
458
458
  else
@@ -575,7 +575,7 @@ module Rake
575
575
  ['--version', '-V',
576
576
  "Display the program version.",
577
577
  lambda { |value|
578
- puts "rake, version #{RAKEVERSION}"
578
+ puts "rake, version #{Rake::VERSION}"
579
579
  exit
580
580
  }
581
581
  ],
@@ -783,8 +783,5 @@ module Rake
783
783
  backtrace.find { |str| str =~ re } || ''
784
784
  end
785
785
 
786
- private
787
- FIXNUM_MAX = (2**(0.size * 8 - 2) - 1) # :nodoc:
788
-
789
786
  end
790
787
  end
@@ -2,7 +2,6 @@ require 'rake/dsl_definition'
2
2
  require 'rake/contrib/compositepublisher'
3
3
 
4
4
  module Rake
5
-
6
5
  # Publish an entire directory to an existing remote directory using
7
6
  # SSH.
8
7
  class SshDirPublisher
@@ -30,9 +30,6 @@ unless Rake::CpuCounter.method_defined?(:count)
30
30
  Rake::CpuCounter.class_eval <<-'end;', __FILE__, __LINE__+1
31
31
  require 'rbconfig'
32
32
 
33
- # TODO: replace with IO.popen using array-style arguments in Rake 11
34
- require 'open3'
35
-
36
33
  def count
37
34
  if defined?(Java::Java)
38
35
  count_via_java_runtime
@@ -95,10 +92,8 @@ unless Rake::CpuCounter.method_defined?(:count)
95
92
  def run(command, *args)
96
93
  cmd = resolve_command(command)
97
94
  if cmd
98
- Open3.popen3 cmd, *args do |inn, out, err,|
99
- inn.close
100
- err.read
101
- out.read.to_i
95
+ IO.popen [cmd, *args] do |io|
96
+ io.read.to_i
102
97
  end
103
98
  else
104
99
  nil
@@ -117,8 +112,8 @@ unless Rake::CpuCounter.method_defined?(:count)
117
112
  end
118
113
 
119
114
  def in_path_command(command)
120
- Open3.popen3 'which', command do |_, out,|
121
- out.eof? ? nil : command
115
+ IO.popen ['which', command] do |io|
116
+ io.eof? ? nil : command
122
117
  end
123
118
  end
124
119
  end;
@@ -28,7 +28,6 @@ module Rake
28
28
  # task task_name
29
29
  # task task_name: dependencies
30
30
  # task task_name, arguments => dependencies
31
- # task task_name, argument[, argument ...], :needs: dependencies
32
31
  #
33
32
  # Declare a basic task. The +task_name+ is always the first argument. If
34
33
  # the task name contains a ":" it is defined in that namespace.
@@ -56,12 +55,6 @@ module Rake
56
55
  #
57
56
  # $ rake package[1.2.3]
58
57
  #
59
- # Alternate definition:
60
- #
61
- # task :package, :version, needs: :test do |t, args|
62
- # # ...
63
- # end
64
- #
65
58
  def task(*args, &block) # :doc:
66
59
  Rake::Task.define_task(*args, &block)
67
60
  end
@@ -0,0 +1,18 @@
1
+ #--
2
+ # Extensions to fixnum to define some constants missing from Ruby itself
3
+
4
+ class Fixnum
5
+
6
+ unless constants.include? :MAX
7
+
8
+ # future versions of Ruby may end up defining this constant
9
+ # in a more portable way, as documented by Matz himself in:
10
+ #
11
+ # https://bugs.ruby-lang.org/issues/7517
12
+ #
13
+ # ... but until such time, we define the constant ourselves
14
+ MAX = (2**(0.size * 8 - 2) - 1) # :nodoc:
15
+
16
+ end
17
+
18
+ end
@@ -1,7 +1,6 @@
1
1
  require 'rake/cloneable'
2
2
  require 'rake/file_utils_ext'
3
- require 'rake/pathmap'
4
-
3
+ require 'rake/ext/string'
5
4
 
6
5
  module Rake
7
6
 
@@ -85,6 +84,8 @@ module Rake
85
84
  end
86
85
  end
87
86
 
87
+ GLOB_PATTERN = %r{[*?\[\{]}
88
+
88
89
  # Create a file list from the globbable patterns given. If you wish to
89
90
  # perform multiple includes or excludes at object build time, use the
90
91
  # "yield self" pattern.
@@ -149,7 +150,11 @@ module Rake
149
150
  #
150
151
  def exclude(*patterns, &block)
151
152
  patterns.each do |pat|
152
- @exclude_patterns << Rake.from_pathname(pat)
153
+ if pat.respond_to? :to_ary
154
+ exclude(*pat.to_ary)
155
+ else
156
+ @exclude_patterns << Rake.from_pathname(pat)
157
+ end
153
158
  end
154
159
  @exclude_procs << block if block_given?
155
160
  resolve_exclude unless @pending
@@ -190,7 +195,7 @@ module Rake
190
195
  result = @items * other
191
196
  case result
192
197
  when Array
193
- FileList.new.import(result)
198
+ self.class.new.import(result)
194
199
  else
195
200
  result
196
201
  end
@@ -215,7 +220,7 @@ module Rake
215
220
 
216
221
  def resolve_add(fn) # :nodoc:
217
222
  case fn
218
- when %r{[*?\[\{]}
223
+ when GLOB_PATTERN
219
224
  add_matching(fn)
220
225
  else
221
226
  self << fn
@@ -236,7 +241,7 @@ module Rake
236
241
  # FileList['a.c', 'b.c'].sub(/\.c$/, '.o') => ['a.o', 'b.o']
237
242
  #
238
243
  def sub(pat, rep)
239
- inject(FileList.new) { |res, fn| res << fn.sub(pat, rep) }
244
+ inject(self.class.new) { |res, fn| res << fn.sub(pat, rep) }
240
245
  end
241
246
 
242
247
  # Return a new FileList with the results of running +gsub+ against each
@@ -247,7 +252,7 @@ module Rake
247
252
  # => ['lib\\test\\file', 'x\\y']
248
253
  #
249
254
  def gsub(pat, rep)
250
- inject(FileList.new) { |res, fn| res << fn.gsub(pat, rep) }
255
+ inject(self.class.new) { |res, fn| res << fn.gsub(pat, rep) }
251
256
  end
252
257
 
253
258
  # Same as +sub+ except that the original file list is modified.
@@ -265,8 +270,8 @@ module Rake
265
270
  # Apply the pathmap spec to each of the included file names, returning a
266
271
  # new file list with the modified paths. (See String#pathmap for
267
272
  # details.)
268
- def pathmap(spec=nil)
269
- collect { |fn| fn.pathmap(spec) }
273
+ def pathmap(spec=nil, &block)
274
+ collect { |fn| fn.pathmap(spec, &block) }
270
275
  end
271
276
 
272
277
  # Return a new FileList with <tt>String#ext</tt> method applied to
@@ -331,8 +336,8 @@ module Rake
331
336
  resolve
332
337
  result = @items.partition(&block)
333
338
  [
334
- FileList.new.import(result[0]),
335
- FileList.new.import(result[1]),
339
+ self.class.new.import(result[0]),
340
+ self.class.new.import(result[1]),
336
341
  ]
337
342
  end
338
343
 
@@ -344,7 +349,7 @@ module Rake
344
349
 
345
350
  # Add matching glob patterns.
346
351
  def add_matching(pattern)
347
- FileList.glob(pattern).each do |fn|
352
+ self.class.glob(pattern).each do |fn|
348
353
  self << fn unless excluded_from_list?(fn)
349
354
  end
350
355
  end
@@ -362,8 +367,11 @@ module Rake
362
367
  case pat
363
368
  when Regexp
364
369
  fn =~ pat
365
- when /[*?]/
366
- File.fnmatch?(pat, fn, File::FNM_PATHNAME)
370
+ when GLOB_PATTERN
371
+ flags = File::FNM_PATHNAME
372
+ # Ruby <= 1.9.3 does not support File::FNM_EXTGLOB
373
+ flags |= File::FNM_EXTGLOB if defined? File::FNM_EXTGLOB
374
+ File.fnmatch?(pat, fn, flags)
367
375
  else
368
376
  fn == pat
369
377
  end
@@ -51,7 +51,7 @@ module FileUtils
51
51
  Rake.rake_output_message cmd.join(" ") if options[:verbose]
52
52
 
53
53
  unless options[:noop]
54
- res = rake_system(*cmd)
54
+ res = system(*cmd)
55
55
  status = $?
56
56
  status = Rake::PseudoStatus.new(1) if !res && status.nil?
57
57
  shell_runner.call(res, status)
@@ -78,11 +78,6 @@ module FileUtils
78
78
  end
79
79
  private :set_verbose_option
80
80
 
81
- def rake_system(*cmd) # :nodoc:
82
- Rake::AltSystem.system(*cmd)
83
- end
84
- private :rake_system
85
-
86
81
  # Run a Ruby interpreter with the given arguments.
87
82
  #
88
83
  # Example: