rake 13.0.6 → 13.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d15ff579792b6bca336893adc15bc3de3d8c8580fcdb2b2201926df30752284d
4
- data.tar.gz: 499353c3ebbcd6492fb8d9fdd96078bf7954c1b3ec21f1d80bac8bf1ea592ea0
3
+ metadata.gz: cfe5b4f5e81cce0e32a3ce50bf983e66cd0fbb9691024535871b47a62b853547
4
+ data.tar.gz: 4c50bedf20dc9118e96254761a2022830a7c5352baceef6d80d1896754c1fa80
5
5
  SHA512:
6
- metadata.gz: 664fa6daddc629e8bb6fd1863a765e8a7d7f2eda234ab423800dc810fe9bded3d4622e19f633e4307d322cd14adfb0c197de04394df1a0a6fa0b86fc702a7d93
7
- data.tar.gz: 7f0f7208745a41dacf9959b2a4ee063deeee549d0d2e90904c47d3e84feb976e65fcc4e33f943eefdfa0ec0334e83b63ad280be0ff3926aff471a9c0b25acef9
6
+ metadata.gz: 94113a1b66b6fd97d3960b6aa8b3c6da816235c5bb51108359fb0a713e84b2705715d5e830c105371a25362b5ad43beac3b519aaf0f74313e96aeea162325348
7
+ data.tar.gz: 16351c391ea6a747767dd8c4c211c89209dbc7f59ae8139d4077a5b317da80d3b17a48e4fe1226081256226356b786ec147f2b96bf633af98964e6ad75d2f82e
data/History.rdoc CHANGED
@@ -1,3 +1,54 @@
1
+ === 13.2.1
2
+
3
+ * Suppressed "internal:array:52:in 'Array#each'" from backtrace by @hsbt in #554
4
+ * Bump actions/configure-pages from 4 to 5 by @dependabot in #553
5
+
6
+ === 13.2.0
7
+
8
+ * Fix rule example to be correct by @zenspider in #525
9
+ * Switch to use test-unit by @hsbt in #536
10
+ * Removed redundant block by @hsbt in #537
11
+ * Use Struct instead of OpenStruct. by @hsbt in #545
12
+ * Accept FileList object as directory task's target by @gemmaro in #530
13
+ * Fix exception when exception has nil backtrace by @janbiedermann in #451
14
+ * Add TruffleRuby on CI by @andrykonchin in #551
15
+
16
+ === 13.1.0
17
+
18
+ * Added dependabot.yml for actions by @hsbt in #416
19
+ * Add Ruby 3.1 to the CI matrix by @petergoldstein in #415
20
+ * (Performance) Remove unnecessary I/O syscalls for FileTasks by @da2x in #393
21
+ * Skip test failure with JRuby by @hsbt in #418
22
+ * Remove bin/rdoc by @tnir in #421
23
+ * Remove bin/rake by @tnir in #422
24
+ * Remove bin/bundle by @tnir in #425
25
+ * Apply RuboCop linting for Ruby 2.3 by @tnir in #423
26
+ * Update rubocop to work with Ruby 2.4 compatible by @tnir in #424
27
+ * chore: fix typo in comments by @tnir in #429
28
+ * Use 'test' as workflow name on Actions by @tnir in #427
29
+ * docs: update CONTRIBUTING.rdoc by @tnir in #428
30
+ * Add RuboCop job to Actions by @tnir in #426
31
+ * Lock minitest-5.15.0 for Ruby 2.2 by @hsbt in #442
32
+ * Eagerly require set in thread_pool.rb by @jeremyevans in #440
33
+ * Avoid creating an unnecessary thread pool by @jeremyevans in #441
34
+ * Add credit for maintenance in Rake 12/13 by @tnir in #443
35
+ * Sh fully echoes commands which error exit by @MarkDBlackwell in #147
36
+ * Correct RuboCop offenses by @deivid-rodriguez in #444
37
+ * [StepSecurity] ci: Harden GitHub Actions by @step-security-bot in #450
38
+ * Add ruby 3.2 to test matrix by @hanneskaeufler in #458
39
+ * Missing 'do' on example by @zzak in #467
40
+ * Try to use dependabot automerge by @hsbt in #470
41
+ * Rewrite auto-merge feature for dependabot by @hsbt in #471
42
+ * Update bundler in Dependabot by @ono-max in #472
43
+ * Fix grammar in help text by @mebezac in #381
44
+ * Try to use ruby/ruby/.github/workflows/ruby_versions.yml@master by @hsbt in #475
45
+ * Use GitHub Pages Action for generating rdoc page by @hsbt in #477
46
+ * Support #detailed_message when task failed by @ksss in #486
47
+ * Debug at stop when task fail by @ksss in #489
48
+ * Drop to support Ruby 2.2 by @hsbt in #492
49
+ * Bump up setup-ruby by @hsbt in #497
50
+ * Update development dependencies by @hsbt in #505
51
+
1
52
  === 13.0.6
2
53
 
3
54
  * Additional fix for #389
@@ -37,7 +88,7 @@
37
88
 
38
89
  ==== Bug fixes
39
90
 
40
- * Fixed bug: Reenabled task raises previous exception on second invokation
91
+ * Fixed bug: Reenabled task raises previous exception on second invokation
41
92
  Pull Request #271 by thorsteneckel
