rant 0.4.6 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL +44 -0
- data/NEWS +30 -0
- data/README +6 -46
- data/Rantfile +38 -7
- data/doc/c.rdoc +2 -0
- data/doc/command.rdoc +210 -0
- data/doc/examples/c_dependencies/Rantfile +1 -1
- data/doc/examples/directedrule/Rantfile +1 -1
- data/doc/homepage/index.html +12 -1
- data/doc/rant-import.rdoc +5 -0
- data/doc/rant_vs_rake.rdoc +107 -0
- data/doc/rantfile.rdoc +17 -17
- data/doc/rubyproject.rdoc +45 -45
- data/doc/subdirs.rdoc +1 -1
- data/lib/rant/coregen.rb +62 -22
- data/lib/rant/import/archive.rb +1 -0
- data/lib/rant/import/command.rb +206 -0
- data/lib/rant/import/nodes/default.rb +12 -6
- data/lib/rant/import/nodes/signed.rb +3 -3
- data/lib/rant/import/signedfile.rb +14 -15
- data/lib/rant/import/win32/rubycmdwrapper.rb +1 -0
- data/lib/rant/import.rb +52 -4
- data/lib/rant/metautils.rb +119 -0
- data/lib/rant/node.rb +11 -2
- data/lib/rant/rantenv.rb +5 -2
- data/lib/rant/rantlib.rb +30 -46
- data/lib/rant/rantsys.rb +81 -13
- data/lib/rant/rantvar.rb +1 -76
- data/lib/rant.rb +2 -2
- data/misc/TODO +21 -0
- data/test/deprecated/test_0_5_2.rb +28 -0
- data/test/deprecated/test_0_6_0.rb +24 -0
- data/test/dyn_dependencies.rf +25 -0
- data/test/import/command/Rantfile +102 -0
- data/test/import/command/test_command.rb +597 -0
- data/test/rant-import/test_rant-import.rb +23 -1
- data/test/rule.rf +2 -0
- data/test/test_dyn_dependencies.rb +45 -0
- data/test/test_env.rb +5 -4
- data/test/test_filelist.rb +60 -3
- data/test/test_rant_interface.rb +5 -0
- data/test/test_sys.rb +53 -2
- data/test/tutil.rb +14 -6
- metadata +17 -6
- data/test/deprecated/test_0_4_8.rb +0 -41
data/test/test_env.rb
CHANGED
@@ -13,16 +13,17 @@ class TestRantEnv < Test::Unit::TestCase
|
|
13
13
|
end
|
14
14
|
def test_on_windows
|
15
15
|
# rather primitive test, but should catch obvious programming
|
16
|
-
# errors when making changes
|
16
|
+
# errors when making changes when in hurry ;)
|
17
17
|
if Rant::Env.on_windows?
|
18
18
|
assert(File::ALT_SEPARATOR,
|
19
19
|
"Env says we're on windows, but there is no ALT_SEPARATOR")
|
20
20
|
end
|
21
21
|
end
|
22
22
|
def test_find_bin
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
# not required since Rant 0.4.7
|
24
|
+
#assert(Rant::Env.find_bin(Rant::Env::RUBY),
|
25
|
+
# "RUBY_INSTALL_NAME should be found by Env.find_bin, " +
|
26
|
+
# "doesn't need to be a bug of Rant")
|
26
27
|
# let's check for the `echo' command which should be on most
|
27
28
|
# systems:
|
28
29
|
have_echo = false
|
data/test/test_filelist.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
|
2
2
|
require 'test/unit'
|
3
|
-
require 'rant/rantlib'
|
4
|
-
require 'fileutils'
|
5
3
|
require 'tutil'
|
6
4
|
|
7
5
|
$testDir ||= File.expand_path(File.dirname(__FILE__))
|
8
6
|
|
9
7
|
class TestFileList < Test::Unit::TestCase
|
8
|
+
include Rant::TestUtil
|
9
|
+
|
10
10
|
def fl(*args, &block)
|
11
11
|
Rant::FileList.new(*args, &block)
|
12
12
|
end
|
@@ -421,7 +421,64 @@ if Rant::Env.on_windows?
|
|
421
421
|
else
|
422
422
|
def test_to_s_quoting_spaces
|
423
423
|
cx = Rant::RantApp.new.cx
|
424
|
-
|
424
|
+
# changed in 0.4.7
|
425
|
+
#assert_equal("'a a' b", "#{cx.sys[].concat(["a a", "b"])}")
|
426
|
+
assert_equal("a\\ a b", "#{cx.sys[].concat(["a a", "b"])}")
|
425
427
|
end
|
426
428
|
end
|
429
|
+
def test_dotfiles
|
430
|
+
in_local_temp_dir do
|
431
|
+
Rant::Sys.touch %w(a.t .a.t)
|
432
|
+
Rant::Sys.mkdir %w(d.t .d.t)
|
433
|
+
Rant::Sys.touch %w(d.t/a.t d.t/.a.t)
|
434
|
+
Rant::Sys.touch %w(.d.t/a.t .d.t/.a.t)
|
435
|
+
Rant::Sys.mkdir %w(d.t/d.t)
|
436
|
+
Rant::Sys.touch %w(d.t/d.t/a.t d.t/d.t/.a.t)
|
437
|
+
cx = Rant::RantApp.new.cx
|
438
|
+
files = cx.sys["**/*.t"]
|
439
|
+
%w(a.t d.t d.t/a.t d.t/d.t d.t/d.t/a.t).each { |fn|
|
440
|
+
assert files.include?(fn), "#{fn} missing"
|
441
|
+
}
|
442
|
+
#p files.sort.to_a
|
443
|
+
assert_equal 5, files.size
|
444
|
+
files = cx.sys.glob_all "**/*.t"
|
445
|
+
%w(a.t .a.t d.t .d.t d.t/a.t d.t/.a.t .d.t/a.t .d.t/.a.t d.t/d.t d.t/d.t/a.t d.t/d.t/.a.t).each { |fn|
|
446
|
+
assert files.include?(fn), "#{fn} missing"
|
447
|
+
}
|
448
|
+
assert_equal 11, files.size
|
449
|
+
files = cx.sys.glob_all("**/*.t").exclude(".a.*")
|
450
|
+
%w(a.t d.t .d.t d.t/a.t d.t/.a.t .d.t/a.t .d.t/.a.t d.t/d.t d.t/d.t/a.t d.t/d.t/.a.t).each { |fn|
|
451
|
+
assert files.include?(fn), "#{fn} missing"
|
452
|
+
}
|
453
|
+
assert_equal 10, files.size
|
454
|
+
files = cx.sys.glob_all("**/*.t").shun(".d.t")
|
455
|
+
%w(a.t .a.t d.t d.t/a.t d.t/.a.t d.t/d.t d.t/d.t/a.t d.t/d.t/.a.t).each { |fn|
|
456
|
+
assert files.include?(fn), "#{fn} missing"
|
457
|
+
}
|
458
|
+
assert_equal 8, files.size
|
459
|
+
files.include("**/*.t").uniq!
|
460
|
+
%w(a.t .a.t d.t d.t/a.t d.t/.a.t d.t/d.t d.t/d.t/a.t d.t/d.t/.a.t).each { |fn|
|
461
|
+
assert files.include?(fn), "#{fn} missing"
|
462
|
+
}
|
463
|
+
assert_equal 11, files.size
|
464
|
+
# redundant, just to emphasize
|
465
|
+
assert !files.include?(".")
|
466
|
+
assert !files.include?("..")
|
467
|
+
assert !files.include?("d.t/.")
|
468
|
+
assert !files.include?("d.t/..")
|
469
|
+
assert !files.include?(".d.t/.")
|
470
|
+
assert !files.include?(".d.t/..")
|
471
|
+
end
|
472
|
+
end
|
473
|
+
def test_dotdirs
|
474
|
+
in_local_temp_dir do
|
475
|
+
cx = Rant::RantApp.new.cx
|
476
|
+
Rant::Sys.mkdir ["d", ".d", "d/d", "d/.d", ".d/.d", ".d/d", "d/.d/d"]
|
477
|
+
files = cx.sys["**/*"]
|
478
|
+
%w(d d/d).each { |fn|
|
479
|
+
files.include?(fn)
|
480
|
+
}
|
481
|
+
assert_equal 2, files.size
|
482
|
+
end
|
483
|
+
end
|
427
484
|
end
|
data/test/test_rant_interface.rb
CHANGED
@@ -87,4 +87,9 @@ class TestRantInterface < Test::Unit::TestCase
|
|
87
87
|
assert lines.size < 3
|
88
88
|
assert_match(/\[ERROR\].*option.*\bnix\b/, lines.first)
|
89
89
|
end
|
90
|
+
def test_opt_rantfile_no_such_file
|
91
|
+
out, err = assert_rant :fail, "-fdoesnt_exist.rf"
|
92
|
+
assert out.empty?
|
93
|
+
assert err =~ /\bdoesnt_exist\.rf\b/
|
94
|
+
end
|
90
95
|
end
|
data/test/test_sys.rb
CHANGED
@@ -162,7 +162,7 @@ class TestSys < Test::Unit::TestCase
|
|
162
162
|
end
|
163
163
|
# ...
|
164
164
|
def test_standalone
|
165
|
-
out = `#{Rant::Sys.sp(Rant::Env::
|
165
|
+
out = `#{Rant::Sys.sp(Rant::Env::RUBY_EXE)} -I#{Rant::Sys.sp(RANT_DEV_LIB_DIR)} standalone.rf`
|
166
166
|
assert_exit
|
167
167
|
assert_match(/^t_standalone/, out)
|
168
168
|
end
|
@@ -193,7 +193,7 @@ class TestSys < Test::Unit::TestCase
|
|
193
193
|
open "rf.t", "w" do |f|
|
194
194
|
f << <<-EOF
|
195
195
|
task :rbexit1_block do
|
196
|
-
sys Env::
|
196
|
+
sys Env::RUBY_EXE, "exit_1.t" do |status|
|
197
197
|
puts "no success" if status != 0
|
198
198
|
puts status.exitstatus
|
199
199
|
end
|
@@ -210,4 +210,55 @@ class TestSys < Test::Unit::TestCase
|
|
210
210
|
ensure
|
211
211
|
FileUtils.rm_f %w(exit_1.t rf.t)
|
212
212
|
end
|
213
|
+
def test_escape
|
214
|
+
assert_equal "abc", Rant::Sys.escape("abc")
|
215
|
+
assert_equal "", Rant::Sys.escape("")
|
216
|
+
# might change
|
217
|
+
assert_equal "", Rant::Sys.escape(nil)
|
218
|
+
if Rant::Env.on_windows?
|
219
|
+
assert_equal '"a b"', Rant::Sys.escape("a b")
|
220
|
+
assert_equal '" "', Rant::Sys.escape(" ")
|
221
|
+
assert_equal '" a b "', Rant::Sys.escape(" a b ")
|
222
|
+
o = Object.new
|
223
|
+
def o.to_s; "to s"; end
|
224
|
+
assert_equal '"to s"', Rant::Sys.escape(o)
|
225
|
+
else
|
226
|
+
assert_equal "a\\ b", Rant::Sys.escape("a b")
|
227
|
+
assert_equal "\\ ", Rant::Sys.escape(" ")
|
228
|
+
assert_equal "\\ a\\ b\\ ", Rant::Sys.escape(" a b ")
|
229
|
+
o = Object.new
|
230
|
+
def o.to_s; "to s"; end
|
231
|
+
assert_equal "to\\ s", Rant::Sys.escape(o)
|
232
|
+
end
|
233
|
+
end
|
234
|
+
def test_escape_array
|
235
|
+
assert_equal "a b", Rant::Sys.escape(%w(a b))
|
236
|
+
assert_equal "", Rant::Sys.escape([])
|
237
|
+
assert_equal "", Rant::Sys.escape([[]])
|
238
|
+
res = Rant::Sys.escape(["", []])
|
239
|
+
assert_equal "", res.strip
|
240
|
+
assert res.length < 2
|
241
|
+
if Rant::Env.on_windows?
|
242
|
+
assert_equal '"a b" c d " e"', Rant::Sys.escape([["a b"], "c", ["d", " e"]])
|
243
|
+
else
|
244
|
+
assert_equal "a\\ \\ b c d \\ e", Rant::Sys.escape([["a b"], "c", ["d", " e"]])
|
245
|
+
end
|
246
|
+
end
|
247
|
+
def test_sp
|
248
|
+
assert_equal "a", Rant::Sys.sp("a")
|
249
|
+
assert_equal "", Rant::Sys.sp("")
|
250
|
+
if Rant::Env.on_windows?
|
251
|
+
assert_equal '"a b"', Rant::Sys.sp("a b")
|
252
|
+
assert_equal '" " a b "c " d', Rant::Sys.sp([" ", ["a", "b", "c ", ["d"]]])
|
253
|
+
assert_equal "a\\b", Rant::Sys.sp("a/b")
|
254
|
+
assert_equal '"a\ b" c\d', Rant::Sys.sp(["a/ b", "c/d"])
|
255
|
+
assert_equal "a\\b\\c\\", Rant::Sys.sp("a/b/c/")
|
256
|
+
assert_equal "\"a b\\c\\\\\"", Rant::Sys.sp("a b/c/")
|
257
|
+
else
|
258
|
+
assert_equal "a\\ b", Rant::Sys.sp("a b")
|
259
|
+
assert_equal "\\ a b c\\ d", Rant::Sys.sp([" ", ["a", "b", "c ", ["d"]]])
|
260
|
+
assert_equal "a/b", Rant::Sys.sp("a/b")
|
261
|
+
assert_equal "a/\\ b c/d", Rant::Sys.sp(["a/ b", "c/d"])
|
262
|
+
end
|
263
|
+
end
|
213
264
|
end
|
data/test/tutil.rb
CHANGED
@@ -32,10 +32,10 @@ module Test
|
|
32
32
|
if newproc
|
33
33
|
if capture
|
34
34
|
# TODO: stderr
|
35
|
-
`#{Rant::Sys.sp(Rant::Env::
|
35
|
+
`#{Rant::Sys.sp(Rant::Env::RUBY_EXE)} #{Rant::Sys.sp(RANT_BIN)} #{args.flatten.join(' ')}`
|
36
36
|
else
|
37
|
-
system("#{Rant::Sys.sp(Rant::Env::
|
38
|
-
#{Rant::Sys.sp(RANT_BIN)} " +
|
37
|
+
system("#{Rant::Sys.sp(Rant::Env::RUBY_EXE)} " +
|
38
|
+
"#{Rant::Sys.sp(RANT_BIN)} " +
|
39
39
|
"#{args.flatten.join(' ')}")
|
40
40
|
end
|
41
41
|
assert_equal(res, $?.exitstatus)
|
@@ -51,6 +51,14 @@ module Test
|
|
51
51
|
def assert_exit(status = 0)
|
52
52
|
assert_equal(status, $?.exitstatus)
|
53
53
|
end
|
54
|
+
def assert_file_content(fn, content, *opts)
|
55
|
+
assert(test(?f, fn), "`#{fn}' doesn't exist")
|
56
|
+
fc = File.read(fn)
|
57
|
+
fc.strip! if opts.include? :strip
|
58
|
+
assert(fc == content,
|
59
|
+
"file `#{fn}' should contain `#{content}' " +
|
60
|
+
"but contains `#{fc}'")
|
61
|
+
end
|
54
62
|
if RUBY_VERSION < "1.8.1"
|
55
63
|
def assert_raise(*args, &block)
|
56
64
|
assert_raises(*args, &block)
|
@@ -168,15 +176,15 @@ When testing Rant: `#{Dir.pwd + "/" + errfn}' exists.
|
|
168
176
|
end
|
169
177
|
|
170
178
|
def run_rant(*args)
|
171
|
-
`#{Rant::Sys.sp(Rant::Env::
|
179
|
+
`#{Rant::Sys.sp(Rant::Env::RUBY_EXE)} #{Rant::Sys.sp(RANT_BIN)} #{args.flatten.join(' ')}`
|
172
180
|
end
|
173
181
|
|
174
182
|
def run_import(*args)
|
175
|
-
`#{Rant::Sys.sp(Rant::Env::
|
183
|
+
`#{Rant::Sys.sp(Rant::Env::RUBY_EXE)} #{Rant::Sys.sp(RANT_IMPORT_BIN)} #{args.flatten.join(' ')}`
|
176
184
|
end
|
177
185
|
|
178
186
|
def run_ruby(*args)
|
179
|
-
`#{Rant::Sys.sp(Rant::Env::
|
187
|
+
`#{Rant::Sys.sp(Rant::Env::RUBY_EXE)} #{args.flatten.join(' ')}`
|
180
188
|
end
|
181
189
|
|
182
190
|
# Returns a list with the files required by the IO object script.
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rant
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.4.
|
7
|
-
date: 2005-
|
6
|
+
version: 0.4.8
|
7
|
+
date: 2005-10-31 00:00:00 +01:00
|
8
8
|
summary: Rant is a Ruby based build tool.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
default_executable:
|
17
17
|
bindir:
|
18
18
|
- bin
|
19
|
-
has_rdoc:
|
19
|
+
has_rdoc: false
|
20
20
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
21
21
|
requirements:
|
22
22
|
-
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- run_rant
|
39
39
|
- run_import
|
40
40
|
- setup.rb
|
41
|
+
- INSTALL
|
41
42
|
- COPYING
|
42
43
|
- bin/rant
|
43
44
|
- bin/rant-import
|
@@ -57,6 +58,7 @@ files:
|
|
57
58
|
- lib/rant/tempfile.rb
|
58
59
|
- lib/rant/coregen.rb
|
59
60
|
- lib/rant/archive
|
61
|
+
- lib/rant/metautils.rb
|
60
62
|
- lib/rant/import.rb
|
61
63
|
- lib/rant/c/include.rb
|
62
64
|
- lib/rant/import/c
|
@@ -73,6 +75,7 @@ files:
|
|
73
75
|
- lib/rant/import/archive.rb
|
74
76
|
- lib/rant/import/md5.rb
|
75
77
|
- lib/rant/import/package
|
78
|
+
- lib/rant/import/command.rb
|
76
79
|
- lib/rant/import/archive
|
77
80
|
- lib/rant/import/subfile.rb
|
78
81
|
- lib/rant/import/signature
|
@@ -100,6 +103,7 @@ files:
|
|
100
103
|
- lib/rant/archive/rubyzip/ioextras.rb
|
101
104
|
- lib/rant/archive/rubyzip/tempfile_bugfixed.rb
|
102
105
|
- test/c
|
106
|
+
- test/test_dyn_dependencies.rb
|
103
107
|
- test/test_filetask.rb
|
104
108
|
- test/test_examples.rb
|
105
109
|
- test/Rantfile
|
@@ -128,6 +132,7 @@ files:
|
|
128
132
|
- test/project2
|
129
133
|
- test/rant-import
|
130
134
|
- test/subdirs2
|
135
|
+
- test/dyn_dependencies.rf
|
131
136
|
- test/test_clean.rb
|
132
137
|
- test/test_filelist.rb
|
133
138
|
- test/deprecated
|
@@ -155,6 +160,7 @@ files:
|
|
155
160
|
- test/import/c
|
156
161
|
- test/import/md5
|
157
162
|
- test/import/sys
|
163
|
+
- test/import/command
|
158
164
|
- test/import/metadata
|
159
165
|
- test/import/nodes
|
160
166
|
- test/import/truth
|
@@ -195,6 +201,8 @@ files:
|
|
195
201
|
- test/import/sys/data/pkg/test.h
|
196
202
|
- test/import/sys/data/pkg/bin/test
|
197
203
|
- test/import/sys/data/pkg/bin/test.o
|
204
|
+
- test/import/command/Rantfile
|
205
|
+
- test/import/command/test_command.rb
|
198
206
|
- test/import/metadata/sub
|
199
207
|
- test/import/metadata/test_metadata.rb
|
200
208
|
- test/import/metadata/Rantfile
|
@@ -258,8 +266,8 @@ files:
|
|
258
266
|
- test/subdirs2/sub1/sub.rant
|
259
267
|
- test/subdirs2/sub00/sub.rant
|
260
268
|
- test/deprecated/README
|
261
|
-
- test/deprecated/test_0_4_8.rb
|
262
269
|
- test/deprecated/test_0_5_2.rb
|
270
|
+
- test/deprecated/test_0_6_0.rb
|
263
271
|
- doc/rantfile.rdoc
|
264
272
|
- doc/md5.rdoc
|
265
273
|
- doc/configure.rdoc
|
@@ -270,11 +278,13 @@ files:
|
|
270
278
|
- doc/homepage
|
271
279
|
- doc/rant.rdoc
|
272
280
|
- doc/jamis.rb
|
281
|
+
- doc/rant_vs_rake.rdoc
|
273
282
|
- doc/rant.1
|
274
283
|
- doc/csharp.rdoc
|
275
284
|
- doc/rant-import.rdoc
|
276
285
|
- doc/examples
|
277
286
|
- doc/package.rdoc
|
287
|
+
- doc/command.rdoc
|
278
288
|
- doc/homepage/index.html
|
279
289
|
- doc/homepage/rant_home.css
|
280
290
|
- doc/examples/c_cpp
|
@@ -353,9 +363,8 @@ rdoc_options:
|
|
353
363
|
- README
|
354
364
|
extra_rdoc_files:
|
355
365
|
- README
|
356
|
-
- doc/examples/myprog/README
|
357
|
-
- lib/rant/plugin/README
|
358
366
|
- NEWS
|
367
|
+
- INSTALL
|
359
368
|
- doc/rantfile.rdoc
|
360
369
|
- doc/md5.rdoc
|
361
370
|
- doc/configure.rdoc
|
@@ -364,9 +373,11 @@ extra_rdoc_files:
|
|
364
373
|
- doc/rubyproject.rdoc
|
365
374
|
- doc/c.rdoc
|
366
375
|
- doc/rant.rdoc
|
376
|
+
- doc/rant_vs_rake.rdoc
|
367
377
|
- doc/csharp.rdoc
|
368
378
|
- doc/rant-import.rdoc
|
369
379
|
- doc/package.rdoc
|
380
|
+
- doc/command.rdoc
|
370
381
|
executables:
|
371
382
|
- rant
|
372
383
|
- rant-import
|
@@ -1,41 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'test/unit'
|
3
|
-
require 'tutil'
|
4
|
-
|
5
|
-
$test_deprecated_dir ||= File.expand_path(File.dirname(__FILE__))
|
6
|
-
|
7
|
-
class TestDeprecated_0_4_8 < Test::Unit::TestCase
|
8
|
-
include Rant::TestUtil
|
9
|
-
|
10
|
-
def setup
|
11
|
-
Dir.chdir $test_deprecated_dir
|
12
|
-
end
|
13
|
-
def test_Rantfile_rb
|
14
|
-
in_local_temp_dir do
|
15
|
-
write_to_file "Rantfile.rb", <<-EOF
|
16
|
-
task :a do |t|
|
17
|
-
puts t.name
|
18
|
-
end
|
19
|
-
EOF
|
20
|
-
out, err = assert_rant
|
21
|
-
assert_equal("a\n", out)
|
22
|
-
assert_match(/\bWARNING\b/, err)
|
23
|
-
assert_match(/\bRantfile\.rb\b/, err)
|
24
|
-
assert_match(/\bdeprecated\b/, err)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
def test_rantfile_rb
|
28
|
-
in_local_temp_dir do
|
29
|
-
write_to_file "Rantfile.rb", <<-EOF
|
30
|
-
task :a do |t|
|
31
|
-
puts t.name
|
32
|
-
end
|
33
|
-
EOF
|
34
|
-
out, err = assert_rant
|
35
|
-
assert_equal("a\n", out)
|
36
|
-
assert_match(/\bWARNING\b/, err)
|
37
|
-
assert_match(/\bRantfile\.rb\b/, err)
|
38
|
-
assert_match(/\bdeprecated\b/, err)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|