rake 13.3.0 → 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: 2f0dfe4cdb0a88ad0df787318f603bf719066a217bb302ce0a00f5b8088e97b3
4
- data.tar.gz: 531066b57ebab5784756b6ebf3e8fc29e2fcd41d5685d1b1b0821d1edf274f42
3
+ metadata.gz: 85f5ba92bb3bcf4a2a2c791c2c26009e75143bf70ac26dbc0b7f619fef4cafc1
4
+ data.tar.gz: c411a8b49c26d25f0560f7aa05889cc2f365d5caf6594e834eeeaa88354ae02c
5
5
  SHA512:
6
- metadata.gz: 180ec362668e3a6c36dc0158c01169c20b8ca5bbd9ea6723e1bdfd645371e77247fbecbe05ed11ab24139657d11421c8935c44e53465dacb41d13e6ea6617f4b
7
- data.tar.gz: 5736568428c9bfac4be006ff2628a0d673c8ca5a18cc431a16e5ace07f527aaf1e2587b274b7fa86700d284e4a4862cfd761dc75bf96d139222c6ca88efc5e0b
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.
@@ -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,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
@@ -95,7 +95,7 @@ module Rake
95
95
  end
96
96
 
97
97
  def deconstruct_keys(keys)
98
- @hash.slice(*keys)
98
+ keys ? @hash.slice(*keys) : to_hash
99
99
  end
100
100
 
101
101
  protected
@@ -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
@@ -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.3.0"
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"
data/rake.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  "bug_tracker_uri" => "https://github.com/ruby/rake/issues",
28
28
  "changelog_uri" => "https://github.com/ruby/rake/releases",
29
29
  "documentation_uri" => "https://ruby.github.io/rake",
30
- "source_code_uri" => "#{s.homepage}/releases/v#{s.version}"
30
+ "source_code_uri" => s.homepage
31
31
  }
32
32
 
33
33
  s.files = [
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.0
4
+ version: 13.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA
@@ -97,7 +97,7 @@ metadata:
97
97
  bug_tracker_uri: https://github.com/ruby/rake/issues
98
98
  changelog_uri: https://github.com/ruby/rake/releases
99
99
  documentation_uri: https://ruby.github.io/rake
100
- source_code_uri: https://github.com/ruby/rake/releases/v13.3.0
100
+ source_code_uri: https://github.com/ruby/rake
101
101
  rdoc_options:
102
102
  - "--main"
103
103
  - README.rdoc
@@ -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.7
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: []