42
93
  * Fix an incorrectly resolved arg pattern
43
94
  Pull Request #327 by mjbellantoni
@@ -48,7 +99,7 @@
48
99
 
49
100
  * Follows recent changes on keyword arguments in ruby 2.7.
50
101
  Pull Request #326 by nobu
51
- * Make `PackageTask` be able to omit parent directory while packing files
102
+ * Make `PackageTask` be able to omit parent directory while packing files
52
103
  Pull Request #310 by tonytonyjan
53
104
  * Add order only dependency
54
105
  Pull Request #269 by take-cheeze
data/README.rdoc CHANGED
@@ -74,10 +74,10 @@ Type "rake --help" for all available options.
74
74
 
75
75
  === Rake Information
76
76
 
77
- * {Rake command-line}[link:doc/command_line_usage.rdoc]
78
- * {Writing Rakefiles}[link:doc/rakefile.rdoc]
79
- * The original {Rake announcement}[link:doc/rational.rdoc]
80
- * Rake {glossary}[link:doc/glossary.rdoc]
77
+ * {Rake command-line}[rdoc-ref:doc/command_line_usage.rdoc]
78
+ * {Writing Rakefiles}[rdoc-ref:doc/rakefile.rdoc]
79
+ * The original {Rake announcement}[rdoc-ref:doc/rational.rdoc]
80
+ * Rake {glossary}[rdoc-ref:doc/glossary.rdoc]
81
81
 
82
82
  === Presentations and Articles about Rake
83
83
 
@@ -116,7 +116,7 @@ other projects with similar (and not so similar) goals.
116
116
 
117
117
  [<b>Eric Hodel</b>] For aid in maintaining rake.
118
118
 
119
- [<b>Hiroshi SHIBATA</b>] Maintainer of Rake 10.X and Rake 11.X
119
+ [<b>Hiroshi SHIBATA</b>] Maintainer of Rake 10 and later
120
120
 
121
121
  == License
122
122
 
