rake 0.9.2 → 13.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.rdoc +43 -0
  3. data/Gemfile +10 -0
  4. data/History.rdoc +2386 -0
  5. data/MIT-LICENSE +1 -1
  6. data/README.rdoc +64 -109
  7. data/Rakefile +22 -386
  8. data/bin/bundle +105 -0
  9. data/bin/console +7 -0
  10. data/bin/rake +20 -23
  11. data/bin/rdoc +29 -0
  12. data/bin/rubocop +29 -0
  13. data/bin/setup +6 -0
  14. data/doc/command_line_usage.rdoc +65 -21
  15. data/doc/glossary.rdoc +40 -49
  16. data/doc/jamis.rb +1 -0
  17. data/doc/rake.1 +156 -0
  18. data/doc/rakefile.rdoc +127 -62
  19. data/exe/rake +27 -0
  20. data/lib/rake.rb +37 -31
  21. data/lib/rake/application.rb +507 -272
  22. data/lib/rake/backtrace.rb +24 -0
  23. data/lib/rake/clean.rb +55 -8
  24. data/lib/rake/cloneable.rb +11 -19
  25. data/lib/rake/cpu_counter.rb +107 -0
  26. data/lib/rake/default_loader.rb +5 -0
  27. data/lib/rake/dsl_definition.rb +74 -46
  28. data/lib/rake/early_time.rb +5 -1
  29. data/lib/rake/ext/core.rb +5 -6
  30. data/lib/rake/ext/string.rb +61 -52
  31. data/lib/rake/file_creation_task.rb +4 -3
  32. data/lib/rake/file_list.rb +81 -49
  33. data/lib/rake/file_task.rb +15 -8
  34. data/lib/rake/file_utils.rb +69 -47
  35. data/lib/rake/file_utils_ext.rb +18 -26
  36. data/lib/rake/invocation_chain.rb +25 -19
  37. data/lib/rake/invocation_exception_mixin.rb +1 -0
  38. data/lib/rake/late_time.rb +18 -0
  39. data/lib/rake/linked_list.rb +112 -0
  40. data/lib/rake/loaders/makefile.rb +23 -9
  41. data/lib/rake/multi_task.rb +4 -6
  42. data/lib/rake/name_space.rb +36 -23
  43. data/lib/rake/packagetask.rb +71 -34
  44. data/lib/rake/phony.rb +16 -0
  45. data/lib/rake/private_reader.rb +21 -0
  46. data/lib/rake/promise.rb +100 -0
  47. data/lib/rake/pseudo_status.rb +8 -2
  48. data/lib/rake/rake_module.rb +41 -3
  49. data/lib/rake/rake_test_loader.rb +21 -7
  50. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  51. data/lib/rake/scope.rb +43 -0
  52. data/lib/rake/task.rb +186 -79
  53. data/lib/rake/task_argument_error.rb +1 -0
  54. data/lib/rake/task_arguments.rb +50 -15
  55. data/lib/rake/task_manager.rb +89 -65
  56. data/lib/rake/tasklib.rb +2 -12
  57. data/lib/rake/testtask.rb +61 -63
  58. data/lib/rake/thread_history_display.rb +49 -0
  59. data/lib/rake/thread_pool.rb +163 -0
  60. data/lib/rake/trace_output.rb +23 -0
  61. data/lib/rake/version.rb +7 -7
  62. data/lib/rake/win32.rb +14 -18
  63. data/rake.gemspec +43 -0
  64. metadata +82 -221
  65. data/.gemtest +0 -0
  66. data/CHANGES +0 -509
  67. data/RRR +0 -9
  68. data/TODO +0 -20
  69. data/doc/rake.1.gz +0 -0
  70. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  71. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  72. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  73. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  74. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  75. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  76. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  77. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  78. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  79. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  80. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  81. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  82. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  83. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  84. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  85. data/doc/release_notes/rake-0.8.6.rdoc +0 -55
  86. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  87. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  88. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  89. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  90. data/install.rb +0 -90
  91. data/lib/rake/alt_system.rb +0 -109
  92. data/lib/rake/classic_namespace.rb +0 -9
  93. data/lib/rake/contrib/compositepublisher.rb +0 -21
  94. data/lib/rake/contrib/ftptools.rb +0 -150
  95. data/lib/rake/contrib/publisher.rb +0 -69
  96. data/lib/rake/contrib/rubyforgepublisher.rb +0 -16
  97. data/lib/rake/contrib/sshpublisher.rb +0 -45
  98. data/lib/rake/contrib/sys.rb +0 -191
  99. data/lib/rake/ext/module.rb +0 -39
  100. data/lib/rake/ext/time.rb +0 -14
  101. data/lib/rake/gempackagetask.rb +0 -13
  102. data/lib/rake/pathmap.rb +0 -1
  103. data/lib/rake/rdoctask.rb +0 -230
  104. data/lib/rake/ruby182_test_unit_fix.rb +0 -25
  105. data/lib/rake/runtest.rb +0 -21
  106. data/test/check_expansion.rb +0 -5
  107. data/test/check_no_expansion.rb +0 -5
  108. data/test/data/access/Rakefile +0 -35
  109. data/test/data/chains/Rakefile +0 -15
  110. data/test/data/comments/Rakefile +0 -18
  111. data/test/data/default/Rakefile +0 -17
  112. data/test/data/deprecated_import/Rakefile +0 -1
  113. data/test/data/dryrun/Rakefile +0 -22
  114. data/test/data/extra/Rakefile +0 -1
  115. data/test/data/file_creation_task/Rakefile +0 -31
  116. data/test/data/imports/Rakefile +0 -19
  117. data/test/data/imports/deps.mf +0 -1
  118. data/test/data/multidesc/Rakefile +0 -15
  119. data/test/data/namespace/Rakefile +0 -64
  120. data/test/data/rakelib/test1.rb +0 -4
  121. data/test/data/rbext/rakefile.rb +0 -3
  122. data/test/data/sample.mf +0 -14
  123. data/test/data/statusreturn/Rakefile +0 -6
  124. data/test/data/unittest/Rakefile +0 -1
  125. data/test/data/verbose/Rakefile +0 -34
  126. data/test/file_creation.rb +0 -34
  127. data/test/helper.rb +0 -44
  128. data/test/in_environment.rb +0 -35
  129. data/test/reqfile.rb +0 -3
  130. data/test/reqfile2.rb +0 -3
  131. data/test/shellcommand.rb +0 -3
  132. data/test/test_rake.rb +0 -38
  133. data/test/test_rake_application.rb +0 -364
  134. data/test/test_rake_application_options.rb +0 -382
  135. data/test/test_rake_clean.rb +0 -12
  136. data/test/test_rake_definitions.rb +0 -80
  137. data/test/test_rake_directory_task.rb +0 -55
  138. data/test/test_rake_dsl.rb +0 -73
  139. data/test/test_rake_early_time.rb +0 -31
  140. data/test/test_rake_extension.rb +0 -59
  141. data/test/test_rake_file_creation_task.rb +0 -62
  142. data/test/test_rake_file_list.rb +0 -633
  143. data/test/test_rake_file_list_path_map.rb +0 -8
  144. data/test/test_rake_file_task.rb +0 -104
  145. data/test/test_rake_file_utils.rb +0 -252
  146. data/test/test_rake_ftp_file.rb +0 -59
  147. data/test/test_rake_functional.rb +0 -468
  148. data/test/test_rake_invocation_chain.rb +0 -52
  149. data/test/test_rake_makefile_loader.rb +0 -23
  150. data/test/test_rake_multi_task.rb +0 -51
  151. data/test/test_rake_name_space.rb +0 -43
  152. data/test/test_rake_package_task.rb +0 -78
  153. data/test/test_rake_path_map.rb +0 -157
  154. data/test/test_rake_path_map_explode.rb +0 -31
  155. data/test/test_rake_path_map_partial.rb +0 -18
  156. data/test/test_rake_pseudo_status.rb +0 -20
  157. data/test/test_rake_rdoc_task.rb +0 -81
  158. data/test/test_rake_require.rb +0 -35
  159. data/test/test_rake_rules.rb +0 -346
  160. data/test/test_rake_task.rb +0 -271
  161. data/test/test_rake_task_argument_parsing.rb +0 -116
  162. data/test/test_rake_task_arguments.rb +0 -86
  163. data/test/test_rake_task_lib.rb +0 -9
  164. data/test/test_rake_task_manager.rb +0 -145
  165. data/test/test_rake_task_manager_argument_resolution.rb +0 -36
  166. data/test/test_rake_task_with_arguments.rb +0 -162
  167. data/test/test_rake_test_task.rb +0 -122
  168. data/test/test_rake_top_level_functions.rb +0 -76
  169. data/test/test_rake_win32.rb +0 -83
  170. data/test/test_sys.rb +0 -20
