rake 12.2.0 → 13.0.6
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 +4 -4
- data/History.rdoc +121 -0
- data/README.rdoc +20 -21
- data/lib/rake/application.rb +17 -5
- data/lib/rake/clean.rb +2 -2
- data/lib/rake/cpu_counter.rb +1 -1
- data/lib/rake/dsl_definition.rb +3 -3
- data/lib/rake/file_creation_task.rb +1 -1
- data/lib/rake/file_list.rb +2 -2
- data/lib/rake/file_task.rb +2 -2
- data/lib/rake/file_utils.rb +8 -11
- data/lib/rake/file_utils_ext.rb +6 -17
- data/lib/rake/multi_task.rb +1 -37
- data/lib/rake/packagetask.rb +17 -6
- data/lib/rake/promise.rb +2 -2
- data/lib/rake/rake_test_loader.rb +17 -16
- data/lib/rake/scope.rb +1 -1
- data/lib/rake/task.rb +58 -15
- data/lib/rake/task_manager.rb +37 -25
- data/lib/rake/testtask.rb +1 -36
- data/lib/rake/thread_pool.rb +1 -1
- data/lib/rake/version.rb +1 -1
- data/rake.gemspec +71 -14
- metadata +14 -87
- data/.gitignore +0 -14
- data/CONTRIBUTING.rdoc +0 -36
- data/Gemfile +0 -3
- data/Rakefile +0 -38
- data/bin/console +0 -7
- data/bin/setup +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d15ff579792b6bca336893adc15bc3de3d8c8580fcdb2b2201926df30752284d
|
4
|
+
data.tar.gz: 499353c3ebbcd6492fb8d9fdd96078bf7954c1b3ec21f1d80bac8bf1ea592ea0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 664fa6daddc629e8bb6fd1863a765e8a7d7f2eda234ab423800dc810fe9bded3d4622e19f633e4307d322cd14adfb0c197de04394df1a0a6fa0b86fc702a7d93
|
7
|
+
data.tar.gz: 7f0f7208745a41dacf9959b2a4ee063deeee549d0d2e90904c47d3e84feb976e65fcc4e33f943eefdfa0ec0334e83b63ad280be0ff3926aff471a9c0b25acef9
|
data/History.rdoc
CHANGED
@@ -1,3 +1,124 @@
|
|
1
|
+
=== 13.0.6
|
2
|
+
|
3
|
+
* Additional fix for #389
|
4
|
+
Pull request #390 by hsbt
|
5
|
+
|
6
|
+
=== 13.0.5
|
7
|
+
|
8
|
+
* Fixed the regression of #388
|
9
|
+
Pull request #389 by hsbt
|
10
|
+
|
11
|
+
=== 13.0.4
|
12
|
+
|
13
|
+
* Fix rake test loader swallowing useful error information.
|
14
|
+
Pull request #367 by deivid-rodriguez
|
15
|
+
* Add -C/--directory option the same as GNU make.
|
16
|
+
Pull request #376 by nobu
|
17
|
+
|
18
|
+
=== 13.0.3
|
19
|
+
|
20
|
+
* Fix breaking change of execution order on TestTask.
|
21
|
+
Pull request #368 by ysakasin
|
22
|
+
|
23
|
+
=== 13.0.2
|
24
|
+
|
25
|
+
==== Enhancements
|
26
|
+
|
27
|
+
* Fix tests to work with current FileUtils
|
28
|
+
Pull Request #358 by jeremyevans
|
29
|
+
* Simplify default rake test loader
|
30
|
+
Pull Request #357 by deivid-rodriguez
|
31
|
+
* Update rdoc
|
32
|
+
Pull Request #366 by bahasalien
|
33
|
+
* Update broken links to rake articles from Avdi in README
|
34
|
+
Pull Request #360 by svl7
|
35
|
+
|
36
|
+
=== 13.0.1
|
37
|
+
|
38
|
+
==== Bug fixes
|
39
|
+
|
40
|
+
* Fixed bug: Reenabled task raises previous exception on second invokation
|
41
|
+
Pull Request #271 by thorsteneckel
|
42
|
+
* Fix an incorrectly resolved arg pattern
|
43
|
+
Pull Request #327 by mjbellantoni
|
44
|
+
|
45
|
+
=== 13.0.0
|
46
|
+
|
47
|
+
==== Enhancements
|
48
|
+
|
49
|
+
* Follows recent changes on keyword arguments in ruby 2.7.
|
50
|
+
Pull Request #326 by nobu
|
51
|
+
* Make `PackageTask` be able to omit parent directory while packing files
|
52
|
+
Pull Request #310 by tonytonyjan
|
53
|
+
* Add order only dependency
|
54
|
+
Pull Request #269 by take-cheeze
|
55
|
+
|
56
|
+
==== Compatibility changes
|
57
|
+
|
58
|
+
* Drop old ruby versions(< 2.2)
|
59
|
+
|
60
|
+
=== 12.3.3
|
61
|
+
|
62
|
+
==== Bug fixes
|
63
|
+
|
64
|
+
* Use the application's name in error message if a task is not found.
|
65
|
+
Pull Request #303 by tmatilai
|
66
|
+
|
67
|
+
==== Enhancements:
|
68
|
+
|
69
|
+
* Use File.open explicitly.
|
70
|
+
|
71
|
+
=== 12.3.2
|
72
|
+
|
73
|
+
==== Bug fixes
|
74
|
+
|
75
|
+
* Fixed test fails caused by 2.6 warnings.
|
76
|
+
Pull Request #297 by hsbt
|
77
|
+
|
78
|
+
==== Enhancements:
|
79
|
+
|
80
|
+
* Rdoc improvements.
|
81
|
+
Pull Request #293 by colby-swandale
|
82
|
+
* Improve multitask performance.
|
83
|
+
Pull Request #273 by jsm
|
84
|
+
* Add alias `prereqs`.
|
85
|
+
Pull Request #268 by take-cheeze
|
86
|
+
|
87
|
+
=== 12.3.1
|
88
|
+
|
89
|
+
==== Bug fixes
|
90
|
+
|
91
|
+
* Support did_you_mean >= v1.2.0 which has a breaking change on formatters.
|
92
|
+
Pull request #262 by FUJI Goro.
|
93
|
+
|
94
|
+
==== Enhancements:
|
95
|
+
|
96
|
+
* Don't run task if it depends on already invoked but failed task.
|
97
|
+
Pull request #252 by Gonzalo Rodriguez.
|
98
|
+
* Make space trimming consistent for all task arguments.
|
99
|
+
Pull request #259 by Gonzalo Rodriguez.
|
100
|
+
* Removes duplicated inclusion of Rake::DSL in tests.
|
101
|
+
Pull request #254 by Gonzalo Rodriguez.
|
102
|
+
* Re-raise a LoadError that didn't come from require in the test loader.
|
103
|
+
Pull request #250 by Dylan Thacker-Smith.
|
104
|
+
|
105
|
+
=== 12.3.0
|
106
|
+
|
107
|
+
==== Compatibility Changes
|
108
|
+
|
109
|
+
* Bump `required_ruby_version` to Ruby 2.0.0. Rake has already
|
110
|
+
removed support for Ruby 1.9.x.
|
111
|
+
|
112
|
+
==== Enhancements:
|
113
|
+
|
114
|
+
* Support `test-bundled-gems` task on ruby core.
|
115
|
+
|
116
|
+
=== 12.2.1
|
117
|
+
|
118
|
+
==== Bug fixes
|
119
|
+
|
120
|
+
* Fixed to break Capistrano::Application on capistrano3.
|
121
|
+
|
1
122
|
=== 12.2.0
|
2
123
|
|
3
124
|
==== Enhancements:
|
data/README.rdoc
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
home :: https://github.com/ruby/rake
|
4
4
|
bugs :: https://github.com/ruby/rake/issues
|
5
5
|
docs :: https://ruby.github.io/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
6
|
|
8
7
|
== Description
|
9
8
|
|
@@ -25,8 +24,8 @@ Rake has the following features:
|
|
25
24
|
|
26
25
|
* A library of prepackaged tasks to make building rakefiles easier. For example,
|
27
26
|
tasks for building tarballs. (Formerly
|
28
|
-
tasks for building RDoc, Gems and publishing to FTP were included in rake but they're now
|
29
|
-
available in RDoc, RubyGems and
|
27
|
+
tasks for building RDoc, Gems, and publishing to FTP were included in rake but they're now
|
28
|
+
available in RDoc, RubyGems, and rake-contrib respectively.)
|
30
29
|
|
31
30
|
* Supports parallel execution of tasks.
|
32
31
|
|
@@ -75,35 +74,35 @@ Type "rake --help" for all available options.
|
|
75
74
|
|
76
75
|
=== Rake Information
|
77
76
|
|
78
|
-
* {Rake command-line}[
|
79
|
-
* {Writing Rakefiles}[
|
80
|
-
* The original {Rake announcement}[
|
81
|
-
* Rake {glossary}[
|
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]
|
82
81
|
|
83
82
|
=== Presentations and Articles about Rake
|
84
83
|
|
85
84
|
* Avdi Grimm's rake series:
|
86
|
-
1. {Rake Basics}[
|
87
|
-
2. {Rake File Lists}[
|
88
|
-
3. {Rake Rules}[
|
89
|
-
4. {Rake Pathmap}[
|
90
|
-
5. {File Operations}[
|
91
|
-
6. {Clean and Clobber}[
|
92
|
-
7. {MultiTask}[
|
93
|
-
* {Jim Weirich's 2003 RubyConf presentation}[
|
94
|
-
* Martin Fowler's article on Rake:
|
85
|
+
1. {Rake Basics}[https://avdi.codes/rake-part-1-basics/]
|
86
|
+
2. {Rake File Lists}[https://avdi.codes/rake-part-2-file-lists-2/]
|
87
|
+
3. {Rake Rules}[https://avdi.codes/rake-part-3-rules/]
|
88
|
+
4. {Rake Pathmap}[https://avdi.codes/rake-part-4-pathmap/]
|
89
|
+
5. {File Operations}[https://avdi.codes/rake-part-5-file-operations/]
|
90
|
+
6. {Clean and Clobber}[https://avdi.codes/rake-part-6-clean-and-clobber/]
|
91
|
+
7. {MultiTask}[https://avdi.codes/rake-part-7-multitask/]
|
92
|
+
* {Jim Weirich's 2003 RubyConf presentation}[https://web.archive.org/web/20140221123354/http://onestepback.org/articles/buildingwithrake/]
|
93
|
+
* Martin Fowler's article on Rake: https://martinfowler.com/articles/rake.html
|
95
94
|
|
96
95
|
== Other Make Re-envisionings ...
|
97
96
|
|
98
97
|
Rake is a late entry in the make replacement field. Here are links to
|
99
98
|
other projects with similar (and not so similar) goals.
|
100
99
|
|
101
|
-
*
|
100
|
+
* https://directory.fsf.org/wiki/Bras -- Bras, one of earliest
|
102
101
|
implementations of "make in a scripting language".
|
103
102
|
* http://www.a-a-p.org -- Make in Python
|
104
|
-
*
|
105
|
-
*
|
106
|
-
*
|
103
|
+
* https://ant.apache.org -- The Ant project
|
104
|
+
* https://search.cpan.org/search?query=PerlBuildSystem -- The Perl Build System
|
105
|
+
* https://www.rubydoc.info/gems/rant/0.5.7/frames -- Rant, another Ruby make tool.
|
107
106
|
|
108
107
|
== Credits
|
109
108
|
|
@@ -130,7 +129,7 @@ Rake is available under an MIT-style license.
|
|
130
129
|
= Other stuff
|
131
130
|
|
132
131
|
Author:: Jim Weirich <jim.weirich@gmail.com>
|
133
|
-
Requires:: Ruby
|
132
|
+
Requires:: Ruby 2.0.0 or later
|
134
133
|
License:: Copyright Jim Weirich.
|
135
134
|
Released under an MIT-style license. See the MIT-LICENSE
|
136
135
|
file included in the distribution.
|
data/lib/rake/application.rb
CHANGED
@@ -88,7 +88,12 @@ module Rake
|
|
88
88
|
def init(app_name="rake", argv = ARGV)
|
89
89
|
standard_exception_handling do
|
90
90
|
@name = app_name
|
91
|
-
|
91
|
+
begin
|
92
|
+
args = handle_options argv
|
93
|
+
rescue ArgumentError
|
94
|
+
# Backward compatibility for capistrano
|
95
|
+
args = handle_options
|
96
|
+
end
|
92
97
|
collect_command_line_tasks(args)
|
93
98
|
end
|
94
99
|
end
|
@@ -167,7 +172,7 @@ module Rake
|
|
167
172
|
args = []
|
168
173
|
|
169
174
|
begin
|
170
|
-
|
175
|
+
/\s*((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args
|
171
176
|
|
172
177
|
remaining_args = $2
|
173
178
|
args << $1.gsub(/\\(.)/, '\1')
|
@@ -387,7 +392,7 @@ module Rake
|
|
387
392
|
|
388
393
|
def sort_options(options) # :nodoc:
|
389
394
|
options.sort_by { |opt|
|
390
|
-
opt.select { |o| o =~ /^-/ }.map(&:downcase).sort.reverse
|
395
|
+
opt.select { |o| o.is_a?(String) && o =~ /^-/ }.map(&:downcase).sort.reverse
|
391
396
|
}
|
392
397
|
end
|
393
398
|
private :sort_options
|
@@ -428,6 +433,13 @@ module Rake
|
|
428
433
|
select_tasks_to_show(options, :describe, value)
|
429
434
|
}
|
430
435
|
],
|
436
|
+
["--directory", "-C [DIRECTORY]",
|
437
|
+
"Change to DIRECTORY before doing anything.",
|
438
|
+
lambda { |value|
|
439
|
+
Dir.chdir value
|
440
|
+
@original_dir = Dir.pwd
|
441
|
+
}
|
442
|
+
],
|
431
443
|
["--dry-run", "-n",
|
432
444
|
"Do a dry run without executing actions.",
|
433
445
|
lambda { |value|
|
@@ -682,7 +694,7 @@ module Rake
|
|
682
694
|
|
683
695
|
def raw_load_rakefile # :nodoc:
|
684
696
|
rakefile, location = find_rakefile_location
|
685
|
-
if (!
|
697
|
+
if (!options.ignore_system) &&
|
686
698
|
(options.load_system || rakefile.nil?) &&
|
687
699
|
system_dir && File.directory?(system_dir)
|
688
700
|
print_rakefile_directory(location)
|
@@ -792,7 +804,7 @@ module Rake
|
|
792
804
|
backtrace.find { |str| str =~ re } || ""
|
793
805
|
end
|
794
806
|
|
795
|
-
def set_default_options
|
807
|
+
def set_default_options # :nodoc:
|
796
808
|
options.always_multitask = false
|
797
809
|
options.backtrace = false
|
798
810
|
options.build_all = false
|
data/lib/rake/clean.rb
CHANGED
@@ -28,10 +28,10 @@ module Rake
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
def cleanup(file_name, opts
|
31
|
+
def cleanup(file_name, **opts)
|
32
32
|
begin
|
33
33
|
opts = { verbose: Rake.application.options.trace }.merge(opts)
|
34
|
-
rm_r file_name, opts
|
34
|
+
rm_r file_name, **opts
|
35
35
|
rescue StandardError => ex
|
36
36
|
puts "Failed to remove #{file_name}: #{ex}" unless file_already_gone?(file_name)
|
37
37
|
end
|
data/lib/rake/cpu_counter.rb
CHANGED
data/lib/rake/dsl_definition.rb
CHANGED
@@ -26,9 +26,9 @@ module Rake
|
|
26
26
|
private
|
27
27
|
|
28
28
|
# :call-seq:
|
29
|
-
# task
|
30
|
-
# task
|
31
|
-
# task
|
29
|
+
# task(task_name)
|
30
|
+
# task(task_name: dependencies)
|
31
|
+
# task(task_name, arguments => dependencies)
|
32
32
|
#
|
33
33
|
# Declare a basic task. The +task_name+ is always the first argument. If
|
34
34
|
# the task name contains a ":" it is defined in that namespace.
|
data/lib/rake/file_list.rb
CHANGED
@@ -294,7 +294,7 @@ module Rake
|
|
294
294
|
matched = 0
|
295
295
|
each do |fn|
|
296
296
|
begin
|
297
|
-
open(fn, "r", *options) do |inf|
|
297
|
+
File.open(fn, "r", *options) do |inf|
|
298
298
|
count = 0
|
299
299
|
inf.each do |line|
|
300
300
|
count += 1
|
@@ -385,7 +385,7 @@ module Rake
|
|
385
385
|
/~$/
|
386
386
|
]
|
387
387
|
DEFAULT_IGNORE_PROCS = [
|
388
|
-
proc { |fn| fn =~ /(^|[\/\\])core$/ && !
|
388
|
+
proc { |fn| fn =~ /(^|[\/\\])core$/ && !File.directory?(fn) }
|
389
389
|
]
|
390
390
|
|
391
391
|
def import(array) # :nodoc:
|
data/lib/rake/file_task.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require "rake/task
|
2
|
+
require "rake/task"
|
3
3
|
require "rake/early_time"
|
4
4
|
|
5
5
|
module Rake
|
@@ -14,7 +14,7 @@ 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
|
-
!
|
17
|
+
!File.exist?(name) || out_of_date?(timestamp) || @application.options.build_all
|
18
18
|
end
|
19
19
|
|
20
20
|
# Time stamp for file task.
|
data/lib/rake/file_utils.rb
CHANGED
@@ -35,7 +35,7 @@ module FileUtils
|
|
35
35
|
#
|
36
36
|
# # check exit status after command runs
|
37
37
|
# sh %{grep pattern file} do |ok, res|
|
38
|
-
# if !
|
38
|
+
# if !ok
|
39
39
|
# puts "pattern not found (status = #{res.exitstatus})"
|
40
40
|
# end
|
41
41
|
# end
|
@@ -97,12 +97,11 @@ module FileUtils
|
|
97
97
|
# Example:
|
98
98
|
# ruby %{-pe '$_.upcase!' <README}
|
99
99
|
#
|
100
|
-
def ruby(*args, &block)
|
101
|
-
options = (Hash === args.last) ? args.pop : {}
|
100
|
+
def ruby(*args, **options, &block)
|
102
101
|
if args.length > 1
|
103
|
-
sh(
|
102
|
+
sh(RUBY, *args, **options, &block)
|
104
103
|
else
|
105
|
-
sh("#{RUBY} #{args.first}", options, &block)
|
104
|
+
sh("#{RUBY} #{args.first}", **options, &block)
|
106
105
|
end
|
107
106
|
end
|
108
107
|
|
@@ -110,17 +109,15 @@ module FileUtils
|
|
110
109
|
|
111
110
|
# Attempt to do a normal file link, but fall back to a copy if the link
|
112
111
|
# fails.
|
113
|
-
def safe_ln(*args)
|
114
|
-
if
|
115
|
-
cp(*args)
|
116
|
-
else
|
112
|
+
def safe_ln(*args, **options)
|
113
|
+
if LN_SUPPORTED[0]
|
117
114
|
begin
|
118
|
-
ln(*args)
|
115
|
+
return options.empty? ? ln(*args) : ln(*args, **options)
|
119
116
|
rescue StandardError, NotImplementedError
|
120
117
|
LN_SUPPORTED[0] = false
|
121
|
-
cp(*args)
|
122
118
|
end
|
123
119
|
end
|
120
|
+
options.empty? ? cp(*args) : cp(*args, **options)
|
124
121
|
end
|
125
122
|
|
126
123
|
# Split a file path into individual directory names.
|
data/lib/rake/file_utils_ext.rb
CHANGED
@@ -23,19 +23,18 @@ module Rake
|
|
23
23
|
opts = FileUtils.options_of name
|
24
24
|
default_options = []
|
25
25
|
if opts.include?("verbose")
|
26
|
-
default_options << ":
|
26
|
+
default_options << "verbose: FileUtilsExt.verbose_flag"
|
27
27
|
end
|
28
28
|
if opts.include?("noop")
|
29
|
-
default_options << ":
|
29
|
+
default_options << "noop: FileUtilsExt.nowrite_flag"
|
30
30
|
end
|
31
31
|
|
32
32
|
next if default_options.empty?
|
33
33
|
module_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
34
|
-
def #{name}(
|
35
|
-
super(
|
36
|
-
|
37
|
-
|
38
|
-
), &block)
|
34
|
+
def #{name}(*args, **options, &block)
|
35
|
+
super(*args,
|
36
|
+
#{default_options.join(', ')},
|
37
|
+
**options, &block)
|
39
38
|
end
|
40
39
|
EOS
|
41
40
|
end
|
@@ -113,16 +112,6 @@ module Rake
|
|
113
112
|
end
|
114
113
|
end
|
115
114
|
|
116
|
-
# Merge the given options with the default values.
|
117
|
-
def rake_merge_option(args, defaults)
|
118
|
-
if Hash === args.last
|
119
|
-
defaults.update(args.last)
|
120
|
-
args.pop
|
121
|
-
end
|
122
|
-
args.push defaults
|
123
|
-
args
|
124
|
-
end
|
125
|
-
|
126
115
|
# Send the message to the default rake output (which is $stderr).
|
127
116
|
def rake_output_message(message)
|
128
117
|
$stderr.puts(message)
|
data/lib/rake/multi_task.rb
CHANGED
@@ -5,46 +5,10 @@ module Rake
|
|
5
5
|
# parallel using Ruby threads.
|
6
6
|
#
|
7
7
|
class MultiTask < Task
|
8
|
-
|
9
|
-
# Same as invoke, but explicitly pass a call chain to detect
|
10
|
-
# circular dependencies. This is largely copied from Rake::Task
|
11
|
-
# but has been updated such that if multiple tasks depend on this
|
12
|
-
# one in parallel, they will all fail if the first execution of
|
13
|
-
# this task fails.
|
14
|
-
def invoke_with_call_chain(task_args, invocation_chain)
|
15
|
-
new_chain = Rake::InvocationChain.append(self, invocation_chain)
|
16
|
-
@lock.synchronize do
|
17
|
-
begin
|
18
|
-
if @already_invoked
|
19
|
-
if @invocation_exception
|
20
|
-
if application.options.trace
|
21
|
-
application.trace "** Previous invocation of #{name} failed #{format_trace_flags}"
|
22
|
-
end
|
23
|
-
raise @invocation_exception
|
24
|
-
else
|
25
|
-
return
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
if application.options.trace
|
30
|
-
application.trace "** Invoke #{name} #{format_trace_flags}"
|
31
|
-
end
|
32
|
-
@already_invoked = true
|
33
|
-
|
34
|
-
invoke_prerequisites(task_args, new_chain)
|
35
|
-
execute(task_args) if needed?
|
36
|
-
rescue Exception => ex
|
37
|
-
add_chain_to(ex, new_chain)
|
38
|
-
@invocation_exception = ex
|
39
|
-
raise
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
8
|
private
|
9
|
+
|
45
10
|
def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
|
46
11
|
invoke_prerequisites_concurrently(task_args, invocation_chain)
|
47
12
|
end
|
48
13
|
end
|
49
|
-
|
50
14
|
end
|
data/lib/rake/packagetask.rb
CHANGED
@@ -79,6 +79,9 @@ 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)
|
83
|
+
attr_accessor :without_parent_dir
|
84
|
+
|
82
85
|
# Create a Package Task with the given name and version. Use +:noversion+
|
83
86
|
# as the version to build a package without a version or to provide a
|
84
87
|
# fully-versioned package name.
|
@@ -102,6 +105,7 @@ module Rake
|
|
102
105
|
@need_zip = false
|
103
106
|
@tar_command = "tar"
|
104
107
|
@zip_command = "zip"
|
108
|
+
@without_parent_dir = false
|
105
109
|
end
|
106
110
|
|
107
111
|
# Create the tasks defined by this task library.
|
@@ -132,9 +136,8 @@ module Rake
|
|
132
136
|
task package: ["#{package_dir}/#{file}"]
|
133
137
|
file "#{package_dir}/#{file}" =>
|
134
138
|
[package_dir_path] + package_files do
|
135
|
-
chdir(
|
136
|
-
|
137
|
-
end
|
139
|
+
chdir(working_dir) { sh @tar_command, "#{flag}cvf", file, target_dir }
|
140
|
+
mv "#{package_dir_path}/#{target_dir}", package_dir if without_parent_dir
|
138
141
|
end
|
139
142
|
end
|
140
143
|
end
|
@@ -143,9 +146,8 @@ module Rake
|
|
143
146
|
task package: ["#{package_dir}/#{zip_file}"]
|
144
147
|
file "#{package_dir}/#{zip_file}" =>
|
145
148
|
[package_dir_path] + package_files do
|
146
|
-
chdir(
|
147
|
-
|
148
|
-
end
|
149
|
+
chdir(working_dir) { sh @zip_command, "-r", zip_file, target_dir }
|
150
|
+
mv "#{package_dir_path}/#{zip_file}", package_dir if without_parent_dir
|
149
151
|
end
|
150
152
|
end
|
151
153
|
|
@@ -206,6 +208,15 @@ module Rake
|
|
206
208
|
def zip_file
|
207
209
|
"#{package_name}.zip"
|
208
210
|
end
|
211
|
+
|
212
|
+
def working_dir
|
213
|
+
without_parent_dir ? package_dir_path : package_dir
|
214
|
+
end
|
215
|
+
|
216
|
+
# target directory relative to working_dir
|
217
|
+
def target_dir
|
218
|
+
without_parent_dir ? "." : package_name
|
219
|
+
end
|
209
220
|
end
|
210
221
|
|
211
222
|
end
|
data/lib/rake/promise.rb
CHANGED
@@ -71,12 +71,12 @@ module Rake
|
|
71
71
|
|
72
72
|
# Do we have a result for the promise
|
73
73
|
def result?
|
74
|
-
|
74
|
+
!@result.equal?(NOT_SET)
|
75
75
|
end
|
76
76
|
|
77
77
|
# Did the promise throw an error
|
78
78
|
def error?
|
79
|
-
|
79
|
+
!@error.equal?(NOT_SET)
|
80
80
|
end
|
81
81
|
|
82
82
|
# Are we done with the promise
|
@@ -1,25 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require "rake/file_list"
|
3
4
|
|
4
5
|
# Load the test files from the command line.
|
5
6
|
argv = ARGV.select do |argument|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
7
|
+
case argument
|
8
|
+
when /^-/ then
|
9
|
+
argument
|
10
|
+
when /\*/ then
|
11
|
+
Rake::FileList[argument].to_a.each do |file|
|
12
|
+
require File.expand_path file
|
13
|
+
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
false
|
16
|
+
else
|
17
|
+
path = File.expand_path argument
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
abort "\nFile does not exist: #{path}\n\n" unless File.exist?(path)
|
20
|
+
|
21
|
+
require path
|
22
|
+
|
23
|
+
false
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|