@@ -148,7 +148,7 @@ February 2014. This repository was originally hosted at
148
148
  with his passing, has been moved to {ruby/rake}[https://github.com/ruby/rake].
149
149
 
150
150
  You can view Jim's last commit here:
151
- https://github.com/jimweirich/rake/tree/336559f28f55bce418e2ebcc0a57548dcbac4025
151
+ https://github.com/jimweirich/rake/commit/336559f28f55bce418e2ebcc0a57548dcbac4025
152
152
 
153
153
  You can {read more about Jim}[https://en.wikipedia.org/wiki/Jim_Weirich] at Wikipedia.
154
154
 
@@ -6,10 +6,10 @@ Rake is invoked from the command line using:
6
6
 
7
7
  Options are:
8
8
 
9
- [<tt><em>name</em>=<em>value</em></tt>]
9
+ [<tt>name=value</tt>]
10
10
  Set the environment variable <em>name</em> to <em>value</em>
11
11
  during the execution of the <b>rake</b> command. You can access
12
- the value by using ENV['<em>name</em>'].
12
+ the value by using <tt>ENV['name']</tt>.
13
13
 
14
14
  [<tt>--all</tt> (-A)]
15
15
  Used in combination with the -T and -D options, will force
@@ -105,12 +105,12 @@ Options are:
105
105
  Require _name_ before executing the Rakefile.
106
106
 
107
107
  [<tt>--rules</tt>]
108
- Trace the rules resolution.
108
+ Trace the resolution of rules used to create tasks.
109
109
 
110
110
  [<tt>--silent (-s)</tt>]
111
111
  Like --quiet, but also suppresses the 'in directory' announcement.
112
112
 
113
- [<tt>--suppress-backtrace _pattern_ </tt>]
113
+ [<tt>--suppress-backtrace</tt> _pattern_]
114
114
  Line matching the regular expression _pattern_ will be removed
115
115
  from the backtrace output. Note that the --backtrace option is the
116
116
  full backtrace without these lines suppressed.
@@ -153,6 +153,19 @@ Options are:
153
153
  [<tt>--no-deprecation-warnings</tt> (-X)]
154
154
  Do not display the deprecation warnings.
155
155
 
156
+ == Environment Variables
157
+
158
+ [<tt>RAKEOPT</tt>]
159
+ Command line options can be specified in the <tt>RAKEOPT</tt>
160
+ environment variable. These options will be processed as if they
161
+ were given on the command line. This is useful for setting default
162
+ options that you want to use with every rake invocation.
163
+
164
+ For example, setting:
165
+ export RAKEOPT="-s --trace"
166
+
167
+ would cause rake to run silently with tracing enabled by default.
168
+
156
169
  In addition, any command line option of the form
157
170
  <em>VAR</em>=<em>VALUE</em> will be added to the environment hash
158
171
  <tt>ENV</tt> and may be tested in the Rakefile.
data/doc/rakefile.rdoc CHANGED
@@ -30,7 +30,7 @@ parameter that is the name of the task.
30
30
  Any prerequisites are given as a list (enclosed in square brackets)
31
31
  following the name and an arrow (=>).
32
32
 
33
- task name: [:prereq1, :prereq2]
33
+ task :name => [:prereq1, :prereq2]
34
34
 
35
35
  *NOTE:* Although this syntax looks a little funky, it is legal
36
36
  Ruby. We are constructing a hash where the key is :name and the value
@@ -360,6 +360,19 @@ The following rule might be used for Java files ...
360
360
  *NOTE:* +java_compile+ is a hypothetical method that invokes the
361
361
  java compiler.
362
362
 
363
+ === Implicit File Tasks
364
+
365
+ When a task is not defined but a file with that name exists, Rake
366
+ automatically creates an implicit file task for it. For example:
367
+
368
+ $ rake hello_world # Error: task not found
369
+ $ touch hello_world # Create a file with the same name
370
+ $ rake hello_world # Now succeeds automatically
371
+
372
+ Use the <tt>--rules</tt> command line option to trace how rules are
373
+ resolved when searching for tasks; note that creation of implicit file
374
+ tasks is not traced.
375
+
363
376
  == Importing Dependencies
364
377
 
365
378
  Any ruby file (including other rakefiles) can be included with a
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
  require "optparse"
3
3
 
4
- require "rake/task_manager"
5
- require "rake/file_list"
6
- require "rake/thread_pool"
7
- require "rake/thread_history_display"
8
- require "rake/trace_output"
9
- require "rake/win32"
4
+ require_relative "options"
5
+ require_relative "task_manager"
6
+ require_relative "file_list"
7
+ require_relative "thread_pool"
8
+ require_relative "thread_history_display"
9
+ require_relative "trace_output"
10
+ require_relative "win32"
10
11
 
11
12
  module Rake
12
13
 
@@ -94,10 +95,32 @@ module Rake
94
95
  # Backward compatibility for capistrano
95
96
  args = handle_options
96
97
  end
98
+ load_debug_at_stop_feature
97
99
  collect_command_line_tasks(args)
98
100
  end
99
101
  end
100
102
 
103
+ def load_debug_at_stop_feature
104
+ return unless ENV["RAKE_DEBUG"]
105
+ require "debug/session"
106
+ DEBUGGER__::start no_sigint_hook: true, nonstop: true
107
+ Rake::Task.prepend Module.new {
108
+ def execute(*)
109
+ exception = DEBUGGER__::SESSION.capture_exception_frames(/(exe|bin|lib)\/rake/) do
110
+ super
111
+ end
112
+
113
+ if exception
114
+ STDERR.puts exception.message
115
+ DEBUGGER__::SESSION.enter_postmortem_session exception
116
+ raise exception
117
+ end
118
+ end
119
+ }
120
+ rescue LoadError
121
+ end
122
+ private :load_debug_at_stop_feature
123
+
101
124
  # Find the rakefile and then load it and any pending imports.
102
125
  def load_rakefile
103
126
  standard_exception_handling do
@@ -123,8 +146,8 @@ module Rake
123
146
  thread_pool.gather_history if options.job_stats == :history
124
147
 
125
148
  yield
126
-
127
- thread_pool.join
149
+ ensure
150
+ thread_pool.join if defined?(@thread_pool)
128
151
  if options.job_stats
129
152
  stats = thread_pool.statistics
130
153
  puts "Maximum active threads: #{stats[:max_active_threads]} + main"
@@ -143,7 +166,7 @@ module Rake
143
166
 
144
167
  # Application options from the command line
145
168
  def options
146
- @options ||= OpenStruct.new
169
+ @options ||= Options.new
147
170
  end
148
171
 
149
172
  # Return the thread pool used for multithreaded processing.
@@ -215,7 +238,7 @@ module Rake
215
238
  display_exception_details_seen << ex
216
239
 
217
240
  display_exception_message_details(ex)
218
- display_exception_backtrace(ex)
241
+ display_exception_backtrace(ex) if ex.backtrace
219
242
  display_cause_details(ex.cause) if has_cause?(ex)
220
243
  end
221
244
 
@@ -237,6 +260,8 @@ module Rake
237
260
  def display_exception_message_details(ex) # :nodoc:
238
261
  if ex.instance_of?(RuntimeError)
239
262
  trace ex.message
263
+ elsif ex.respond_to?(:detailed_message)
264
+ trace "#{ex.class.name}: #{ex.detailed_message(highlight: false)}"
240
265
  else
241
266
  trace "#{ex.class.name}: #{ex.message}"
242
267
  end
@@ -575,7 +600,7 @@ module Rake
575
600
  ["--tasks", "-T [PATTERN]",
576
601
  "Display the tasks (matching optional PATTERN) " +
577
602
  "with descriptions, then exit. " +
578
- "-AT combination displays all of tasks contained no description.",
603
+ "-AT combination displays all the tasks, including those without descriptions.",
579
604
  lambda { |value|
580
605
  select_tasks_to_show(options, :tasks, value)
581
606
  }
@@ -661,7 +686,7 @@ module Rake
661
686
 
662
687
  # Similar to the regular Ruby +require+ command, but will check
663
688
  # for *.rake files in addition to *.rb files.
664
- def rake_require(file_name, paths=$LOAD_PATH, loaded=$") # :nodoc:
689
+ def rake_require(file_name, paths=$LOAD_PATH, loaded=$LOADED_FEATURES) # :nodoc:
665
690
  fn = file_name + ".rake"
666
691
  return false if loaded.include?(fn)
667
692
  paths.each do |path|
@@ -725,24 +750,15 @@ module Rake
725
750
 
726
751
  # The directory path containing the system wide rakefiles.
727
752
  def system_dir # :nodoc:
728
- @system_dir ||=
729
- begin
730
- if ENV["RAKE_SYSTEM"]
731
- ENV["RAKE_SYSTEM"]
732
- else
733
- standard_system_dir
734
- end
735
- end
753
+ @system_dir ||= ENV["RAKE_SYSTEM"] || standard_system_dir
736
754
  end
737
755
 
738
756
  # The standard directory containing system wide rake files.
739
- if Win32.windows?
740
- def standard_system_dir #:nodoc:
741
- Win32.win32_system_dir
742
- end
743
- else
744
- def standard_system_dir #:nodoc:
745
- File.join(File.expand_path("~"), ".rake")
757
+ def standard_system_dir #:nodoc:
758
+ if windows?
759
+ File.join(Dir.home, "Rake")
760
+ else
761
+ File.join(Dir.home, ".rake")
746
762
  end
747
763
  end
748
764
  private :standard_system_dir
@@ -10,6 +10,7 @@ module Rake
10
10
  map { |f| File.expand_path(f) }.
11
11
  reject { |s| s.nil? || s =~ /^ *$/ }
12
12
  SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|")
13
+ SUPPRESSED_PATHS_RE << "|^<internal:\\w+>"
13
14
  SUPPRESSED_PATHS_RE << "|^org\\/jruby\\/\\w+\\.java" if
14
15
  Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == "jruby"
15
16
 
data/lib/rake/clean.rb CHANGED
@@ -12,7 +12,7 @@
12
12
  # The intent of this task is to return a project to its
13
13
  # pristine, just unpacked state.
14
14
 
15
- require "rake"
15
+ require_relative "../rake"
16
16
 
17
17
  # :stopdoc:
18
18
 
@@ -58,11 +58,20 @@ unless Rake::CpuCounter.method_defined?(:count)
58
58
  end
59
59
 
60
60
  def count_via_win32
61
- require 'win32ole'
62
- wmi = WIN32OLE.connect("winmgmts://")
63
- cpu = wmi.ExecQuery("select NumberOfCores from Win32_Processor") # TODO count hyper-threaded in this
64
- cpu.to_enum.first.NumberOfCores
65
- rescue StandardError, LoadError
61
+ # Get-CimInstance introduced in PowerShell 3 or earlier: https://learn.microsoft.com/en-us/previous-versions/powershell/module/cimcmdlets/get-ciminstance?view=powershell-3.0
62
+ result = run_win32(
63
+ 'powershell -command "Get-CimInstance -ClassName Win32_Processor -Property NumberOfCores ' \
64
+ '| Select-Object -Property NumberOfCores"'
65
+ )
66
+ if !result || $?.exitstatus != 0
67
+ # fallback to deprecated wmic for older systems
68
+ result = run_win32("wmic cpu get NumberOfCores")
69
+ end
70
+
71
+ # powershell: "\nNumberOfCores\n-------------\n 4\n\n\n"
72
+ # wmic: "NumberOfCores \n\n4 \n\n\n\n"
73
+ result.scan(/\d+/).map(&:to_i).reduce(:+) if result
74
+ rescue StandardError
66
75
  nil
67
76
  end
68
77
 
@@ -87,6 +96,12 @@ unless Rake::CpuCounter.method_defined?(:count)
87
96
  end
88
97
  end
89
98
 
99
+ def run_win32(command, *args)
100
+ IO.popen(command, &:read)
101
+ rescue Errno::ENOENT
102
+ nil
103
+ end
104
+
90
105
  def resolve_command(command)
91
106
  look_for_command("/usr/sbin", command) ||
92
107
  look_for_command("/sbin", command) ||
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  # Rake DSL functions.
3
- require "rake/file_utils_ext"
3
+ require_relative "file_utils_ext"
4
4
 
5
5
  module Rake
6
6
 
@@ -90,6 +90,7 @@ module Rake
90
90
  # directory "testdata/doc"
91
91
  #
92
92
  def directory(*args, &block) # :doc:
93
+ args = args.flat_map { |arg| arg.is_a?(FileList) ? arg.to_a.flatten : arg }
93
94
  result = file_create(*args, &block)
94
95
  dir, _ = *Rake.application.resolve_args(args)
95
96
  dir = Rake.from_pathname(dir)
@@ -145,7 +146,7 @@ module Rake
145
146
  #
146
147
  # Example:
147
148
  # rule '.o' => '.c' do |t|
148
- # sh 'cc', '-o', t.name, t.source
149
+ # sh 'cc', '-c', '-o', t.name, t.source
149
150
  # end
150
151
  #
151
152
  def rule(*args, &block) # :doc:
@@ -158,7 +159,7 @@ module Rake
158
159
  #
159
160
  # Example:
160
161
  # desc "Run the Unit Tests"
161
- # task test: [:build]
162
+ # task test: [:build] do
162
163
  # # ... run tests
163
164
  # end
164
165
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "rake/ext/core"
2
+ require_relative "core"
3
3
 
4
4
  class String
5
5
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require "rake/file_task"
3
- require "rake/early_time"
2
+ require_relative "file_task"
3
+ require_relative "early_time"
4
4
 
5
5
  module Rake
6
6
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require "rake/cloneable"
3
- require "rake/file_utils_ext"
4
- require "rake/ext/string"
2
+ require_relative "cloneable"
3
+ require_relative "file_utils_ext"
4
+ require_relative "ext/string"
5
5
 
6
6
  module Rake
7
7
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require "rake/task"
3
- require "rake/early_time"
2
+ require_relative "task"
3
+ require_relative "early_time"
4
4
 
5
5
  module Rake
6
6
 
@@ -14,14 +14,18 @@ module Rake
14
14
  # Is this file task needed? Yes if it doesn't exist, or if its time stamp
15
15
  # is out of date.
16
16
  def needed?
17
- !File.exist?(name) || out_of_date?(timestamp) || @application.options.build_all
17
+ begin
18
+ out_of_date?(File.mtime(name)) || @application.options.build_all
19
+ rescue Errno::ENOENT
20
+ true
21
+ end
18
22
  end
19
23
 
20
24
  # Time stamp for file task.
21
25
  def timestamp
22
- if File.exist?(name)
23
- File.mtime(name.to_s)
24
- else
26
+ begin
27
+ File.mtime(name)
28
+ rescue Errno::ENOENT
25
29
  Rake::LATE
26
30
  end
27
31
  end
@@ -48,7 +48,7 @@ module FileUtils
48
48
  verbose = options.delete :verbose
49
49
  noop = options.delete(:noop) || Rake::FileUtilsExt.nowrite_flag
50
50
 
51
- Rake.rake_output_message sh_show_command cmd if verbose
51
+ Rake.rake_output_message sh_show_command(cmd, options) if verbose
52
52
 
53
53
  unless noop
54
54
  res = (Hash === cmd.last) ? system(*cmd) : system(*cmd, options)
@@ -60,8 +60,6 @@ module FileUtils
60
60
 
61
61
  def create_shell_runner(cmd) # :nodoc:
62
62
  show_command = sh_show_command cmd
63
- show_command = show_command[0, 42] + "..." unless $trace
64
-
65
63
  lambda do |ok, status|
66
64
  ok or
67
65
  fail "Command failed with status (#{status.exitstatus}): " +
@@ -70,7 +68,7 @@ module FileUtils
70
68
  end
71
69
  private :create_shell_runner
72
70
 
73
- def sh_show_command(cmd) # :nodoc:
71
+ def sh_show_command(cmd, options = nil) # :nodoc:
74
72
  cmd = cmd.dup
75
73
 
76
74
  if Hash === cmd.first
@@ -79,7 +77,12 @@ module FileUtils
79
77
  cmd[0] = env
80
78
  end
81
79
 
82
- cmd.join " "
80
+ cmd = cmd.join " "
81
+ if options and chdir = options[:chdir]
82
+ "(cd #{chdir} && #{cmd})"
83
+ else
84
+ cmd
85
+ end
83
86
  end
84
87
  private :sh_show_command
85
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "rake/file_utils"
2
+ require_relative "file_utils"
3
3
 
4
4
  module Rake
5
5
  #
@@ -53,6 +53,7 @@ module Rake
53
53
  def verbose(value=nil)
54
54
  oldvalue = FileUtilsExt.verbose_flag
55
55
  FileUtilsExt.verbose_flag = value unless value.nil?
56
+
56
57
  if block_given?
57
58
  begin
58
59
  yield
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rake
4
+
5
+ ##
6
+ # Options used by the Rake command line application.
7
+ #
8
+ class Options
9
+ attr_accessor :always_multitask
10
+ attr_accessor :backtrace
11
+ attr_accessor :build_all
12
+ attr_accessor :dryrun
13
+ attr_accessor :ignore_deprecate
14
+ attr_accessor :ignore_system
15
+ attr_accessor :job_stats
16
+ attr_accessor :load_system
17
+ attr_accessor :nosearch
18
+ attr_accessor :rakelib
19
+ attr_accessor :show_all_tasks
20
+ attr_accessor :show_prereqs
21
+ attr_accessor :show_task_pattern
22
+ attr_accessor :show_tasks
23
+ attr_accessor :silent
24
+ attr_accessor :suppress_backtrace_pattern
25
+ attr_accessor :thread_pool_size
26
+ attr_accessor :trace
27
+ attr_accessor :trace_output
28
+ attr_accessor :trace_rules
29
+ end
30
+
31
+ end
@@ -2,8 +2,8 @@
2
2
  # Define a package task library to aid in the definition of
3
3
  # redistributable package files.
4
4
 
5
- require "rake"
6
- require "rake/tasklib"
5
+ require_relative "../rake"
6
+ require_relative "tasklib"
7
7
 
8
8
  module Rake
9
9
 
@@ -79,7 +79,7 @@ module Rake
79
79
  # Zip command for zipped archives. The default is 'zip'.
80
80
  attr_accessor :zip_command
81
81
 
82
- # True if parent directory should be omited (default is false)
82
+ # True if parent directory should be omitted (default is false)
83
83
  attr_accessor :without_parent_dir
84
84
 
85
85
  # Create a Package Task with the given name and version. Use +:noversion+
data/lib/rake/phony.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
  # See FileTask#out_of_date? and Task#timestamp for more info.
7
7
 
8
- require "rake"
8
+ require_relative "../rake"
9
9
 
10
10
  task :phony
11
11
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rake/file_list"
3
+ require_relative "file_list"
4
4
 
5
5
  # Load the test files from the command line.
6
6
  argv = ARGV.select do |argument|
data/lib/rake/task.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "rake/invocation_exception_mixin"
2
+ require_relative "invocation_exception_mixin"
3
3
 
4
4
  module Rake
5
5
 
@@ -276,9 +276,9 @@ module Rake
276
276
  application.trace "** Execute #{name}" if application.options.trace
277
277
  application.enhance_with_matching_rule(name) if @actions.empty?
278
278
  if opts = Hash.try_convert(args) and !opts.empty?
279
- @actions.each { |act| act.call(self, args, **opts)}
279
+ @actions.each { |act| act.call(self, args, **opts) }
280
280
  else
281
- @actions.each { |act| act.call(self, args)}
281
+ @actions.each { |act| act.call(self, args) }
282
282
  end
283
283
  end
284
284
 
@@ -94,6 +94,10 @@ module Rake
94
94
  @hash.fetch(*args, &block)
95
95
  end
96
96
 
97
+ def deconstruct_keys(keys)
98
+ keys ? @hash.slice(*keys) : to_hash
99
+ end
100
+
97
101
  protected
98
102
 
99
103
  def lookup(name) # :nodoc:
@@ -35,7 +35,7 @@ module Rake
35
35
  task.set_arg_names(arg_names) unless arg_names.empty?
36
36
  if Rake::TaskManager.record_task_metadata
37
37
  add_location(task)
38
- task.add_description(get_description(task))
38
+ task.add_description(get_description)
39
39
  end
40
40
  task.enhance(Task.format_deps(deps), &block)
41
41
  task | order_only unless order_only.nil?
@@ -302,6 +302,8 @@ module Rake
302
302
  source == ext ? task_name.ext(ext) : source
303
303
  when String, Symbol
304
304
  ext.to_s
305
+ when Pathname
306
+ Rake.from_pathname(ext)
305
307
  when Proc, Method
306
308
  if ext.arity == 1
307
309
  ext.call(task_name)
@@ -316,7 +318,7 @@ module Rake
316
318
  end
317
319
 
318
320
  # Return the current description, clearing it in the process.
319
- def get_description(task)
321
+ def get_description
320
322
  desc = @last_description
321
323
  @last_description = nil
322
324
  desc
data/lib/rake/tasklib.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "rake"
2
+ require_relative "../rake"
3
3
 
4
4
  module Rake
5
5
 
data/lib/rake/testtask.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require "rake"
3
- require "rake/tasklib"
2
+ require_relative "../rake"
3
+ require_relative "tasklib"
4
4
 
5
5
  module Rake
6
6
 
@@ -108,12 +108,11 @@ module Rake
108
108
  def define
109
109
  desc @description
110
110
  task @name => Array(deps) do
111
- FileUtilsExt.verbose(@verbose) do
112
- puts "Use TESTOPTS=\"--verbose\" to pass --verbose" \
113
- ", etc. to runners." if ARGV.include? "--verbose"
111
+ effective_verbose = @verbose || FileUtilsExt.verbose_flag == true
112
+ FileUtilsExt.verbose(effective_verbose) do
114
113
  args =
115
114
  "#{ruby_opts_string} #{run_code} " +
116
- "#{file_list_string} #{option_list}"
115
+ "#{file_list_string} #{option_list(verbose: effective_verbose)}"
117
116
  ruby args do |ok, status|
118
117
  if !ok && status.respond_to?(:signaled?) && status.signaled?
119
118
  raise SignalException.new(status.termsig)
@@ -135,13 +134,17 @@ module Rake
135
134
  self
136
135
  end
137
136
 
138
- def option_list # :nodoc:
139
- (ENV["TESTOPTS"] ||
137
+ def option_list(verbose: @verbose) # :nodoc:
138
+ opts = ENV["TESTOPTS"] ||
140
139
  ENV["TESTOPT"] ||
141
140
  ENV["TEST_OPTS"] ||
142
141
  ENV["TEST_OPT"] ||
143
142
  @options ||
144
- "")
143
+ ""
144
+ if verbose && !opts.split.include?("-v")
145
+ opts = opts.empty? ? "-v" : "#{opts} -v"
146
+ end
147
+ opts
145
148
  end
146
149
 
147
150
  def ruby_opts_string # :nodoc:
@@ -161,7 +164,7 @@ module Rake
161
164
 
162
165
  def file_list # :nodoc:
163
166
  if ENV["TEST"]
164
- FileList[ENV["TEST"]]
167
+ FileList[ENV["TEST"].split(",")]
165
168
  else
166
169
  result = []
167
170
  result += @test_files.to_a if @test_files
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "rake/private_reader"
2
+ require_relative "private_reader"
3
3
 
4
4
  module Rake
5
5
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rake/promise"
3
+ require_relative "promise"
4
+ require "set"
4
5
 
5
6
  module Rake
6
7
 
@@ -9,7 +10,6 @@ module Rake
9
10
  # Creates a ThreadPool object. The +thread_count+ parameter is the size
10
11
  # of the pool.
11
12
  def initialize(thread_count)
12
- require "set"
13
13
  @max_active_threads = [thread_count, 0].max
14
14
  @threads = Set.new
15
15
  @threads_mon = Monitor.new
@@ -108,19 +108,13 @@ module Rake
108
108
  false
109
109
  end
110
110
 
111
- def safe_thread_count
112
- @threads_mon.synchronize do
113
- @threads.count
114
- end
115
- end
116
-
117
111
  def start_thread # :nodoc:
118
112
  @threads_mon.synchronize do
119
113
  next unless @threads.count < @max_active_threads
120
114
 
121
115
  t = Thread.new do
122
116
  begin
123
- while safe_thread_count <= @max_active_threads
117
+ loop do
124
118
  break unless process_queue_item
125
119
  end
126
120
  ensure
data/lib/rake/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Rake
3
- VERSION = "13.0.6"
3
+ VERSION = "13.4.2"
4
4
 
5
5
  module Version # :nodoc: all
6
6
  MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "."
data/lib/rake/win32.rb CHANGED
@@ -6,46 +6,12 @@ module Rake
6
6
  # will be placed here to collect that knowledge in one spot.
7
7
  module Win32 # :nodoc: all
8
8
 
9
- # Error indicating a problem in locating the home directory on a
10
- # Win32 system.
11
- class Win32HomeError < RuntimeError
12
- end
13
-
14
9
  class << self
15
10
  # True if running on a windows system.
16
11
  def windows?
17
12
  RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw|[Ww]indows)!
18
13
  end
19
-
20
- # The standard directory containing system wide rake files on
21
- # Win 32 systems. Try the following environment variables (in
22
- # order):
23
- #
24
- # * HOME
25
- # * HOMEDRIVE + HOMEPATH
26
- # * APPDATA
27
- # * USERPROFILE
28
- #
29
- # If the above are not defined, the return nil.
30
- def win32_system_dir #:nodoc:
31
- win32_shared_path = ENV["HOME"]
32
- if win32_shared_path.nil? && ENV["HOMEDRIVE"] && ENV["HOMEPATH"]
33
- win32_shared_path = ENV["HOMEDRIVE"] + ENV["HOMEPATH"]
34
- end
35
-
36
- win32_shared_path ||= ENV["APPDATA"]
37
- win32_shared_path ||= ENV["USERPROFILE"]
38
- raise Win32HomeError,
39
- "Unable to determine home path environment variable." if
40
- win32_shared_path.nil? or win32_shared_path.empty?
41
- normalize(File.join(win32_shared_path, "Rake"))
42
- end
43
-
44
- # Normalize a win32 path so that the slashes are all forward slashes.
45
- def normalize(path)
46
- path.gsub(/\\/, "/")
47
- end
48
-
49
14
  end
15
+
50
16
  end
51
17
  end
data/lib/rake.rb CHANGED
@@ -23,45 +23,43 @@
23
23
 
24
24
  module Rake; end
25
25
 
26
- require "rake/version"
26
+ require_relative "rake/version"
27
27
 
28
28
  require "rbconfig"
29
29
  require "fileutils"
30
30
  require "singleton"
31
31
  require "monitor"
32
32
  require "optparse"
33
- require "ostruct"
34
33
 
35
- require "rake/ext/string"
34
+ require_relative "rake/ext/string"
36
35
 
37
- require "rake/win32"
36
+ require_relative "rake/win32"
38
37
 
39
- require "rake/linked_list"
40
- require "rake/cpu_counter"
41
- require "rake/scope"
42
- require "rake/task_argument_error"
43
- require "rake/rule_recursion_overflow_error"
44
- require "rake/rake_module"
45
- require "rake/trace_output"
46
- require "rake/pseudo_status"
47
- require "rake/task_arguments"
48
- require "rake/invocation_chain"
49
- require "rake/task"
50
- require "rake/file_task"
51
- require "rake/file_creation_task"
52
- require "rake/multi_task"
53
- require "rake/dsl_definition"
54
- require "rake/file_utils_ext"
55
- require "rake/file_list"
56
- require "rake/default_loader"
57
- require "rake/early_time"
58
- require "rake/late_time"
59
- require "rake/name_space"
60
- require "rake/task_manager"
61
- require "rake/application"
62
- require "rake/backtrace"
63
-
64
- $trace = false
38
+ require_relative "rake/linked_list"
39
+ require_relative "rake/cpu_counter"
40
+ require_relative "rake/scope"
41
+ require_relative "rake/task_argument_error"
42
+ require_relative "rake/rule_recursion_overflow_error"
43
+ require_relative "rake/rake_module"
44
+ require_relative "rake/trace_output"
45
+ require_relative "rake/pseudo_status"
46
+ require_relative "rake/options"
47
+ require_relative "rake/task_arguments"
48
+ require_relative "rake/invocation_chain"
49
+ require_relative "rake/task"
50
+ require_relative "rake/file_task"
51
+ require_relative "rake/file_creation_task"
52
+ require_relative "rake/multi_task"
53
+ require_relative "rake/dsl_definition"
54
+ require_relative "rake/file_utils_ext"
55
+ require_relative "rake/file_list"
56
+ require_relative "rake/default_loader"
57
+ require_relative "rake/early_time"
58
+ require_relative "rake/late_time"
59
+ require_relative "rake/name_space"
60
+ require_relative "rake/task_manager"
61
+ require_relative "rake/application"
62
+ require_relative "rake/backtrace"
65
63
 
66
64
  # :stopdoc:
67
65
  #
data/rake.gemspec CHANGED
@@ -1,32 +1,33 @@
1
1
  # frozen_string_literal: true
2
- require_relative 'lib/rake/version'
2
+
3
+ require_relative "lib/rake/version"
3
4
 
4
5
  Gem::Specification.new do |s|
5
- s.name = "rake".freeze
6
+ s.name = "rake"
6
7
  s.version = Rake::VERSION
7
- s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze]
8
- s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze]
8
+ s.authors = ["Hiroshi SHIBATA", "Eric Hodel", "Jim Weirich"]
9
+ s.email = ["hsbt@ruby-lang.org", "drbrain@segment7.net", ""]
9
10
 
10
- s.summary = "Rake is a Make-like program implemented in Ruby".freeze
11
- s.description = <<-DESCRIPTION
12
- Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
13
- specified in standard Ruby syntax.
14
- Rake has the following features:
15
- * Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby syntax.
16
- No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?)
17
- * Users can specify tasks with prerequisites.
18
- * Rake supports rule patterns to synthesize implicit tasks.
19
- * Flexible FileLists that act like arrays but know about manipulating file names and paths.
20
- * Supports parallel execution of tasks.
11
+ s.summary = "Rake is a Make-like program implemented in Ruby"
12
+ s.description = <<~DESCRIPTION
13
+ Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
14
+ specified in standard Ruby syntax.
15
+ Rake has the following features:
16
+ * Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby syntax.
17
+ No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?)
18
+ * Users can specify tasks with prerequisites.
19
+ * Rake supports rule patterns to synthesize implicit tasks.
20
+ * Flexible FileLists that act like arrays but know about manipulating file names and paths.
21
+ * Supports parallel execution of tasks.
21
22
  DESCRIPTION