data/lib/rake/testtask.rb CHANGED
@@ -1,13 +1,13 @@
1
- # Define a task library for running unit tests.
2
-
3
- require 'rake'
4
- require 'rake/tasklib'
1
+ # frozen_string_literal: true
2
+ require "rake"
3
+ require "rake/tasklib"
5
4
 
6
5
  module Rake
7
6
 
8
7
  # Create a task that runs a set of tests.
9
8
  #
10
9
  # Example:
10
+ # require "rake/testtask"
11
11
  #
12
12
  # Rake::TestTask.new do |t|
13
13
  # t.libs << "test"
@@ -37,7 +37,7 @@ module Rake
37
37
  # Name of test task. (default is :test)
38
38
  attr_accessor :name
39
39
 
40
- # List of directories to added to $LOAD_PATH before running the
40
+ # List of directories added to $LOAD_PATH before running the
41
41
  # tests. (default is 'lib')
42
42
  attr_accessor :libs
43
43
 
@@ -51,6 +51,7 @@ module Rake
51
51
 
52
52
  # Request that the tests be run with the warning flag set.
53
53
  # E.g. warning=true implies "ruby -w" used to run the tests.
54
+ # (default is true)
54
55
  attr_accessor :warning
55
56
 
56
57
  # Glob pattern to match test files. (default is 'test/test*.rb')
