rake 12.3.0 → 13.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,13 +15,13 @@ module Rake
15
15
  end
16
16
 
17
17
  def create_rule(*args, &block) # :nodoc:
18
- pattern, args, deps = resolve_args(args)
18
+ pattern, args, deps, order_only = resolve_args(args)
19
19
  pattern = Regexp.new(Regexp.quote(pattern) + "$") if String === pattern
20
- @rules << [pattern, args, deps, block]
20
+ @rules << [pattern, args, deps, order_only, block]
21
21
  end
22
22
 
23
23
  def define_task(task_class, *args, &block) # :nodoc:
24
- task_name, arg_names, deps = resolve_args(args)
24
+ task_name, arg_names, deps, order_only = resolve_args(args)
25
25
 
26
26
  original_scope = @scope
27
27
  if String === task_name and
@@ -31,15 +31,15 @@ module Rake
31
31
  end
32
32
 
33
33
  task_name = task_class.scope_name(@scope, task_name)
34
- deps = [deps] unless deps.respond_to?(:to_ary)
35
- deps = deps.map { |d| Rake.from_pathname(d).to_s }
36
34
  task = intern(task_class, task_name)
37
35
  task.set_arg_names(arg_names) unless arg_names.empty?
38
36
  if Rake::TaskManager.record_task_metadata
39
37
  add_location(task)
40
38
  task.add_description(get_description(task))
41
39
  end
42
- task.enhance(deps, &block)
40
+ task.enhance(Task.format_deps(deps), &block)
41
+ task | order_only unless order_only.nil?
42
+ task
43
43
  ensure
44
44
  @scope = original_scope
45
45
  end
@@ -60,17 +60,22 @@ module Rake
60
60
  end
61
61
 
62
62
  def generate_message_for_undefined_task(task_name)
63
- message = "Don't know how to build task '#{task_name}' (see --tasks)"
63
+ message = "Don't know how to build task '#{task_name}' "\
64
+ "(See the list of available tasks with `#{Rake.application.name} --tasks`)"
65
+ message + generate_did_you_mean_suggestions(task_name)
66
+ end
64
67
 
65
- suggestion_message = \
66
- if defined?(::DidYouMean::SpellChecker) && defined?(::DidYouMean::Formatter)
67
- suggestions = ::DidYouMean::SpellChecker.new(dictionary: @tasks.keys).correct(task_name.to_s)
68
- ::DidYouMean::Formatter.new(suggestions).to_s
69
- else
70
- ""
71
- end
68
+ def generate_did_you_mean_suggestions(task_name)
69
+ return "" unless defined?(::DidYouMean::SpellChecker)
72
70
 
73
- message + suggestion_message
71
+ suggestions = ::DidYouMean::SpellChecker.new(dictionary: @tasks.keys).correct(task_name.to_s)
72
+ if ::DidYouMean.respond_to?(:formatter)# did_you_mean v1.2.0 or later
73
+ ::DidYouMean.formatter.message_for(suggestions)
74
+ elsif defined?(::DidYouMean::Formatter) # before did_you_mean v1.2.0
75
+ ::DidYouMean::Formatter.new(suggestions).to_s
76
+ else
77
+ ""
78
+ end
74
79
  end
75
80
 
76
81
  def synthesize_file_task(task_name) # :nodoc:
@@ -78,8 +83,8 @@ module Rake
78
83
  define_task(Rake::FileTask, task_name)
79
84
  end
80
85
 
81
- # Resolve the arguments for a task/rule. Returns a triplet of
82
- # [task_name, arg_name_list, prerequisites].
86
+ # Resolve the arguments for a task/rule. Returns a tuple of
87
+ # [task_name, arg_name_list, prerequisites, order_only_prerequisites].
83
88
  def resolve_args(args)
84
89
  if args.last.is_a?(Hash)
85
90
  deps = args.pop
@@ -104,7 +109,7 @@ module Rake
104
109
  else
105
110
  arg_names = args
106
111
  end
107
- [task_name, arg_names, []]
112
+ [task_name, arg_names, [], nil]
108
113
  end
109
114
  private :resolve_args_without_dependencies
110
115
 
@@ -113,11 +118,17 @@ module Rake
113
118
  #
114
119
  # The patterns recognized by this argument resolving function are:
115
120
  #
121
+ # task :t, order_only: [:e]
116
122
  # task :t => [:d]
123
+ # task :t => [:d], order_only: [:e]
117
124
  # task :t, [a] => [:d]
125
+ # task :t, [a] => [:d], order_only: [:e]
118
126
  #
119
127
  def resolve_args_with_dependencies(args, hash) # :nodoc:
120
- fail "Task Argument Error" if hash.size != 1
128
+ fail "Task Argument Error" if
129
+ hash.size != 1 &&
130
+ (hash.size != 2 || !hash.key?(:order_only))
131
+ order_only = hash.delete(:order_only)
121
132
  key, value = hash.map { |k, v| [k, v] }.first
122
133
  if args.empty?
123
134
  task_name = key
@@ -125,11 +136,11 @@ module Rake
125
136
  deps = value || []
126
137
  else
127
138
  task_name = args.shift
128
- arg_names = key
129
- deps = value
139
+ arg_names = key || args.shift|| []
140
+ deps = value || []
130
141
  end
131
142
  deps = [deps] unless deps.respond_to?(:to_ary)
132
- [task_name, arg_names, deps]
143
+ [task_name, arg_names, deps, order_only]
133
144
  end
134
145
  private :resolve_args_with_dependencies
135
146
 
@@ -140,9 +151,10 @@ module Rake
140
151
  def enhance_with_matching_rule(task_name, level=0)
141
152
  fail Rake::RuleRecursionOverflowError,
142
153
  "Rule Recursion Too Deep" if level >= 16