22
- s.homepage = "https://github.com/ruby/rake".freeze
23
- s.licenses = ["MIT".freeze]
23
+ s.homepage = "https://github.com/ruby/rake"
24
+ s.licenses = ["MIT"]
24
25
 
25
26
  s.metadata = {
26
- "bug_tracker_uri" => "https://github.com/ruby/rake/issues",
27
- "changelog_uri" => "https://github.com/ruby/rake/blob/v#{s.version}/History.rdoc",
27
+ "bug_tracker_uri" => "https://github.com/ruby/rake/issues",
28
+ "changelog_uri" => "https://github.com/ruby/rake/releases",
28
29
  "documentation_uri" => "https://ruby.github.io/rake",
29
- "source_code_uri" => "https://github.com/ruby/rake/tree/v#{s.version}",
30
+ "source_code_uri" => s.homepage
30
31
  }
31
32
 
32
33
  s.files = [
@@ -69,6 +70,7 @@ Rake has the following features:
69
70
  "lib/rake/loaders/makefile.rb",
70
71
  "lib/rake/multi_task.rb",
71
72
  "lib/rake/name_space.rb",
73
+ "lib/rake/options.rb",
72
74
  "lib/rake/packagetask.rb",
73
75
  "lib/rake/phony.rb",
74
76
  "lib/rake/private_reader.rb",
@@ -93,8 +95,8 @@ Rake has the following features:
93
95
  ]
