rake 13.3.1 → 13.4.0

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: f8030dccf89834bd1723f61768994c7030a66fefaca1876f02a125fd04d81330
4
- data.tar.gz: 44bde676fa9c925cbebb0aa8b3267206af091ea23f3ee5e1cb292d5605c0d68b
3
+ metadata.gz: 85f5ba92bb3bcf4a2a2c791c2c26009e75143bf70ac26dbc0b7f619fef4cafc1
4
+ data.tar.gz: c411a8b49c26d25f0560f7aa05889cc2f365d5caf6594e834eeeaa88354ae02c
5
5
  SHA512:
6
- metadata.gz: e165577cdf53a95c575be0e796550a40dfd0dfd4a0447e25bdb2722a0bd74f9565dd226a94fecedf3bf44ffa2c571477f4c9d4521d9c4a3f99afaa557f76898c
7
- data.tar.gz: 2ae064597810412e682db5083f596c5fae7bc182b13b676abda7fbc273ff6ee460c812aae731933d794007b5e79a60fa249c1e898f2b38fcaba9e9d76603034d
6
+ metadata.gz: fc7a67e8481634df0077751f949abdeaab8af1a88dbb0880a4d2f3343e827ea6b1d72761b2005e2de723faa08d9948dc99deb87b8f9074f6f4cb959c637ed229
7
+ data.tar.gz: 7c1df4f498ef475b112491b3b6c15d032fdcf557313b85e2884901e2eb65ba35e48f8ebd6ddc61a11954a6fa68be8bbd6041f82ff11402967561d768587231e7
@@ -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.
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,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require "optparse"
3
3
 
4
+ require_relative "options"
4
5
  require_relative "task_manager"
5
6
  require_relative "file_list"
6
7
  require_relative "thread_pool"
@@ -145,7 +146,7 @@ module Rake
145
146
  thread_pool.gather_history if options.job_stats == :history
146
147
 
147
148
  yield
148
-
149
+ ensure
149
150
  thread_pool.join if defined?(@thread_pool)
150
151
  if options.job_stats
151
152
  stats = thread_pool.statistics
@@ -165,13 +166,7 @@ module Rake
165
166
 
166
167
  # Application options from the command line
167
168
  def options
168
- @options ||= Struct.new(
169
- :always_multitask, :backtrace, :build_all, :dryrun,
170
- :ignore_deprecate, :ignore_system, :job_stats, :load_system,
171
- :nosearch, :rakelib, :show_all_tasks, :show_prereqs,
172
- :show_task_pattern, :show_tasks, :silent, :suppress_backtrace_pattern,
173
- :thread_pool_size, :trace, :trace_output, :trace_rules
174
- ).new
169
+ @options ||= Options.new
175
170
  end
176
171
 
177
172
  # Return the thread pool used for multithreaded processing.
@@ -759,12 +754,10 @@ module Rake
759
754
  end
760
755
 
761
756
  # The standard directory containing system wide rake files.
762
- if Win32.windows?
763
- def standard_system_dir #:nodoc:
764
- Win32.win32_system_dir
765
- end
766
- else
767
- def standard_system_dir #:nodoc:
757
+ def standard_system_dir #:nodoc:
758
+ if windows?
759
+ File.join(Dir.home, "Rake")
760
+ else
768
761
  File.join(Dir.home, ".rake")
769
762
  end
770
763
  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)
@@ -68,7 +68,7 @@ module FileUtils
68
68
  end
69
69
  private :create_shell_runner
70
70
 
71
- def sh_show_command(cmd) # :nodoc:
71
+ def sh_show_command(cmd, options = nil) # :nodoc:
72
72
  cmd = cmd.dup
73
73
 
74
74
  if Hash === cmd.first
@@ -77,7 +77,12 @@ module FileUtils
77
77
  cmd[0] = env
78
78
  end
79
79
 
80
- cmd.join " "
80
+ cmd = cmd.join " "
81
+ if options and chdir = options[:chdir]
82
+ "(cd #{chdir} && #{cmd})"
83
+ else
84
+ cmd
85
+ end
81
86
  end
82
87
  private :sh_show_command
83
88
 
@@ -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
+ ENV["TESTOPTS"] = "-v" if value
56
57
  if block_given?
57
58
  begin
58
59
  yield
@@ -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)
data/lib/rake/testtask.rb CHANGED
@@ -109,8 +109,6 @@ module Rake
109
109
  desc @description
110
110
  task @name => Array(deps) do
111
111
  FileUtilsExt.verbose(@verbose) do
112
- puts "Use TESTOPTS=\"--verbose\" to pass --verbose" \
113
- ", etc. to runners." if ARGV.include? "--verbose"
114
112
  args =
115
113
  "#{ruby_opts_string} #{run_code} " +
116
114
  "#{file_list_string} #{option_list}"
@@ -161,7 +159,7 @@ module Rake
161
159
 
162
160
  def file_list # :nodoc:
163
161
  if ENV["TEST"]
164
- FileList[ENV["TEST"]]
162
+ FileList[ENV["TEST"].split(",")]
165
163
  else
166
164
  result = []
167
165
  result += @test_files.to_a if @test_files
data/lib/rake/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Rake
3
- VERSION = "13.3.1"
3
+ VERSION = "13.4.0"
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
@@ -43,6 +43,7 @@ require_relative "rake/rule_recursion_overflow_error"
43
43
  require_relative "rake/rake_module"
44
44
  require_relative "rake/trace_output"
45
45
  require_relative "rake/pseudo_status"
46
+ require_relative "rake/options"
46
47
  require_relative "rake/task_arguments"
47
48
  require_relative "rake/invocation_chain"
48
49
  require_relative "rake/task"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.3.1
4
+ version: 13.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.6.9
117
+ rubygems_version: 4.0.6
118
118
  specification_version: 4
119
119
  summary: Rake is a Make-like program implemented in Ruby
120
120
  test_files: []