@@ -64,9 +65,15 @@ module Rake
64
65
  #
65
66
  attr_accessor :loader
66
67
 
67
- # Array of commandline options to pass to ruby when running test loader.
68
+ # Array of command line options to pass to ruby when running test loader.
68
69
  attr_accessor :ruby_opts
69
70
 
71
+ # Description of the test task. (default is 'Run tests')
72
+ attr_accessor :description
73
+
74
+ # Task prerequisites.
75
+ attr_accessor :deps
76
+
70
77
  # Explicitly define the list of test files to be included in a
71
78
  # test. +list+ is expected to be an array of file names (a
72
79
  # FileList is acceptable). If both +pattern+ and +test_files+ are
@@ -83,108 +90,99 @@ module Rake
83
90
  @options = nil
84
91
  @test_files = nil
85
92
  @verbose = false
86
- @warning = false
93
+ @warning = true
87
94
  @loader = :rake
88
95
  @ruby_opts = []
96
+ @description = "Run tests" + (@name == :test ? "" : " for #{@name}")
97
+ @deps = []
98
+ if @name.is_a?(Hash)
99
+ @deps = @name.values.first
100
+ @name = @name.keys.first
101
+ end
89
102
  yield self if block_given?
90
- @pattern = 'test/test*.rb' if @pattern.nil? && @test_files.nil?
103
+ @pattern = "test/test*.rb" if @pattern.nil? && @test_files.nil?
91
104
  define
92
105
  end
93
106
 
94
107
  # Create the tasks defined by this task lib.
95
108
  def define
96
- desc "Run tests" + (@name==:test ? "" : " for #{@name}")
97
- task @name do
109
+ desc @description
110
+ task @name => Array(deps) do
98
111
  FileUtilsExt.verbose(@verbose) do
