rake 10.5.0 → 13.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/History.rdoc +2032 -288
- data/README.rdoc +40 -24
- data/doc/jamis.rb +1 -0
- data/doc/rake.1 +139 -124
- data/doc/rakefile.rdoc +2 -4
- data/{bin → exe}/rake +1 -7
- data/lib/rake/application.rb +131 -90
- data/lib/rake/backtrace.rb +3 -2
- data/lib/rake/clean.rb +7 -5
- data/lib/rake/cloneable.rb +1 -0
- data/lib/rake/cpu_counter.rb +10 -28
- data/lib/rake/default_loader.rb +1 -0
- data/lib/rake/dsl_definition.rb +5 -11
- data/lib/rake/early_time.rb +1 -0
- data/lib/rake/ext/core.rb +1 -0
- data/lib/rake/ext/string.rb +22 -21
- data/lib/rake/file_creation_task.rb +4 -3
- data/lib/rake/file_list.rb +34 -27
- data/lib/rake/file_task.rb +12 -4
- data/lib/rake/file_utils.rb +38 -32
- data/lib/rake/file_utils_ext.rb +8 -18
- data/lib/rake/invocation_chain.rb +1 -0
- data/lib/rake/invocation_exception_mixin.rb +1 -0
- data/lib/rake/late_time.rb +2 -1
- data/lib/rake/linked_list.rb +24 -15
- data/lib/rake/loaders/makefile.rb +5 -4
- data/lib/rake/multi_task.rb +2 -1
- data/lib/rake/name_space.rb +1 -1
- data/lib/rake/packagetask.rb +40 -17
- data/lib/rake/phony.rb +2 -1
- data/lib/rake/private_reader.rb +1 -0
- data/lib/rake/promise.rb +13 -12
- data/lib/rake/pseudo_status.rb +1 -0
- data/lib/rake/rake_module.rb +30 -1
- data/lib/rake/rake_test_loader.rb +9 -4
- data/lib/rake/rule_recursion_overflow_error.rb +2 -2
- data/lib/rake/scope.rb +3 -2
- data/lib/rake/task.rb +82 -31
- data/lib/rake/task_argument_error.rb +1 -0
- data/lib/rake/task_arguments.rb +15 -4
- data/lib/rake/task_manager.rb +56 -32
- data/lib/rake/tasklib.rb +2 -14
- data/lib/rake/testtask.rb +37 -61
- data/lib/rake/thread_history_display.rb +4 -3
- data/lib/rake/thread_pool.rb +16 -17
- data/lib/rake/trace_output.rb +2 -1
- data/lib/rake/version.rb +4 -1
- data/lib/rake/win32.rb +10 -15
- data/lib/rake.rb +35 -43
- data/rake.gemspec +100 -0
- metadata +27 -223
- data/.autotest +0 -7
- data/.rubocop.yml +0 -27
- data/.togglerc +0 -7
- data/CONTRIBUTING.rdoc +0 -38
- data/Manifest.txt +0 -166
- data/Rakefile +0 -81
- data/doc/release_notes/rake-0.4.14.rdoc +0 -23
- data/doc/release_notes/rake-0.4.15.rdoc +0 -35
- data/doc/release_notes/rake-0.5.0.rdoc +0 -53
- data/doc/release_notes/rake-0.5.3.rdoc +0 -78
- data/doc/release_notes/rake-0.5.4.rdoc +0 -46
- data/doc/release_notes/rake-0.6.0.rdoc +0 -141
- data/doc/release_notes/rake-0.7.0.rdoc +0 -119
- data/doc/release_notes/rake-0.7.1.rdoc +0 -59
- data/doc/release_notes/rake-0.7.2.rdoc +0 -121
- data/doc/release_notes/rake-0.7.3.rdoc +0 -47
- data/doc/release_notes/rake-0.8.0.rdoc +0 -114
- data/doc/release_notes/rake-0.8.2.rdoc +0 -165
- data/doc/release_notes/rake-0.8.3.rdoc +0 -112
- data/doc/release_notes/rake-0.8.4.rdoc +0 -147
- data/doc/release_notes/rake-0.8.5.rdoc +0 -53
- data/doc/release_notes/rake-0.8.6.rdoc +0 -37
- data/doc/release_notes/rake-0.8.7.rdoc +0 -55
- data/doc/release_notes/rake-0.9.0.rdoc +0 -112
- data/doc/release_notes/rake-0.9.1.rdoc +0 -52
- data/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
- data/doc/release_notes/rake-0.9.2.rdoc +0 -49
- data/doc/release_notes/rake-0.9.3.rdoc +0 -102
- data/doc/release_notes/rake-0.9.4.rdoc +0 -60
- data/doc/release_notes/rake-0.9.5.rdoc +0 -55
- data/doc/release_notes/rake-0.9.6.rdoc +0 -64
- data/doc/release_notes/rake-10.0.0.rdoc +0 -178
- data/doc/release_notes/rake-10.0.1.rdoc +0 -58
- data/doc/release_notes/rake-10.0.2.rdoc +0 -53
- data/doc/release_notes/rake-10.0.3.rdoc +0 -191
- data/doc/release_notes/rake-10.1.0.rdoc +0 -61
- data/lib/rake/alt_system.rb +0 -110
- data/lib/rake/contrib/.document +0 -1
- data/lib/rake/contrib/compositepublisher.rb +0 -21
- data/lib/rake/contrib/ftptools.rb +0 -137
- data/lib/rake/contrib/publisher.rb +0 -81
- data/lib/rake/contrib/rubyforgepublisher.rb +0 -18
- data/lib/rake/contrib/sshpublisher.rb +0 -61
- data/lib/rake/contrib/sys.rb +0 -4
- data/lib/rake/ext/module.rb +0 -2
- data/lib/rake/ext/pathname.rb +0 -25
- data/lib/rake/ext/time.rb +0 -18
- data/lib/rake/gempackagetask.rb +0 -4
- data/lib/rake/pathmap.rb +0 -3
- data/lib/rake/rdoctask.rb +0 -4
- data/lib/rake/ruby182_test_unit_fix.rb +0 -29
- data/lib/rake/runtest.rb +0 -27
- data/rakelib/publish.rake +0 -20
- data/rakelib/test_times.rake +0 -25
- data/test/file_creation.rb +0 -34
- data/test/helper.rb +0 -129
- data/test/support/rakefile_definitions.rb +0 -478
- data/test/support/ruby_runner.rb +0 -34
- data/test/test_private_reader.rb +0 -42
- data/test/test_rake.rb +0 -40
- data/test/test_rake_application.rb +0 -643
- data/test/test_rake_application_options.rb +0 -468
- data/test/test_rake_backtrace.rb +0 -119
- data/test/test_rake_clean.rb +0 -61
- data/test/test_rake_cpu_counter.rb +0 -68
- data/test/test_rake_definitions.rb +0 -84
- data/test/test_rake_directory_task.rb +0 -76
- data/test/test_rake_dsl.rb +0 -40
- data/test/test_rake_early_time.rb +0 -31
- data/test/test_rake_extension.rb +0 -59
- data/test/test_rake_file_creation_task.rb +0 -56
- data/test/test_rake_file_list.rb +0 -670
- data/test/test_rake_file_list_path_map.rb +0 -8
- data/test/test_rake_file_task.rb +0 -197
- data/test/test_rake_file_utils.rb +0 -314
- data/test/test_rake_ftp_file.rb +0 -74
- data/test/test_rake_functional.rb +0 -482
- data/test/test_rake_invocation_chain.rb +0 -64
- data/test/test_rake_late_time.rb +0 -18
- data/test/test_rake_linked_list.rb +0 -84
- data/test/test_rake_makefile_loader.rb +0 -46
- data/test/test_rake_multi_task.rb +0 -64
- data/test/test_rake_name_space.rb +0 -57
- data/test/test_rake_package_task.rb +0 -79
- data/test/test_rake_path_map.rb +0 -168
- data/test/test_rake_path_map_explode.rb +0 -34
- data/test/test_rake_path_map_partial.rb +0 -18
- data/test/test_rake_pathname_extensions.rb +0 -15
- data/test/test_rake_pseudo_status.rb +0 -21
- data/test/test_rake_rake_test_loader.rb +0 -20
- data/test/test_rake_reduce_compat.rb +0 -26
- data/test/test_rake_require.rb +0 -40
- data/test/test_rake_rules.rb +0 -388
- data/test/test_rake_scope.rb +0 -44
- data/test/test_rake_task.rb +0 -393
- data/test/test_rake_task_argument_parsing.rb +0 -119
- data/test/test_rake_task_arguments.rb +0 -127
- data/test/test_rake_task_lib.rb +0 -9
- data/test/test_rake_task_manager.rb +0 -178
- data/test/test_rake_task_manager_argument_resolution.rb +0 -19
- data/test/test_rake_task_with_arguments.rb +0 -172
- data/test/test_rake_test_task.rb +0 -146
- data/test/test_rake_thread_pool.rb +0 -145
- data/test/test_rake_top_level_functions.rb +0 -71
- data/test/test_rake_win32.rb +0 -72
- data/test/test_thread_history_display.rb +0 -101
- data/test/test_trace_output.rb +0 -52
data/lib/rake/late_time.rb
CHANGED
data/lib/rake/linked_list.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Rake
|
2
3
|
|
3
4
|
# Polylithic linked list structure used to implement several data
|
4
5
|
# structures in Rake.
|
5
6
|
class LinkedList
|
6
7
|
include Enumerable
|
7
|
-
|
8
8
|
attr_reader :head, :tail
|
9
9
|
|
10
|
-
def initialize(head, tail=EMPTY)
|
11
|
-
@head = head
|
12
|
-
@tail = tail
|
13
|
-
end
|
14
|
-
|
15
10
|
# Polymorphically add a new element to the head of a list. The
|
16
11
|
# type of head node will be the same list type as the tail.
|
17
12
|
def conj(item)
|
@@ -19,6 +14,9 @@ module Rake
|
|
19
14
|
end
|
20
15
|
|
21
16
|
# Is the list empty?
|
17
|
+
# .make guards against a list being empty making any instantiated LinkedList
|
18
|
+
# object not empty by default
|
19
|
+
# You should consider overriding this method if you implement your own .make method
|
22
20
|
def empty?
|
23
21
|
false
|
24
22
|
end
|
@@ -26,7 +24,7 @@ module Rake
|
|
26
24
|
# Lists are structurally equivalent.
|
27
25
|
def ==(other)
|
28
26
|
current = self
|
29
|
-
while !
|
27
|
+
while !current.empty? && !other.empty?
|
30
28
|
return false if current.head != other.head
|
31
29
|
current = current.tail
|
32
30
|
other = other.tail
|
@@ -36,20 +34,20 @@ module Rake
|
|
36
34
|
|
37
35
|
# Convert to string: LL(item, item...)
|
38
36
|
def to_s
|
39
|
-
items = map
|
37
|
+
items = map(&:to_s).join(", ")
|
40
38
|
"LL(#{items})"
|
41
39
|
end
|
42
40
|
|
43
41
|
# Same as +to_s+, but with inspected items.
|
44
42
|
def inspect
|
45
|
-
items = map
|
43
|
+
items = map(&:inspect).join(", ")
|
46
44
|
"LL(#{items})"
|
47
45
|
end
|
48
46
|
|
49
47
|
# For each item in the list.
|
50
48
|
def each
|
51
49
|
current = self
|
52
|
-
while !
|
50
|
+
while !current.empty?
|
53
51
|
yield(current.head)
|
54
52
|
current = current.tail
|
55
53
|
end
|
@@ -59,11 +57,16 @@ module Rake
|
|
59
57
|
# Make a list out of the given arguments. This method is
|
60
58
|
# polymorphic
|
61
59
|
def self.make(*args)
|
62
|
-
|
63
|
-
args
|
64
|
-
|
60
|
+
# return an EmptyLinkedList if there are no arguments
|
61
|
+
return empty if !args || args.empty?
|
62
|
+
|
63
|
+
# build a LinkedList by starting at the tail and iterating
|
64
|
+
# through each argument
|
65
|
+
# inject takes an EmptyLinkedList to start
|
66
|
+
args.reverse.inject(empty) do |list, item|
|
67
|
+
list = cons(item, list)
|
68
|
+
list # return the newly created list for each item in the block
|
65
69
|
end
|
66
|
-
result
|
67
70
|
end
|
68
71
|
|
69
72
|
# Cons a new head onto the tail list.
|
@@ -76,6 +79,13 @@ module Rake
|
|
76
79
|
self::EMPTY
|
77
80
|
end
|
78
81
|
|
82
|
+
protected
|
83
|
+
|
84
|
+
def initialize(head, tail=EMPTY)
|
85
|
+
@head = head
|
86
|
+
@tail = tail
|
87
|
+
end
|
88
|
+
|
79
89
|
# Represent an empty list, using the Null Object Pattern.
|
80
90
|
#
|
81
91
|
# When inheriting from the LinkedList class, you should implement
|
@@ -99,5 +109,4 @@ module Rake
|
|
99
109
|
|
100
110
|
EMPTY = EmptyLinkedList.new
|
101
111
|
end
|
102
|
-
|
103
112
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Rake
|
2
3
|
|
3
4
|
# Makefile loader to be used with the import file loader. Use this to
|
@@ -24,7 +25,7 @@ module Rake
|
|
24
25
|
lines = File.read fn
|
25
26
|
lines.gsub!(/\\ /, SPACE_MARK)
|
26
27
|
lines.gsub!(/#[^\n]*\n/m, "")
|
27
|
-
lines.gsub!(/\\\n/,
|
28
|
+
lines.gsub!(/\\\n/, " ")
|
28
29
|
lines.each_line do |line|
|
29
30
|
process_line(line)
|
30
31
|
end
|
@@ -34,7 +35,7 @@ module Rake
|
|
34
35
|
|
35
36
|
# Process one logical line of makefile data.
|
36
37
|
def process_line(line) # :nodoc:
|
37
|
-
file_tasks, args = line.split(
|
38
|
+
file_tasks, args = line.split(":", 2)
|
38
39
|
return if args.nil?
|
39
40
|
dependents = args.split.map { |d| respace(d) }
|
40
41
|
file_tasks.scan(/\S+/) do |file_task|
|
@@ -44,10 +45,10 @@ module Rake
|
|
44
45
|
end
|
45
46
|
|
46
47
|
def respace(str) # :nodoc:
|
47
|
-
str.tr SPACE_MARK,
|
48
|
+
str.tr SPACE_MARK, " "
|
48
49
|
end
|
49
50
|
end
|
50
51
|
|
51
52
|
# Install the handler
|
52
|
-
Rake.application.add_loader(
|
53
|
+
Rake.application.add_loader("mf", MakefileLoader.new)
|
53
54
|
end
|
data/lib/rake/multi_task.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Rake
|
2
3
|
|
3
4
|
# Same as a regular task, but the immediate prerequisites are done in
|
@@ -5,9 +6,9 @@ module Rake
|
|
5
6
|
#
|
6
7
|
class MultiTask < Task
|
7
8
|
private
|
9
|
+
|
8
10
|
def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
|
9
11
|
invoke_prerequisites_concurrently(task_args, invocation_chain)
|
10
12
|
end
|
11
13
|
end
|
12
|
-
|
13
14
|
end
|
data/lib/rake/name_space.rb
CHANGED
data/lib/rake/packagetask.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Define a package task library to aid in the definition of
|
2
3
|
# redistributable package files.
|
3
4
|
|
4
|
-
require
|
5
|
-
require
|
5
|
+
require "rake"
|
6
|
+
require "rake/tasklib"
|
6
7
|
|
7
8
|
module Rake
|
8
9
|
|
@@ -63,6 +64,9 @@ module Rake
|
|
63
64
|
# is false).
|
64
65
|
attr_accessor :need_tar_bz2
|
65
66
|
|
67
|
+
# True if a xz'd tar file (tar.xz) should be produced (default is false)
|
68
|
+
attr_accessor :need_tar_xz
|
69
|
+
|
66
70
|
# True if a zip file should be produced (default is false)
|
67
71
|
attr_accessor :need_zip
|
68
72
|
|
@@ -75,6 +79,9 @@ module Rake
|
|
75
79
|
# Zip command for zipped archives. The default is 'zip'.
|
76
80
|
attr_accessor :zip_command
|
77
81
|
|
82
|
+
# True if parent directory should be omited (default is false)
|
83
|
+
attr_accessor :without_parent_dir
|
84
|
+
|
78
85
|
# Create a Package Task with the given name and version. Use +:noversion+
|
79
86
|
# as the version to build a package without a version or to provide a
|
80
87
|
# fully-versioned package name.
|
@@ -90,13 +97,15 @@ module Rake
|
|
90
97
|
@name = name
|
91
98
|
@version = version
|
92
99
|
@package_files = Rake::FileList.new
|
93
|
-
@package_dir =
|
100
|
+
@package_dir = "pkg"
|
94
101
|
@need_tar = false
|
95
102
|
@need_tar_gz = false
|
96
103
|
@need_tar_bz2 = false
|
104
|
+
@need_tar_xz = false
|
97
105
|
@need_zip = false
|
98
|
-
@tar_command =
|
99
|
-
@zip_command =
|
106
|
+
@tar_command = "tar"
|
107
|
+
@zip_command = "zip"
|
108
|
+
@without_parent_dir = false
|
100
109
|
end
|
101
110
|
|
102
111
|
# Create the tasks defined by this task library.
|
@@ -108,38 +117,37 @@ module Rake
|
|
108
117
|
task :package
|
109
118
|
|
110
119
|
desc "Force a rebuild of the package files"
|
111
|
-
task :
|
120
|
+
task repackage: [:clobber_package, :package]
|
112
121
|
|
113
122
|
desc "Remove package products"
|
114
123
|
task :clobber_package do
|
115
124
|
rm_r package_dir rescue nil
|
116
125
|
end
|
117
126
|
|
118
|
-
task :
|
127
|
+
task clobber: [:clobber_package]
|
119
128
|
|
120
129
|
[
|
121
130
|
[need_tar, tgz_file, "z"],
|
122
131
|
[need_tar_gz, tar_gz_file, "z"],
|
123
|
-
[need_tar_bz2, tar_bz2_file, "j"]
|
124
|
-
|
132
|
+
[need_tar_bz2, tar_bz2_file, "j"],
|
133
|
+
[need_tar_xz, tar_xz_file, "J"]
|
134
|
+
].each do |need, file, flag|
|
125
135
|
if need
|
126
|
-
task :
|
136
|
+
task package: ["#{package_dir}/#{file}"]
|
127
137
|
file "#{package_dir}/#{file}" =>
|
128
138
|
[package_dir_path] + package_files do
|
129
|
-
chdir(
|
130
|
-
|
131
|
-
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
|
132
141
|
end
|
133
142
|
end
|
134
143
|
end
|
135
144
|
|
136
145
|
if need_zip
|
137
|
-
task :
|
146
|
+
task package: ["#{package_dir}/#{zip_file}"]
|
138
147
|
file "#{package_dir}/#{zip_file}" =>
|
139
148
|
[package_dir_path] + package_files do
|
140
|
-
chdir(
|
141
|
-
|
142
|
-
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
|
143
151
|
end
|
144
152
|
end
|
145
153
|
|
@@ -189,11 +197,26 @@ module Rake
|
|
189
197
|
"#{package_name}.tar.bz2"
|
190
198
|
end
|
191
199
|
|
200
|
+
# The package name with .tar.xz added
|
201
|
+
|
202
|
+
def tar_xz_file
|
203
|
+
"#{package_name}.tar.xz"
|
204
|
+
end
|
205
|
+
|
192
206
|
# The package name with .zip added
|
193
207
|
|
194
208
|
def zip_file
|
195
209
|
"#{package_name}.zip"
|
196
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
|
197
220
|
end
|
198
221
|
|
199
222
|
end
|
data/lib/rake/phony.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Defines a :phony task that you can use as a dependency. This allows
|
2
3
|
# file-based tasks to use non-file-based tasks as prerequisites
|
3
4
|
# without forcing them to rebuild.
|
4
5
|
#
|
5
6
|
# See FileTask#out_of_date? and Task#timestamp for more info.
|
6
7
|
|
7
|
-
require
|
8
|
+
require "rake"
|
8
9
|
|
9
10
|
task :phony
|
10
11
|
|
data/lib/rake/private_reader.rb
CHANGED
data/lib/rake/promise.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Rake
|
2
3
|
|
3
4
|
# A Promise object represents a promise to do work (a chore) in the
|
@@ -27,11 +28,11 @@ module Rake
|
|
27
28
|
# synchronously. We will wait.
|
28
29
|
def value
|
29
30
|
unless complete?
|
30
|
-
stat :sleeping_on, :
|
31
|
+
stat :sleeping_on, item_id: object_id
|
31
32
|
@mutex.synchronize do
|
32
|
-
stat :has_lock_on, :
|
33
|
+
stat :has_lock_on, item_id: object_id
|
33
34
|
chore
|
34
|
-
stat :releasing_lock_on, :
|
35
|
+
stat :releasing_lock_on, item_id: object_id
|
35
36
|
end
|
36
37
|
end
|
37
38
|
error? ? raise(@error) : @result
|
@@ -39,14 +40,14 @@ module Rake
|
|
39
40
|
|
40
41
|
# If no one else is working this promise, go ahead and do the chore.
|
41
42
|
def work
|
42
|
-
stat :attempting_lock_on, :
|
43
|
+
stat :attempting_lock_on, item_id: object_id
|
43
44
|
if @mutex.try_lock
|
44
|
-
stat :has_lock_on, :
|
45
|
+
stat :has_lock_on, item_id: object_id
|
45
46
|
chore
|
46
|
-
stat :releasing_lock_on, :
|
47
|
+
stat :releasing_lock_on, item_id: object_id
|
47
48
|
@mutex.unlock
|
48
49
|
else
|
49
|
-
stat :bailed_on, :
|
50
|
+
stat :bailed_on, item_id: object_id
|
50
51
|
end
|
51
52
|
end
|
52
53
|
|
@@ -55,27 +56,27 @@ module Rake
|
|
55
56
|
# Perform the chore promised
|
56
57
|
def chore
|
57
58
|
if complete?
|
58
|
-
stat :found_completed, :
|
59
|
+
stat :found_completed, item_id: object_id
|
59
60
|
return
|
60
61
|
end
|
61
|
-
stat :will_execute, :
|
62
|
+
stat :will_execute, item_id: object_id
|
62
63
|
begin
|
63
64
|
@result = @block.call(*@args)
|
64
65
|
rescue Exception => e
|
65
66
|
@error = e
|
66
67
|
end
|
67
|
-
stat :did_execute, :
|
68
|
+
stat :did_execute, item_id: object_id
|
68
69
|
discard
|
69
70
|
end
|
70
71
|
|
71
72
|
# Do we have a result for the promise
|
72
73
|
def result?
|
73
|
-
|
74
|
+
!@result.equal?(NOT_SET)
|
74
75
|
end
|
75
76
|
|
76
77
|
# Did the promise throw an error
|
77
78
|
def error?
|
78
|
-
|
79
|
+
!@error.equal?(NOT_SET)
|
79
80
|
end
|
80
81
|
|
81
82
|
# Are we done with the promise
|
data/lib/rake/pseudo_status.rb
CHANGED
data/lib/rake/rake_module.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "rake/application"
|
2
3
|
|
3
4
|
module Rake
|
4
5
|
|
@@ -33,6 +34,34 @@ module Rake
|
|
33
34
|
application.options.rakelib ||= []
|
34
35
|
application.options.rakelib.concat(files)
|
35
36
|
end
|
37
|
+
|
38
|
+
# Make +block_application+ the default rake application inside a block so
|
39
|
+
# you can load rakefiles into a different application.
|
40
|
+
#
|
41
|
+
# This is useful when you want to run rake tasks inside a library without
|
42
|
+
# running rake in a sub-shell.
|
43
|
+
#
|
44
|
+
# Example:
|
45
|
+
#
|
46
|
+
# Dir.chdir 'other/directory'
|
47
|
+
#
|
48
|
+
# other_rake = Rake.with_application do |rake|
|
49
|
+
# rake.load_rakefile
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# puts other_rake.tasks
|
53
|
+
|
54
|
+
def with_application(block_application = Rake::Application.new)
|
55
|
+
orig_application = Rake.application
|
56
|
+
|
57
|
+
Rake.application = block_application
|
58
|
+
|
59
|
+
yield block_application
|
60
|
+
|
61
|
+
block_application
|
62
|
+
ensure
|
63
|
+
Rake.application = orig_application
|
64
|
+
end
|
36
65
|
end
|
37
66
|
|
38
67
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rake/file_list"
|
2
4
|
|
3
5
|
# Load the test files from the command line.
|
4
6
|
argv = ARGV.select do |argument|
|
@@ -6,17 +8,20 @@ argv = ARGV.select do |argument|
|
|
6
8
|
when /^-/ then
|
7
9
|
argument
|
8
10
|
when /\*/ then
|
9
|
-
FileList[argument].to_a.each do |file|
|
11
|
+
Rake::FileList[argument].to_a.each do |file|
|
10
12
|
require File.expand_path file
|
11
13
|
end
|
12
14
|
|
13
15
|
false
|
14
16
|
else
|
15
|
-
|
17
|
+
path = File.expand_path argument
|
18
|
+
|
19
|
+
abort "\nFile does not exist: #{path}\n\n" unless File.exist?(path)
|
20
|
+
|
21
|
+
require path
|
16
22
|
|
17
23
|
false
|
18
24
|
end
|
19
25
|
end
|
20
26
|
|
21
27
|
ARGV.replace argv
|
22
|
-
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
module Rake
|
3
3
|
|
4
4
|
# Error indicating a recursion overflow error in task selection.
|
@@ -13,7 +13,7 @@ module Rake
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def message
|
16
|
-
super + ": [" + @targets.reverse.join(
|
16
|
+
super + ": [" + @targets.reverse.join(" => ") + "]"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
data/lib/rake/scope.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Rake
|
2
3
|
class Scope < LinkedList # :nodoc: all
|
3
4
|
|
4
5
|
# Path for the scope.
|
5
6
|
def path
|
6
|
-
map
|
7
|
+
map(&:to_s).reverse.join(":")
|
7
8
|
end
|
8
9
|
|
9
10
|
# Path for the scope + the named path.
|
@@ -15,7 +16,7 @@ module Rake
|
|
15
16
|
# this trim beyond the toplevel scope.
|
16
17
|
def trim(n)
|
17
18
|
result = self
|
18
|
-
while n > 0 && !
|
19
|
+
while n > 0 && !result.empty?
|
19
20
|
result = result.tail
|
20
21
|
n -= 1
|
21
22
|
end
|