143
- @rules.each do |pattern, args, extensions, block|
154
+ @rules.each do |pattern, args, extensions, order_only, block|
144
155
  if pattern && pattern.match(task_name)
145
156
  task = attempt_rule(task_name, pattern, args, extensions, block, level)
157
+ task | order_only unless order_only.nil?
146
158
  return task if task
147
159
  end
148
160
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Rake
3
- VERSION = "12.3.0"
3
+ VERSION = "13.0.1"
4
4
 
5
5
  module Version # :nodoc: all
6
6
  MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "."
@@ -5,7 +5,6 @@ require 'rake/version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "rake".freeze
7
7
  s.version = Rake::VERSION
8
- s.date = "2017-10-25"
9
8
  s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze]
10
9
  s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze]
11
10
 
@@ -24,20 +23,21 @@ Rake has the following features:
24
23
  s.homepage = "https://github.com/ruby/rake".freeze
25
24
  s.licenses = ["MIT".freeze]
26
25
 
27
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } -
28
- %w[.rubocop.yml .travis.yml appveyor.yml]
26
+ s.metadata = {
27
+ "bug_tracker_uri" => "https://github.com/ruby/rake/issues",
28
+ "changelog_uri" => "https://github.com/ruby/rake/blob/v#{s.version}/History.rdoc",
29
+ "documentation_uri" => "https://ruby.github.io/rake",
30
+ "source_code_uri" => "https://github.com/ruby/rake/tree/v#{s.version}",
31
+ }
32
+
33
+ s.files = %x[git ls-files -z].split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } -
34
+ %w[.rubocop.yml .gitignore .travis.yml appveyor.yml]
29
35
  s.bindir = "exe"
30
36
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
37
  s.require_paths = ["lib".freeze]
32
38
 
33
- s.required_ruby_version = Gem::Requirement.new(">= 2.0.0".freeze)
39
+ s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
34
40
  s.rubygems_version = "2.6.1".freeze
35
41
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.2".freeze)
36
42
  s.rdoc_options = ["--main".freeze, "README.rdoc".freeze]
37
-
38
- s.add_development_dependency(%q<bundler>.freeze)
39
- s.add_development_dependency(%q<minitest>.freeze)
40
- s.add_development_dependency(%q<rdoc>.freeze)
41
- s.add_development_dependency(%q<coveralls>.freeze)
42
- s.add_development_dependency(%q<rubocop>.freeze)
43
43
  end
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: 12.3.0
4
+ version: 13.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA
@@ -10,78 +10,8 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2017-10-25 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: bundler
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :development
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- version: '0'
29
- - !ruby/object:Gem::Dependency
30
- name: minitest
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: '0'
36
- type: :development
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
43
- - !ruby/object:Gem::Dependency
44
- name: rdoc
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '0'
50
- type: :development
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: '0'
57
- - !ruby/object:Gem::Dependency
58
- name: coveralls
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- type: :development
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- - !ruby/object:Gem::Dependency
72
- name: rubocop
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- type: :development
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: '0'
13
+ date: 2019-11-12 00:00:00.000000000 Z
14
+ dependencies: []
85
15
  description: |
86
16
  Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
87
17
  specified in standard Ruby syntax.
@@ -101,14 +31,21 @@ executables:
101
31
  extensions: []
102
32
  extra_rdoc_files: []
103
33
  files:
104
- - ".gitignore"
34
+ - ".github/workflows/macos.yml"
35
+ - ".github/workflows/ubuntu-rvm.yml"
36
+ - ".github/workflows/ubuntu.yml"
37
+ - ".github/workflows/windows.yml"
105
38
  - CONTRIBUTING.rdoc
106
39
  - Gemfile
107
40
  - History.rdoc
108
41
  - MIT-LICENSE
109
42
  - README.rdoc
110
43
  - Rakefile
44
+ - bin/bundle
111
45
  - bin/console
46
+ - bin/rake
47
+ - bin/rdoc
48
+ - bin/rubocop
112
49
  - bin/setup
113
50
  - doc/command_line_usage.rdoc
114
51
  - doc/example/Rakefile1
@@ -170,7 +107,11 @@ files:
170
107
  homepage: https://github.com/ruby/rake
171
108
  licenses:
172
109
  - MIT
173
- metadata: {}
110
+ metadata:
111
+ bug_tracker_uri: https://github.com/ruby/rake/issues
112
+ changelog_uri: https://github.com/ruby/rake/blob/v13.0.1/History.rdoc
113
+ documentation_uri: https://ruby.github.io/rake
114
+ source_code_uri: https://github.com/ruby/rake/tree/v13.0.1
174
115
  post_install_message:
175
116
  rdoc_options:
176
117
  - "--main"
@@ -181,15 +122,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
122
  requirements:
182
123
  - - ">="
183
124
  - !ruby/object:Gem::Version
184
- version: 2.0.0
125
+ version: '2.2'
185
126
  required_rubygems_version: !ruby/object:Gem::Requirement
186
127
  requirements:
187
128
  - - ">="
188
129
  - !ruby/object:Gem::Version
189
130
  version: 1.3.2
190
131
  requirements: []
191
- rubyforge_project:
192
- rubygems_version: 2.7.2
132
+ rubygems_version: 3.0.3
193
133
  signing_key:
194
134
  specification_version: 4
195
135
  summary: Rake is a Make-like program implemented in Ruby
data/.gitignore DELETED
@@ -1,14 +0,0 @@
1
- *.bak
2
- *.rbc
3
- *.swp
4
- *~
5
- .#*
6
- .DS_Store
7
- .idea
8
- .rbx
9
- /.rdoc
10
- /TAGS
11
- /coverage
12
- /html
13
- /pkg
14
- Gemfile.lock