rake 10.4.2 → 13.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +5 -5
  2. data/CONTRIBUTING.rdoc +16 -7
  3. data/Gemfile +10 -0
  4. data/History.rdoc +2022 -287
  5. data/README.rdoc +40 -25
  6. data/Rakefile +25 -65
  7. data/bin/bundle +105 -0
  8. data/bin/console +7 -0
  9. data/bin/rake +20 -24
  10. data/bin/rdoc +29 -0
  11. data/bin/rubocop +29 -0
  12. data/bin/setup +6 -0
  13. data/doc/glossary.rdoc +10 -11
  14. data/doc/jamis.rb +1 -0
  15. data/doc/rake.1 +139 -124
  16. data/doc/rakefile.rdoc +2 -33
  17. data/exe/rake +27 -0
  18. data/lib/rake.rb +35 -43
  19. data/lib/rake/application.rb +125 -91
  20. data/lib/rake/backtrace.rb +3 -2
  21. data/lib/rake/clean.rb +8 -6
  22. data/lib/rake/cloneable.rb +1 -0
  23. data/lib/rake/cpu_counter.rb +10 -28
  24. data/lib/rake/default_loader.rb +1 -0
  25. data/lib/rake/dsl_definition.rb +6 -12
  26. data/lib/rake/early_time.rb +1 -0
  27. data/lib/rake/ext/core.rb +1 -0
  28. data/lib/rake/ext/string.rb +24 -21
  29. data/lib/rake/file_creation_task.rb +4 -3
  30. data/lib/rake/file_list.rb +35 -28
  31. data/lib/rake/file_task.rb +12 -4
  32. data/lib/rake/file_utils.rb +38 -32
  33. data/lib/rake/file_utils_ext.rb +8 -18
  34. data/lib/rake/invocation_chain.rb +1 -0
  35. data/lib/rake/invocation_exception_mixin.rb +1 -0
  36. data/lib/rake/late_time.rb +2 -1
  37. data/lib/rake/linked_list.rb +24 -15
  38. data/lib/rake/loaders/makefile.rb +23 -9
  39. data/lib/rake/multi_task.rb +2 -1
  40. data/lib/rake/name_space.rb +1 -1
  41. data/lib/rake/packagetask.rb +40 -17
  42. data/lib/rake/phony.rb +2 -1
  43. data/lib/rake/private_reader.rb +1 -0
  44. data/lib/rake/promise.rb +13 -12
  45. data/lib/rake/pseudo_status.rb +1 -0
  46. data/lib/rake/rake_module.rb +30 -1
  47. data/lib/rake/rake_test_loader.rb +18 -13
  48. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  49. data/lib/rake/scope.rb +3 -2
  50. data/lib/rake/task.rb +82 -31
  51. data/lib/rake/task_argument_error.rb +1 -0
  52. data/lib/rake/task_arguments.rb +15 -4
  53. data/lib/rake/task_manager.rb +54 -33
  54. data/lib/rake/tasklib.rb +2 -14
  55. data/lib/rake/testtask.rb +40 -63
  56. data/lib/rake/thread_history_display.rb +4 -3
  57. data/lib/rake/thread_pool.rb +16 -17
  58. data/lib/rake/trace_output.rb +2 -1
  59. data/lib/rake/version.rb +4 -1
  60. data/lib/rake/win32.rb +10 -15
  61. data/rake.gemspec +43 -0
  62. metadata +33 -270
  63. data/.autotest +0 -7
  64. data/.gemtest +0 -0
  65. data/.rubocop.yml +0 -27
  66. data/.togglerc +0 -7
  67. data/Manifest.txt +0 -166
  68. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  69. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  70. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  71. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  72. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  73. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  74. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  75. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  76. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  77. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  78. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  79. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  80. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  81. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  82. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  83. data/doc/release_notes/rake-0.8.6.rdoc +0 -37
  84. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  85. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  86. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  87. data/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
  88. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  89. data/doc/release_notes/rake-0.9.3.rdoc +0 -102
  90. data/doc/release_notes/rake-0.9.4.rdoc +0 -60
  91. data/doc/release_notes/rake-0.9.5.rdoc +0 -55
  92. data/doc/release_notes/rake-0.9.6.rdoc +0 -64
  93. data/doc/release_notes/rake-10.0.0.rdoc +0 -178
  94. data/doc/release_notes/rake-10.0.1.rdoc +0 -58
  95. data/doc/release_notes/rake-10.0.2.rdoc +0 -53
  96. data/doc/release_notes/rake-10.0.3.rdoc +0 -191
  97. data/doc/release_notes/rake-10.1.0.rdoc +0 -61
  98. data/lib/rake/alt_system.rb +0 -110
  99. data/lib/rake/contrib/.document +0 -1
  100. data/lib/rake/contrib/compositepublisher.rb +0 -21
  101. data/lib/rake/contrib/ftptools.rb +0 -137
  102. data/lib/rake/contrib/publisher.rb +0 -81
  103. data/lib/rake/contrib/rubyforgepublisher.rb +0 -18
  104. data/lib/rake/contrib/sshpublisher.rb +0 -61
  105. data/lib/rake/contrib/sys.rb +0 -4
  106. data/lib/rake/ext/module.rb +0 -2
  107. data/lib/rake/ext/pathname.rb +0 -25
  108. data/lib/rake/ext/time.rb +0 -16
  109. data/lib/rake/gempackagetask.rb +0 -4
  110. data/lib/rake/pathmap.rb +0 -3
  111. data/lib/rake/rdoctask.rb +0 -4
  112. data/lib/rake/ruby182_test_unit_fix.rb +0 -29
  113. data/lib/rake/runtest.rb +0 -27
  114. data/rakelib/publish.rake +0 -20
  115. data/rakelib/test_times.rake +0 -25
  116. data/test/file_creation.rb +0 -34
  117. data/test/helper.rb +0 -130
  118. data/test/support/rakefile_definitions.rb +0 -478
  119. data/test/support/ruby_runner.rb +0 -34
  120. data/test/test_private_reader.rb +0 -42
  121. data/test/test_rake.rb +0 -40
  122. data/test/test_rake_application.rb +0 -643
  123. data/test/test_rake_application_options.rb +0 -466
  124. data/test/test_rake_backtrace.rb +0 -119
  125. data/test/test_rake_clean.rb +0 -61
  126. data/test/test_rake_cpu_counter.rb +0 -68
  127. data/test/test_rake_definitions.rb +0 -84
  128. data/test/test_rake_directory_task.rb +0 -76
  129. data/test/test_rake_dsl.rb +0 -40
  130. data/test/test_rake_early_time.rb +0 -31
  131. data/test/test_rake_extension.rb +0 -59
  132. data/test/test_rake_file_creation_task.rb +0 -56
  133. data/test/test_rake_file_list.rb +0 -655
  134. data/test/test_rake_file_list_path_map.rb +0 -8
  135. data/test/test_rake_file_task.rb +0 -197
  136. data/test/test_rake_file_utils.rb +0 -309
  137. data/test/test_rake_ftp_file.rb +0 -74
  138. data/test/test_rake_functional.rb +0 -482
  139. data/test/test_rake_invocation_chain.rb +0 -64
  140. data/test/test_rake_late_time.rb +0 -18
  141. data/test/test_rake_linked_list.rb +0 -84
  142. data/test/test_rake_makefile_loader.rb +0 -46
  143. data/test/test_rake_multi_task.rb +0 -64
  144. data/test/test_rake_name_space.rb +0 -57
  145. data/test/test_rake_package_task.rb +0 -79
  146. data/test/test_rake_path_map.rb +0 -168
  147. data/test/test_rake_path_map_explode.rb +0 -34
  148. data/test/test_rake_path_map_partial.rb +0 -18
  149. data/test/test_rake_pathname_extensions.rb +0 -15
  150. data/test/test_rake_pseudo_status.rb +0 -21
  151. data/test/test_rake_rake_test_loader.rb +0 -20
  152. data/test/test_rake_reduce_compat.rb +0 -26
  153. data/test/test_rake_require.rb +0 -40
  154. data/test/test_rake_rules.rb +0 -388
  155. data/test/test_rake_scope.rb +0 -44
  156. data/test/test_rake_task.rb +0 -393
  157. data/test/test_rake_task_argument_parsing.rb +0 -119
  158. data/test/test_rake_task_arguments.rb +0 -127
  159. data/test/test_rake_task_lib.rb +0 -9
  160. data/test/test_rake_task_manager.rb +0 -178
  161. data/test/test_rake_task_manager_argument_resolution.rb +0 -19
  162. data/test/test_rake_task_with_arguments.rb +0 -172
  163. data/test/test_rake_test_task.rb +0 -146
  164. data/test/test_rake_thread_pool.rb +0 -145
  165. data/test/test_rake_top_level_functions.rb +0 -71
  166. data/test/test_rake_win32.rb +0 -72
  167. data/test/test_thread_history_display.rb +0 -101
  168. data/test/test_trace_output.rb +0 -52