94
96
  s.bindir = "exe"
95
97
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
96
- s.require_paths = ["lib".freeze]
98
+ s.require_paths = ["lib"]
97
99
 
98
- s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
99
- s.rdoc_options = ["--main".freeze, "README.rdoc".freeze]
100
+ s.required_ruby_version = Gem::Requirement.new(">= 2.3")
101
+ s.rdoc_options = ["--main", "README.rdoc"]
100
102
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.0.6
4
+ version: 13.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA
8
8
  - Eric Hodel
9
9
  - Jim Weirich
10
- autorequire:
11
10
  bindir: exe
12
11
  cert_chain: []
13
- date: 2021-07-09 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: |
16
15
  Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
@@ -70,6 +69,7 @@ files:
70
69
  - lib/rake/loaders/makefile.rb
71
70
  - lib/rake/multi_task.rb
72
71
  - lib/rake/name_space.rb
72
+ - lib/rake/options.rb
73
73
  - lib/rake/packagetask.rb
74
74
  - lib/rake/phony.rb
75
75
  - lib/rake/private_reader.rb
@@ -96,10 +96,9 @@ licenses:
96
96
  - MIT
97
97
  metadata:
98
98
  bug_tracker_uri: https://github.com/ruby/rake/issues
99
- changelog_uri: https://github.com/ruby/rake/blob/v13.0.6/History.rdoc
99
+ changelog_uri: https://github.com/ruby/rake/releases
100
100
  documentation_uri: https://ruby.github.io/rake
101
- source_code_uri: https://github.com/ruby/rake/tree/v13.0.6
102
- post_install_message:
101
+ source_code_uri: https://github.com/ruby/rake
103
102
  rdoc_options:
104
103
  - "--main"
105
104
  - README.rdoc
@@ -109,15 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
108
  requirements:
110
109
  - - ">="
111
110
  - !ruby/object:Gem::Version
112
- version: '2.2'
111
+ version: '2.3'
113
112
  required_rubygems_version: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - ">="
116
115
  - !ruby/object:Gem::Version
117
116
  version: '0'
118
117
  requirements: []
119
- rubygems_version: 3.3.0.dev
120
- signing_key:
118
+ rubygems_version: 4.0.6
121
119
  specification_version: 4
122
120
  summary: Rake is a Make-like program implemented in Ruby
123
121
  test_files: []