99
- ruby "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}"
112
+ puts "Use TESTOPTS=\"--verbose\" to pass --verbose" \
113
+ ", etc. to runners." if ARGV.include? "--verbose"
114
+ args =
115
+ "#{ruby_opts_string} #{run_code} " +
116
+ "#{file_list_string} #{option_list}"
117
+ ruby args do |ok, status|
118
+ if !ok && status.respond_to?(:signaled?) && status.signaled?
119
+ raise SignalException.new(status.termsig)
120
+ elsif !ok
121
+ status = "Command failed with status (#{status.exitstatus})"
122
+ details = ": [ruby #{args}]"
123
+ message =
124
+ if Rake.application.options.trace or @verbose
125
+ status + details
126
+ else
127
+ status
128
+ end
129
+
130
+ fail message
131
+ end
132
+ end
100
133
  end
101
134
  end
102
135
  self
103
136
  end
104
137
 
105
138
  def option_list # :nodoc:
106
- (ENV['TESTOPTS'] ||
107
- ENV['TESTOPT'] ||
108
- ENV['TEST_OPTS'] ||
109
- ENV['TEST_OPT'] ||
139
+ (ENV["TESTOPTS"] ||
140
+ ENV["TESTOPT"] ||
141
+ ENV["TEST_OPTS"] ||
142
+ ENV["TEST_OPT"] ||
110
143
  @options ||
111
144
  "")
112
145
  end
113
146
 
114
- def ruby_opts_string
147
+ def ruby_opts_string # :nodoc:
115
148
  opts = @ruby_opts.dup
116
- opts.unshift( "-I\"#{lib_path}\"" ) unless @libs.empty?
117
- opts.unshift( "-w" ) if @warning
149
+ opts.unshift("-I\"#{lib_path}\"") unless @libs.empty?
150
+ opts.unshift("-w") if @warning
118
151
  opts.join(" ")
119
152
  end
120
153
 
121
- def lib_path
154
+ def lib_path # :nodoc:
122
155
  @libs.join(File::PATH_SEPARATOR)
123
156
  end
124
157
 
125
- def file_list_string
126
- file_list.collect { |fn| "\"#{fn}\"" }.join(' ')
158
+ def file_list_string # :nodoc:
159
+ file_list.map { |fn| "\"#{fn}\"" }.join(" ")
127
160
  end
128
161
 
129
162
  def file_list # :nodoc:
130
- if ENV['TEST']
131
- FileList[ ENV['TEST'] ]
163
+ if ENV["TEST"]
164
+ FileList[ENV["TEST"]]
132
165
  else
133
166
  result = []
134
167
  result += @test_files.to_a if @test_files
135
- result << @pattern if @pattern
168
+ result += FileList[@pattern].to_a if @pattern
136
169
  result
137
170
  end
138
171
  end
139
172
 
140
- def fix # :nodoc:
141
- case ruby_version
142
- when '1.8.2'
143
- "\"#{find_file 'rake/ruby182_test_unit_fix'}\""
144
- else
145
- nil
146
- end || ''
147
- end
148
-
149
- def ruby_version
173
+ def ruby_version # :nodoc:
150
174
  RUBY_VERSION
151
175
  end
152
176
 
153
- def run_code
177
+ def run_code # :nodoc:
154
178
  case @loader
155
179
  when :direct
156
180
  "-e \"ARGV.each{|f| require f}\""
157
181
  when :testrb
158
- "-S testrb #{fix}"
182
+ "-S testrb"
159
183
  when :rake
160
- "-I\"#{rake_lib_dir}\" \"#{rake_loader}\""
161
- end
162
- end
163
-
164
- def rake_loader # :nodoc:
165
- find_file('rake/rake_test_loader') or
166
- fail "unable to find rake test loader"
167
- end
168
-
169
- def find_file(fn) # :nodoc:
170
- $LOAD_PATH.each do |path|
171
- file_path = File.join(path, "#{fn}.rb")
172
- return file_path if File.exist? file_path
173
- end
174
- nil
175
- end
176
-
177
- def rake_lib_dir # :nodoc:
178
- find_dir('rake') or
179
- fail "unable to find rake lib"
180
- end
181
-
182
- def find_dir(fn) # :nodoc:
183
- $LOAD_PATH.each do |path|
184
- file_path = File.join(path, "#{fn}.rb")
185
- return path if File.exist? file_path
184
+ "#{__dir__}/rake_test_loader.rb"
186
185
  end
187
- nil
188
186
  end
189
187
 
190
188
  end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ require "rake/private_reader"
3
+
4
+ module Rake
5
+
6
+ class ThreadHistoryDisplay # :nodoc: all
7
+ include Rake::PrivateReader
8
+
9
+ private_reader :stats, :items, :threads
10
+
11
+ def initialize(stats)
12
+ @stats = stats
13
+ @items = { _seq_: 1 }
14
+ @threads = { _seq_: "A" }
15
+ end
16
+
17
+ def show
18
+ puts "Job History:"
19
+ stats.each do |stat|
20
+ stat[:data] ||= {}
21
+ rename(stat, :thread, threads)
22
+ rename(stat[:data], :item_id, items)
23
+ rename(stat[:data], :new_thread, threads)
24
+ rename(stat[:data], :deleted_thread, threads)
25
+ printf("%8d %2s %-20s %s\n",
26
+ (stat[:time] * 1_000_000).round,
27
+ stat[:thread],
28
+ stat[:event],
29
+ stat[:data].map do |k, v| "#{k}:#{v}" end.join(" "))
30
+ end
31
+ end
32
+
33
+ private
34
+
35
+ def rename(hash, key, renames)
36
+ if hash && hash[key]
37
+ original = hash[key]
38
+ value = renames[original]
39
+ unless value
40
+ value = renames[:_seq_]
41
+ renames[:_seq_] = renames[:_seq_].succ
42
+ renames[original] = value
43
+ end
44
+ hash[key] = value
45
+ end
46
+ end
47
+ end
48
+
49
+ end
@@ -0,0 +1,163 @@
1
+ # frozen_string_literal: true
2
+ require "set"
3
+
4
+ require "rake/promise"
5
+
6
+ module Rake
7
+
8
+ class ThreadPool # :nodoc: all
9
+
10
+ # Creates a ThreadPool object. The +thread_count+ parameter is the size
11
+ # of the pool.
12
+ def initialize(thread_count)
13
+ @max_active_threads = [thread_count, 0].max
14
+ @threads = Set.new
15
+ @threads_mon = Monitor.new
16
+ @queue = Queue.new
17
+ @join_cond = @threads_mon.new_cond
18
+
19
+ @history_start_time = nil
20
+ @history = []
21
+ @history_mon = Monitor.new
22
+ @total_threads_in_play = 0
23
+ end
24
+
25
+ # Creates a future executed by the +ThreadPool+.
26
+ #
27
+ # The args are passed to the block when executing (similarly to
28
+ # Thread#new) The return value is an object representing
29
+ # a future which has been created and added to the queue in the
30
+ # pool. Sending #value to the object will sleep the
31
+ # current thread until the future is finished and will return the
32
+ # result (or raise an exception thrown from the future)
33
+ def future(*args, &block)
34
+ promise = Promise.new(args, &block)
35
+ promise.recorder = lambda { |*stats| stat(*stats) }
36
+
37
+ @queue.enq promise
38
+ stat :queued, item_id: promise.object_id
39
+ start_thread
40
+ promise
41
+ end
42
+
43
+ # Waits until the queue of futures is empty and all threads have exited.
44
+ def join
45
+ @threads_mon.synchronize do
46
+ begin
47
+ stat :joining
48
+ @join_cond.wait unless @threads.empty?
49
+ stat :joined
50
+ rescue Exception => e
51
+ stat :joined
52
+ $stderr.puts e
53
+ $stderr.print "Queue contains #{@queue.size} items. " +
54
+ "Thread pool contains #{@threads.count} threads\n"
55
+ $stderr.print "Current Thread #{Thread.current} status = " +
56
+ "#{Thread.current.status}\n"
57
+ $stderr.puts e.backtrace.join("\n")
58
+ @threads.each do |t|
59
+ $stderr.print "Thread #{t} status = #{t.status}\n"
60
+ $stderr.puts t.backtrace.join("\n")
61
+ end
62
+ raise e
63
+ end
64
+ end
65
+ end
66
+
67
+ # Enable the gathering of history events.
68
+ def gather_history #:nodoc:
69
+ @history_start_time = Time.now if @history_start_time.nil?
70
+ end
71
+
72
+ # Return a array of history events for the thread pool.
73
+ #
74
+ # History gathering must be enabled to be able to see the events
75
+ # (see #gather_history). Best to call this when the job is
76
+ # complete (i.e. after ThreadPool#join is called).
77
+ def history # :nodoc:
78
+ @history_mon.synchronize { @history.dup }.
79
+ sort_by { |i| i[:time] }.
80
+ each { |i| i[:time] -= @history_start_time }
81
+ end
82
+
83
+ # Return a hash of always collected statistics for the thread pool.
84
+ def statistics # :nodoc:
85
+ {
86
+ total_threads_in_play: @total_threads_in_play,
87
+ max_active_threads: @max_active_threads,
88
+ }
89
+ end
90
+
91
+ private
92
+
93
+ # processes one item on the queue. Returns true if there was an
94
+ # item to process, false if there was no item
95
+ def process_queue_item #:nodoc:
96
+ return false if @queue.empty?
97
+
98
+ # Even though we just asked if the queue was empty, it
99
+ # still could have had an item which by this statement
100
+ # is now gone. For this reason we pass true to Queue#deq
101
+ # because we will sleep indefinitely if it is empty.
102
+ promise = @queue.deq(true)
103
+ stat :dequeued, item_id: promise.object_id
104
+ promise.work
105
+ return true
106
+
107
+ rescue ThreadError # this means the queue is empty
108
+ false
109
+ end
110
+
111
+ def safe_thread_count
112
+ @threads_mon.synchronize do
113
+ @threads.count
114
+ end
115
+ end
116
+
117
+ def start_thread # :nodoc:
118
+ @threads_mon.synchronize do
119
+ next unless @threads.count < @max_active_threads
120
+
121
+ t = Thread.new do
122
+ begin
123
+ while safe_thread_count <= @max_active_threads
124
+ break unless process_queue_item
125
+ end
126
+ ensure
127
+ @threads_mon.synchronize do
128
+ @threads.delete Thread.current
129
+ stat :ended, thread_count: @threads.count
130
+ @join_cond.broadcast if @threads.empty?
131
+ end
132
+ end
133
+ end
134
+
135
+ @threads << t
136
+ stat(
137
+ :spawned,
138
+ new_thread: t.object_id,
139
+ thread_count: @threads.count)
140
+ @total_threads_in_play = @threads.count if
141
+ @threads.count > @total_threads_in_play
142
+ end
143
+ end
144
+
145
+ def stat(event, data=nil) # :nodoc:
146
+ return if @history_start_time.nil?
147
+ info = {
148
+ event: event,
149
+ data: data,
150
+ time: Time.now,
151
+ thread: Thread.current.object_id,
152
+ }
153
+ @history_mon.synchronize { @history << info }
154
+ end
155
+
156
+ # for testing only
157
+
158
+ def __queue__ # :nodoc:
159
+ @queue
160
+ end
161
+ end
162
+
163
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+ module Rake
3
+ module TraceOutput # :nodoc: all
4
+
5
+ # Write trace output to output stream +out+.
6
+ #
7
+ # The write is done as a single IO call (to print) to lessen the
8
+ # chance that the trace output is interrupted by other tasks also
9
+ # producing output.
10
+ def trace_on(out, *strings)
11
+ sep = $\ || "\n"
12
+ if strings.empty?
13
+ output = sep
14
+ else
15
+ output = strings.map { |s|
16
+ next if s.nil?
17
+ s.end_with?(sep) ? s : s + sep
18
+ }.join
19
+ end
20
+ out.print(output)
21
+ end
22
+ end
23
+ end
data/lib/rake/version.rb CHANGED
@@ -1,10 +1,10 @@
1
+ # frozen_string_literal: true
1
2
  module Rake
2
- module Version
3
- NUMBERS = [
4
- MAJOR = 0,
5
- MINOR = 9,
6
- BUILD = 2,
7
- ]
3
+ VERSION = "13.0.3"
4
+
5
+ module Version # :nodoc: all
6
+ MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "."
7
+
8
+ NUMBERS = [MAJOR, MINOR, BUILD, *OTHER]
8
9
  end
9
- VERSION = Version::NUMBERS.join('.')
10
10
  end