@@ -1,8 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
-
3
- class TestRakeFileListPathMap < Rake::TestCase
4
- def test_file_list_supports_pathmap
5
- assert_equal ['a', 'b'], FileList['dir/a.rb', 'dir/b.rb'].pathmap("%n")
6
- end
7
- end
8
-
@@ -1,197 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
- require 'fileutils'
3
- require 'pathname'
4
-
5
- class TestRakeFileTask < Rake::TestCase
6
- include Rake
7
-
8
- def setup
9
- super
10
-
11
- Task.clear
12
- @runs = Array.new
13
- FileUtils.rm_f NEWFILE
14
- FileUtils.rm_f OLDFILE
15
- end
16
-
17
- def test_file_need
18
- name = "dummy"
19
- file name
20
-
21
- ftask = Task[name]
22
-
23
- assert_equal name.to_s, ftask.name
24
- File.delete(ftask.name) rescue nil
25
-
26
- assert ftask.needed?, "file should be needed"
27
- assert_equal Rake::LATE, ftask.timestamp
28
-
29
- open(ftask.name, "w") { |f| f.puts "HI" }
30
-
31
- assert_equal nil, ftask.prerequisites.map { |n| Task[n].timestamp }.max
32
- assert ! ftask.needed?, "file should not be needed"
33
- ensure
34
- File.delete(ftask.name) rescue nil
35
- end
36
-
37
- def test_file_times_new_depends_on_old
38
- create_timed_files(OLDFILE, NEWFILE)
39
-
40
- t1 = Rake.application.intern(FileTask, NEWFILE).enhance([OLDFILE])
41
- t2 = Rake.application.intern(FileTask, OLDFILE)
42
- assert ! t2.needed?, "Should not need to build old file"
43
- assert ! t1.needed?, "Should not need to rebuild new file because of old"
44
- end
45
-
46
- def test_file_times_new_depend_on_regular_task_timestamps
47
- load_phony
48
-
49
- name = "dummy"
50
- task name
51
-
52
- create_timed_files(NEWFILE)
53
-
54
- t1 = Rake.application.intern(FileTask, NEWFILE).enhance([name])
55
-
56
- assert t1.needed?, "depending on non-file task uses Time.now"
57
-
58
- task(name => :phony)
59
-
60
- assert t1.needed?, "unless the non-file task has a timestamp"
61
- end
62
-
63
- def test_file_times_old_depends_on_new
64
- create_timed_files(OLDFILE, NEWFILE)
65
-
66
- t1 = Rake.application.intern(FileTask, OLDFILE).enhance([NEWFILE])
67
- t2 = Rake.application.intern(FileTask, NEWFILE)
68
- assert ! t2.needed?, "Should not need to build new file"
69
- preq_stamp = t1.prerequisites.map { |t| Task[t].timestamp }.max
70
- assert_equal t2.timestamp, preq_stamp
71
- assert t1.timestamp < preq_stamp, "T1 should be older"
72
- assert t1.needed?, "Should need to rebuild old file because of new"
73
- end
74
-
75
- def test_file_depends_on_task_depend_on_file
76
- create_timed_files(OLDFILE, NEWFILE)
77
-
78
- file NEWFILE => [:obj] do |t| @runs << t.name end
79
- task :obj => [OLDFILE] do |t| @runs << t.name end
80
- file OLDFILE do |t| @runs << t.name end
81
-
82
- Task[:obj].invoke
83
- Task[NEWFILE].invoke
84
- assert @runs.include?(NEWFILE)
85
- end
86
-
87
- def test_existing_file_depends_on_non_existing_file
88
- create_file(OLDFILE)
89
- delete_file(NEWFILE)
90
- file NEWFILE do |t| @runs << t.name end
91
- file OLDFILE => NEWFILE do |t| @runs << t.name end
92
-
93
- Task[OLDFILE].invoke
94
-
95
- assert_equal [NEWFILE, OLDFILE], @runs
96
- end
97
-
98
- def test_needed_eh_build_all
99
- create_file 'a'
100
-
101
- file 'a'
102
-
103
- a_task = Task['a']
104
-
105
- refute a_task.needed?
106
-
107
- Rake.application.options.build_all = true
108
-
109
- assert a_task.needed?
110
- ensure
111
- delete_file 'a'
112
- end
113
-
114
- def test_needed_eh_dependency
115
- create_file 'a', Time.now
116
- create_file 'b', Time.now - 60
117
-
118
- create_file 'c', Time.now
119
- create_file 'd', Time.now - 60
120
-
121
- file 'b' => 'a'
122
-
123
- b_task = Task['b']
124
-
125
- assert b_task.needed?
126
-
127
- file 'c' => 'd'
128
-
129
- c_task = Task['c']
130
-
131
- refute c_task.needed?
132
- ensure
133
- delete_file 'old'
134
- delete_file 'new'
135
- end
136
-
137
- def test_needed_eh_exists
138
- name = "dummy"
139
- file name
140
-
141
- ftask = Task[name]
142
-
143
- assert ftask.needed?
144
-
145
- create_file name
146
-
147
- refute ftask.needed?
148
- ensure
149
- delete_file name
150
- end
151
-
152
- def test_source_is_first_prerequisite
153
- t = file :f => ["preqA", "preqB"]
154
- assert_equal "preqA", t.source
155
- end
156
-
157
- def test_sources_is_all_prerequisites
158
- t = file :f => ["preqA", "preqB"]
159
- assert_equal ["preqA", "preqB"], t.sources
160
- end
161
-
162
- def test_task_can_be_pathname
163
- name = "dummy"
164
- file Pathname.new name
165
-
166
- ftask = Task[name]
167
-
168
- assert_equal name.to_s, ftask.name
169
- end
170
-
171
- def test_prerequisite_can_be_pathname
172
- t = file :f => Pathname.new("preq")
173
- assert_equal "preq", t.source
174
- end
175
-
176
- # I have currently disabled this test. I'm not convinced that
177
- # deleting the file target on failure is always the proper thing to
178
- # do. I'm willing to hear input on this topic.
179
- def ztest_file_deletes_on_failure
180
- task :obj
181
- file NEWFILE => [:obj] do |t|
182
- FileUtils.touch NEWFILE
183
- fail "Ooops"
184
- end
185
- assert Task[NEWFILE]
186
- begin
187
- Task[NEWFILE].invoke
188
- rescue Exception
189
- end
190
- assert(! File.exist?(NEWFILE), "NEWFILE should be deleted")
191
- end
192
-
193
- def load_phony
194
- load File.join(@rake_lib, "rake/phony.rb")
195
- end
196
-
197
- end
@@ -1,309 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
- require 'fileutils'
3
- require 'stringio'
4
-
5
- class TestRakeFileUtils < Rake::TestCase
6
-
7
- def teardown
8
- FileUtils::LN_SUPPORTED[0] = true
9
- RakeFileUtils.verbose_flag = Rake::FileUtilsExt::DEFAULT
10
-
11
- super
12
- end
13
-
14
- def test_rm_one_file
15
- create_file("a")
16
- FileUtils.rm_rf "a"
17
- refute File.exist?("a")
18
- end
19
-
20
- def test_rm_two_files
21
- create_file("a")
22
- create_file("b")
23
- FileUtils.rm_rf ["a", "b"]
24
- refute File.exist?("a")
25
- refute File.exist?("b")
26
- end
27
-
28
- def test_rm_filelist
29
- list = Rake::FileList.new << "a" << "b"
30
- list.each { |fn| create_file(fn) }
31
- FileUtils.rm_r list
32
- refute File.exist?("a")
33
- refute File.exist?("b")
34
- end
35
-
36
- def test_ln
37
- open("a", "w") { |f| f.puts "TEST_LN" }
38
-
39
- Rake::FileUtilsExt.safe_ln("a", "b", :verbose => false)
40
-
41
- assert_equal "TEST_LN\n", File.read('b')
42
- end
43
-
44
- class BadLink
45
- include Rake::FileUtilsExt
46
- attr_reader :cp_args
47
-
48
- def initialize(klass)
49
- @failure_class = klass
50
- end
51
-
52
- def cp(*args)
53
- @cp_args = args
54
- end
55
-
56
- def ln(*args)
57
- fail @failure_class, "ln not supported"
58
- end
59
-
60
- public :safe_ln
61
- end
62
-
63
- def test_safe_ln_failover_to_cp_on_standard_error
64
- FileUtils::LN_SUPPORTED[0] = true
65
- c = BadLink.new(StandardError)
66
- c.safe_ln "a", "b"
67
- assert_equal ['a', 'b'], c.cp_args
68
- c.safe_ln "x", "y"
69
- assert_equal ['x', 'y'], c.cp_args
70
- end
71
-
72
- def test_safe_ln_failover_to_cp_on_not_implemented_error
73
- FileUtils::LN_SUPPORTED[0] = true
74
- c = BadLink.new(NotImplementedError)
75
- c.safe_ln "a", "b"
76
- assert_equal ['a', 'b'], c.cp_args
77
- end
78
-
79
- def test_safe_ln_fails_on_script_error
80
- FileUtils::LN_SUPPORTED[0] = true
81
- c = BadLink.new(ScriptError)
82
- assert_raises(ScriptError) do c.safe_ln "a", "b" end
83
- end
84
-
85
- def test_verbose
86
- verbose true
87
- assert_equal true, verbose
88
- verbose false
89
- assert_equal false, verbose
90
- verbose(true) {
91
- assert_equal true, verbose
92
- }
93
- assert_equal false, verbose
94
- end
95
-
96
- def test_nowrite
97
- nowrite true
98
- assert_equal true, nowrite
99
- nowrite false
100
- assert_equal false, nowrite
101
- nowrite(true) {
102
- assert_equal true, nowrite
103
- }
104
- assert_equal false, nowrite
105
- end
106
-
107
- def test_file_utils_methods_are_available_at_top_level
108
- create_file("a")
109
-
110
- capture_io do
111
- rm_rf "a"
112
- end
113
-
114
- refute File.exist?("a")
115
- end
116
-
117
- def test_fileutils_methods_dont_leak
118
- obj = Object.new
119
- assert_raises(NoMethodError) { obj.copy } # from FileUtils
120
- assert_raises(NoMethodError) { obj.ruby "-v" } # from RubyFileUtils
121
- end
122
-
123
- def test_sh
124
- shellcommand
125
-
126
- verbose(false) { sh %{#{Rake::TestCase::RUBY} shellcommand.rb} }
127
- assert true, "should not fail"
128
- end
129
-
130
- def test_sh_with_a_single_string_argument
131
- check_expansion
132
-
133
- ENV['RAKE_TEST_SH'] = 'someval'
134
- verbose(false) {
135
- sh %{#{RUBY} check_expansion.rb #{env_var} someval}
136
- }
137
- end
138
-
139
- def test_sh_with_multiple_arguments
140
- check_no_expansion
141
- ENV['RAKE_TEST_SH'] = 'someval'
142
-
143
- verbose(false) {
144
- sh RUBY, 'check_no_expansion.rb', env_var, 'someval'
145
- }
146
- end
147
-
148
- def test_sh_failure
149
- shellcommand
150
-
151
- assert_raises(RuntimeError) {
152
- verbose(false) { sh %{#{RUBY} shellcommand.rb 1} }
153
- }
154
- end
155
-
156
- def test_sh_special_handling
157
- shellcommand
158
-
159
- count = 0
160
- verbose(false) {
161
- sh(%{#{RUBY} shellcommand.rb}) do |ok, res|
162
- assert(ok)
163
- assert_equal 0, res.exitstatus
164
- count += 1
165
- end
166
- sh(%{#{RUBY} shellcommand.rb 1}) do |ok, res|
167
- assert(!ok)
168
- assert_equal 1, res.exitstatus
169
- count += 1
170
- end
171
- }
172
- assert_equal 2, count, "Block count should be 2"
173
- end
174
-
175
- def test_sh_noop
176
- shellcommand
177
-
178
- verbose(false) { sh %{shellcommand.rb 1}, :noop=>true }
179
- assert true, "should not fail"
180
- end
181
-
182
- def test_sh_bad_option
183
- shellcommand
184
-
185
- ex = assert_raises(ArgumentError) {
186
- verbose(false) { sh %{shellcommand.rb}, :bad_option=>true }
187
- }
188
- assert_match(/bad_option/, ex.message)
189
- end
190
-
191
- def test_sh_verbose
192
- shellcommand
193
-
194
- _, err = capture_io do
195
- verbose(true) {
196
- sh %{shellcommand.rb}, :noop=>true
197
- }
198
- end
199
-
200
- assert_equal "shellcommand.rb\n", err
201
- end
202
-
203
- def test_sh_verbose_false
204
- shellcommand
205
-
206
- _, err = capture_io do
207
- verbose(false) {
208
- sh %{shellcommand.rb}, :noop=>true
209
- }
210
- end
211
-
212
- assert_equal '', err
213
- end
214
-
215
- def test_sh_verbose_flag_nil
216
- shellcommand
217
-
218
- RakeFileUtils.verbose_flag = nil
219
-
220
- assert_silent do
221
- sh %{shellcommand.rb}, :noop=>true
222
- end
223
- end
224
-
225
- def test_ruby_with_a_single_string_argument
226
- check_expansion
227
-
228
- ENV['RAKE_TEST_SH'] = 'someval'
229
-
230
- verbose(false) {
231
- replace_ruby {
232
- ruby %{check_expansion.rb #{env_var} someval}
233
- }
234
- }
235
- end
236
-
237
- def test_ruby_with_multiple_arguments
238
- check_no_expansion
239
-
240
- ENV['RAKE_TEST_SH'] = 'someval'
241
- verbose(false) {
242
- replace_ruby {
243
- ruby 'check_no_expansion.rb', env_var, 'someval'
244
- }
245
- }
246
- end
247
-
248
- def test_split_all
249
- assert_equal ['a'], Rake::FileUtilsExt.split_all('a')
250
- assert_equal ['..'], Rake::FileUtilsExt.split_all('..')
251
- assert_equal ['/'], Rake::FileUtilsExt.split_all('/')
252
- assert_equal ['a', 'b'], Rake::FileUtilsExt.split_all('a/b')
253
- assert_equal ['/', 'a', 'b'], Rake::FileUtilsExt.split_all('/a/b')
254
- assert_equal ['..', 'a', 'b'], Rake::FileUtilsExt.split_all('../a/b')
255
- end
256
-
257
- def command(name, text)
258
- open name, 'w', 0750 do |io|
259
- io << text
260
- end
261
- end
262
-
263
- def check_no_expansion
264
- command 'check_no_expansion.rb', <<-CHECK_EXPANSION
265
- if ARGV[0] != ARGV[1]
266
- exit 0
267
- else
268
- exit 1
269
- end
270
- CHECK_EXPANSION
271
- end
272
-
273
- def check_expansion
274
- command 'check_expansion.rb', <<-CHECK_EXPANSION
275
- if ARGV[0] != ARGV[1]
276
- exit 1
277
- else
278
- exit 0
279
- end
280
- CHECK_EXPANSION
281
- end
282
-
283
- def replace_ruby
284
- ruby = FileUtils::RUBY
285
- FileUtils.send :remove_const, :RUBY
286
- FileUtils.const_set :RUBY, RUBY
287
- yield
288
- ensure
289
- FileUtils.send :remove_const, :RUBY
290
- FileUtils.const_set:RUBY, ruby
291
- end
292
-
293
- def shellcommand
294
- command 'shellcommand.rb', <<-SHELLCOMMAND
295
- #!/usr/bin/env ruby
296
-
297
- exit((ARGV[0] || "0").to_i)
298
- SHELLCOMMAND
299
- end
300
-
301
- def env_var
302
- windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH'
303
- end
304
-
305
- def windows?
306
- ! File::ALT_SEPARATOR.nil?
307
- end
308
-
309
- end