rake 0.4.11 → 0.8.7
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.
- data/CHANGES +288 -1
- data/README +101 -114
- data/Rakefile +269 -54
- data/TODO +1 -0
- data/bin/rake +26 -3
- data/doc/command_line_usage.rdoc +102 -0
- data/doc/jamis.rb +133 -106
- data/doc/rake.1.gz +0 -0
- data/doc/rakefile.rdoc +304 -4
- data/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/doc/release_notes/rake-0.8.6.rdoc +55 -0
- data/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/lib/rake/alt_system.rb +108 -0
- data/lib/rake/classic_namespace.rb +8 -0
- data/lib/rake/clean.rb +3 -1
- data/lib/rake/contrib/ftptools.rb +40 -26
- data/lib/rake/contrib/publisher.rb +1 -1
- data/lib/rake/contrib/rubyforgepublisher.rb +3 -3
- data/lib/rake/contrib/sshpublisher.rb +1 -1
- data/lib/rake/contrib/sys.rb +25 -23
- data/lib/rake/gempackagetask.rb +14 -15
- data/lib/rake/loaders/makefile.rb +42 -0
- data/lib/rake/packagetask.rb +65 -33
- data/lib/rake/rake_test_loader.rb +5 -0
- data/lib/rake/rdoctask.rb +112 -31
- data/lib/rake/ruby182_test_unit_fix.rb +23 -0
- data/lib/rake/runtest.rb +4 -4
- data/lib/rake/tasklib.rb +11 -12
- data/lib/rake/testtask.rb +67 -24
- data/lib/rake/win32.rb +55 -0
- data/lib/rake.rb +2087 -578
- data/test/capture_stdout.rb +26 -0
- data/test/check_expansion.rb +5 -0
- data/test/check_no_expansion.rb +5 -0
- data/test/data/chains/Rakefile +15 -0
- data/test/data/default/Rakefile +19 -0
- data/test/data/dryrun/Rakefile +22 -0
- data/test/data/file_creation_task/Rakefile +33 -0
- data/test/data/imports/Rakefile +19 -0
- data/test/data/imports/deps.mf +1 -0
- data/test/data/multidesc/Rakefile +17 -0
- data/test/data/namespace/Rakefile +57 -0
- data/test/data/rakelib/test1.rb +3 -0
- data/test/data/sample.mf +14 -0
- data/test/data/statusreturn/Rakefile +8 -0
- data/test/data/unittest/Rakefile +1 -0
- data/test/filecreation.rb +18 -12
- data/test/functional.rb +6 -73
- data/test/in_environment.rb +30 -0
- data/test/rake_test_setup.rb +24 -0
- data/test/reqfile.rb +3 -0
- data/test/reqfile2.rb +3 -0
- data/test/session_functional.rb +339 -0
- data/test/shellcommand.rb +0 -0
- data/test/test_application.rb +675 -0
- data/test/{testclean.rb → test_clean.rb} +1 -0
- data/test/test_definitions.rb +85 -0
- data/test/test_earlytime.rb +35 -0
- data/test/test_extension.rb +63 -0
- data/test/test_file_creation_task.rb +62 -0
- data/test/test_file_task.rb +143 -0
- data/test/test_filelist.rb +623 -0
- data/test/test_fileutils.rb +251 -0
- data/test/{testftp.rb → test_ftp.rb} +5 -1
- data/test/test_invocation_chain.rb +81 -0
- data/test/test_makefile_loader.rb +26 -0
- data/test/test_multitask.rb +45 -0
- data/test/test_namespace.rb +55 -0
- data/test/{testpackagetask.rb → test_package_task.rb} +49 -12
- data/test/test_pathmap.rb +210 -0
- data/test/test_pseudo_status.rb +26 -0
- data/test/test_rake.rb +41 -0
- data/test/test_rdoc_task.rb +88 -0
- data/test/test_require.rb +35 -0
- data/test/test_rules.rb +349 -0
- data/test/test_task_arguments.rb +89 -0
- data/test/test_task_manager.rb +173 -0
- data/test/test_tasklib.rb +12 -0
- data/test/test_tasks.rb +374 -0
- data/test/{testtesttask.rb → test_test_task.rb} +8 -2
- data/test/test_top_level_functions.rb +86 -0
- data/test/test_win32.rb +72 -0
- metadata +184 -84
- data/test/testfilelist.rb +0 -255
- data/test/testfileutils.rb +0 -83
- data/test/testtasks.rb +0 -371
- /data/test/contrib/{testsys.rb → test_sys.rb} +0 -0
metadata
CHANGED
|
@@ -1,93 +1,193 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
|
-
rubygems_version: 0.8.1
|
|
3
|
-
specification_version: 1
|
|
4
2
|
name: rake
|
|
5
3
|
version: !ruby/object:Gem::Version
|
|
6
|
-
version: 0.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- lib
|
|
11
|
-
author: Jim Weirich
|
|
12
|
-
email: jim@weirichhouse.org
|
|
13
|
-
homepage: http://rake.rubyforge.org
|
|
14
|
-
rubyforge_project: rake
|
|
15
|
-
description: Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
|
|
4
|
+
version: 0.8.7
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jim Weirich
|
|
16
8
|
autorequire:
|
|
17
|
-
default_executable: rake
|
|
18
9
|
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
|
|
12
|
+
date: 2009-05-15 00:00:00 -04:00
|
|
13
|
+
default_executable: rake
|
|
14
|
+
dependencies: []
|
|
15
|
+
|
|
16
|
+
description: Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
|
|
17
|
+
email: jim@weirichhouse.org
|
|
18
|
+
executables:
|
|
19
|
+
- rake
|
|
20
|
+
extensions: []
|
|
21
|
+
|
|
22
|
+
extra_rdoc_files:
|
|
23
|
+
- README
|
|
24
|
+
- MIT-LICENSE
|
|
25
|
+
- TODO
|
|
26
|
+
- CHANGES
|
|
27
|
+
- doc/command_line_usage.rdoc
|
|
28
|
+
- doc/glossary.rdoc
|
|
29
|
+
- doc/proto_rake.rdoc
|
|
30
|
+
- doc/rakefile.rdoc
|
|
31
|
+
- doc/rational.rdoc
|
|
32
|
+
- doc/release_notes/rake-0.4.14.rdoc
|
|
33
|
+
- doc/release_notes/rake-0.4.15.rdoc
|
|
34
|
+
- doc/release_notes/rake-0.5.0.rdoc
|
|
35
|
+
- doc/release_notes/rake-0.5.3.rdoc
|
|
36
|
+
- doc/release_notes/rake-0.5.4.rdoc
|
|
37
|
+
- doc/release_notes/rake-0.6.0.rdoc
|
|
38
|
+
- doc/release_notes/rake-0.7.0.rdoc
|
|
39
|
+
- doc/release_notes/rake-0.7.1.rdoc
|
|
40
|
+
- doc/release_notes/rake-0.7.2.rdoc
|
|
41
|
+
- doc/release_notes/rake-0.7.3.rdoc
|
|
42
|
+
- doc/release_notes/rake-0.8.0.rdoc
|
|
43
|
+
- doc/release_notes/rake-0.8.2.rdoc
|
|
44
|
+
- doc/release_notes/rake-0.8.3.rdoc
|
|
45
|
+
- doc/release_notes/rake-0.8.4.rdoc
|
|
46
|
+
- doc/release_notes/rake-0.8.5.rdoc
|
|
47
|
+
- doc/release_notes/rake-0.8.6.rdoc
|
|
48
|
+
- doc/release_notes/rake-0.8.7.rdoc
|
|
49
|
+
files:
|
|
50
|
+
- install.rb
|
|
51
|
+
- CHANGES
|
|
52
|
+
- MIT-LICENSE
|
|
53
|
+
- Rakefile
|
|
54
|
+
- README
|
|
55
|
+
- TODO
|
|
56
|
+
- bin/rake
|
|
57
|
+
- lib/rake/alt_system.rb
|
|
58
|
+
- lib/rake/classic_namespace.rb
|
|
59
|
+
- lib/rake/clean.rb
|
|
60
|
+
- lib/rake/contrib/compositepublisher.rb
|
|
61
|
+
- lib/rake/contrib/ftptools.rb
|
|
62
|
+
- lib/rake/contrib/publisher.rb
|
|
63
|
+
- lib/rake/contrib/rubyforgepublisher.rb
|
|
64
|
+
- lib/rake/contrib/sshpublisher.rb
|
|
65
|
+
- lib/rake/contrib/sys.rb
|
|
66
|
+
- lib/rake/gempackagetask.rb
|
|
67
|
+
- lib/rake/loaders/makefile.rb
|
|
68
|
+
- lib/rake/packagetask.rb
|
|
69
|
+
- lib/rake/rake_test_loader.rb
|
|
70
|
+
- lib/rake/rdoctask.rb
|
|
71
|
+
- lib/rake/ruby182_test_unit_fix.rb
|
|
72
|
+
- lib/rake/runtest.rb
|
|
73
|
+
- lib/rake/tasklib.rb
|
|
74
|
+
- lib/rake/testtask.rb
|
|
75
|
+
- lib/rake/win32.rb
|
|
76
|
+
- lib/rake.rb
|
|
77
|
+
- test/capture_stdout.rb
|
|
78
|
+
- test/check_expansion.rb
|
|
79
|
+
- test/check_no_expansion.rb
|
|
80
|
+
- test/contrib/test_sys.rb
|
|
81
|
+
- test/data/rakelib/test1.rb
|
|
82
|
+
- test/data/rbext/rakefile.rb
|
|
83
|
+
- test/filecreation.rb
|
|
84
|
+
- test/functional.rb
|
|
85
|
+
- test/in_environment.rb
|
|
86
|
+
- test/rake_test_setup.rb
|
|
87
|
+
- test/reqfile.rb
|
|
88
|
+
- test/reqfile2.rb
|
|
89
|
+
- test/session_functional.rb
|
|
90
|
+
- test/shellcommand.rb
|
|
91
|
+
- test/test_application.rb
|
|
92
|
+
- test/test_clean.rb
|
|
93
|
+
- test/test_definitions.rb
|
|
94
|
+
- test/test_earlytime.rb
|
|
95
|
+
- test/test_extension.rb
|
|
96
|
+
- test/test_file_creation_task.rb
|
|
97
|
+
- test/test_file_task.rb
|
|
98
|
+
- test/test_filelist.rb
|
|
99
|
+
- test/test_fileutils.rb
|
|
100
|
+
- test/test_ftp.rb
|
|
101
|
+
- test/test_invocation_chain.rb
|
|
102
|
+
- test/test_makefile_loader.rb
|
|
103
|
+
- test/test_multitask.rb
|
|
104
|
+
- test/test_namespace.rb
|
|
105
|
+
- test/test_package_task.rb
|
|
106
|
+
- test/test_pathmap.rb
|
|
107
|
+
- test/test_pseudo_status.rb
|
|
108
|
+
- test/test_rake.rb
|
|
109
|
+
- test/test_rdoc_task.rb
|
|
110
|
+
- test/test_require.rb
|
|
111
|
+
- test/test_rules.rb
|
|
112
|
+
- test/test_task_arguments.rb
|
|
113
|
+
- test/test_task_manager.rb
|
|
114
|
+
- test/test_tasklib.rb
|
|
115
|
+
- test/test_tasks.rb
|
|
116
|
+
- test/test_test_task.rb
|
|
117
|
+
- test/test_top_level_functions.rb
|
|
118
|
+
- test/test_win32.rb
|
|
119
|
+
- test/data/imports/deps.mf
|
|
120
|
+
- test/data/sample.mf
|
|
121
|
+
- test/data/chains/Rakefile
|
|
122
|
+
- test/data/default/Rakefile
|
|
123
|
+
- test/data/dryrun/Rakefile
|
|
124
|
+
- test/data/file_creation_task/Rakefile
|
|
125
|
+
- test/data/imports/Rakefile
|
|
126
|
+
- test/data/multidesc/Rakefile
|
|
127
|
+
- test/data/namespace/Rakefile
|
|
128
|
+
- test/data/statusreturn/Rakefile
|
|
129
|
+
- test/data/unittest/Rakefile
|
|
130
|
+
- test/data/unittest/subdir
|
|
131
|
+
- doc/command_line_usage.rdoc
|
|
132
|
+
- doc/example
|
|
133
|
+
- doc/example/a.c
|
|
134
|
+
- doc/example/b.c
|
|
135
|
+
- doc/example/main.c
|
|
136
|
+
- doc/example/Rakefile1
|
|
137
|
+
- doc/example/Rakefile2
|
|
138
|
+
- doc/glossary.rdoc
|
|
139
|
+
- doc/jamis.rb
|
|
140
|
+
- doc/proto_rake.rdoc
|
|
141
|
+
- doc/rake.1.gz
|
|
142
|
+
- doc/rakefile.rdoc
|
|
143
|
+
- doc/rational.rdoc
|
|
144
|
+
- doc/release_notes
|
|
145
|
+
- doc/release_notes/rake-0.4.14.rdoc
|
|
146
|
+
- doc/release_notes/rake-0.4.15.rdoc
|
|
147
|
+
- doc/release_notes/rake-0.5.0.rdoc
|
|
148
|
+
- doc/release_notes/rake-0.5.3.rdoc
|
|
149
|
+
- doc/release_notes/rake-0.5.4.rdoc
|
|
150
|
+
- doc/release_notes/rake-0.6.0.rdoc
|
|
151
|
+
- doc/release_notes/rake-0.7.0.rdoc
|
|
152
|
+
- doc/release_notes/rake-0.7.1.rdoc
|
|
153
|
+
- doc/release_notes/rake-0.7.2.rdoc
|
|
154
|
+
- doc/release_notes/rake-0.7.3.rdoc
|
|
155
|
+
- doc/release_notes/rake-0.8.0.rdoc
|
|
156
|
+
- doc/release_notes/rake-0.8.2.rdoc
|
|
157
|
+
- doc/release_notes/rake-0.8.3.rdoc
|
|
158
|
+
- doc/release_notes/rake-0.8.4.rdoc
|
|
159
|
+
- doc/release_notes/rake-0.8.5.rdoc
|
|
160
|
+
- doc/release_notes/rake-0.8.6.rdoc
|
|
161
|
+
- doc/release_notes/rake-0.8.7.rdoc
|
|
19
162
|
has_rdoc: true
|
|
20
|
-
|
|
163
|
+
homepage: http://rake.rubyforge.org
|
|
164
|
+
post_install_message:
|
|
165
|
+
rdoc_options:
|
|
166
|
+
- --line-numbers
|
|
167
|
+
- --main
|
|
168
|
+
- README
|
|
169
|
+
- --title
|
|
170
|
+
- Rake -- Ruby Make
|
|
171
|
+
require_paths:
|
|
172
|
+
- lib
|
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
21
174
|
requirements:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
175
|
+
- - ">="
|
|
176
|
+
- !ruby/object:Gem::Version
|
|
177
|
+
version: "0"
|
|
178
|
+
version:
|
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
|
+
requirements:
|
|
181
|
+
- - ">="
|
|
182
|
+
- !ruby/object:Gem::Version
|
|
183
|
+
version: "0"
|
|
26
184
|
version:
|
|
27
|
-
platform: ruby
|
|
28
|
-
files:
|
|
29
|
-
- install.rb
|
|
30
|
-
- CHANGES
|
|
31
|
-
- README
|
|
32
|
-
- TODO
|
|
33
|
-
- Rakefile
|
|
34
|
-
- MIT-LICENSE
|
|
35
|
-
- bin/rake
|
|
36
|
-
- lib/rake.rb
|
|
37
|
-
- lib/rake/clean.rb
|
|
38
|
-
- lib/rake/tasklib.rb
|
|
39
|
-
- lib/rake/packagetask.rb
|
|
40
|
-
- lib/rake/rdoctask.rb
|
|
41
|
-
- lib/rake/runtest.rb
|
|
42
|
-
- lib/rake/testtask.rb
|
|
43
|
-
- lib/rake/gempackagetask.rb
|
|
44
|
-
- lib/rake/contrib/ftptools.rb
|
|
45
|
-
- lib/rake/contrib/sys.rb
|
|
46
|
-
- lib/rake/contrib/compositepublisher.rb
|
|
47
|
-
- lib/rake/contrib/publisher.rb
|
|
48
|
-
- lib/rake/contrib/rubyforgepublisher.rb
|
|
49
|
-
- lib/rake/contrib/sshpublisher.rb
|
|
50
|
-
- test/filecreation.rb
|
|
51
|
-
- test/testclean.rb
|
|
52
|
-
- test/testfilelist.rb
|
|
53
|
-
- test/testtasks.rb
|
|
54
|
-
- test/testftp.rb
|
|
55
|
-
- test/testfileutils.rb
|
|
56
|
-
- test/shellcommand.rb
|
|
57
|
-
- test/testpackagetask.rb
|
|
58
|
-
- test/functional.rb
|
|
59
|
-
- test/testtesttask.rb
|
|
60
|
-
- test/contrib/testsys.rb
|
|
61
|
-
- test/data/rbext/rakefile.rb
|
|
62
|
-
- doc/example
|
|
63
|
-
- doc/glossary.rdoc
|
|
64
|
-
- doc/proto_rake.rdoc
|
|
65
|
-
- doc/jamis.rb
|
|
66
|
-
- doc/rational.rdoc
|
|
67
|
-
- doc/rakefile.rdoc
|
|
68
|
-
- doc/example/Rakefile1
|
|
69
|
-
- doc/example/Rakefile2
|
|
70
|
-
- doc/example/a.c
|
|
71
|
-
- doc/example/b.c
|
|
72
|
-
- doc/example/main.c
|
|
73
|
-
test_files: []
|
|
74
|
-
rdoc_options:
|
|
75
|
-
- "--title"
|
|
76
|
-
- "Rake -- Ruby Make"
|
|
77
|
-
- "--main"
|
|
78
|
-
- README
|
|
79
|
-
- "--line-numbers"
|
|
80
|
-
extra_rdoc_files:
|
|
81
|
-
- README
|
|
82
|
-
- MIT-LICENSE
|
|
83
|
-
- TODO
|
|
84
|
-
- CHANGES
|
|
85
|
-
- doc/glossary.rdoc
|
|
86
|
-
- doc/proto_rake.rdoc
|
|
87
|
-
- doc/rational.rdoc
|
|
88
|
-
- doc/rakefile.rdoc
|
|
89
|
-
executables:
|
|
90
|
-
- rake
|
|
91
|
-
extensions: []
|
|
92
185
|
requirements: []
|
|
93
|
-
|
|
186
|
+
|
|
187
|
+
rubyforge_project: rake
|
|
188
|
+
rubygems_version: 1.3.1
|
|
189
|
+
signing_key:
|
|
190
|
+
specification_version: 2
|
|
191
|
+
summary: Ruby based make-like utility.
|
|
192
|
+
test_files: []
|
|
193
|
+
|
data/test/testfilelist.rb
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require 'test/unit'
|
|
4
|
-
require 'rake'
|
|
5
|
-
|
|
6
|
-
class TestFileList < Test::Unit::TestCase
|
|
7
|
-
FileList = Rake::FileList
|
|
8
|
-
|
|
9
|
-
def setup
|
|
10
|
-
create_test_data
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def teardown
|
|
14
|
-
FileList.select_default_ignore_patterns
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def test_create
|
|
18
|
-
fl = FileList.new
|
|
19
|
-
assert_equal 0, fl.size
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def test_create_with_args
|
|
23
|
-
fl = FileList.new("testdata/*.c", "x")
|
|
24
|
-
assert_equal ["testdata/abc.c", "testdata/x.c", "testdata/xyz.c", "x"].sort,
|
|
25
|
-
fl.sort
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def test_create_with_block
|
|
29
|
-
fl = FileList.new { |f| f.include("x") }
|
|
30
|
-
assert_equal ["x"], fl.resolve
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def test_create_with_brackets
|
|
34
|
-
fl = FileList["testdata/*.c", "x"]
|
|
35
|
-
assert_equal ["testdata/abc.c", "testdata/x.c", "testdata/xyz.c", "x"].sort,
|
|
36
|
-
fl.sort
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def test_append
|
|
40
|
-
fl = FileList.new
|
|
41
|
-
fl << "a.rb" << "b.rb"
|
|
42
|
-
assert_equal ['a.rb', 'b.rb'], fl
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def test_add_many
|
|
46
|
-
fl = FileList.new
|
|
47
|
-
fl.include %w(a d c )
|
|
48
|
-
fl.include('x', 'y')
|
|
49
|
-
assert_equal ['a', 'd', 'c', 'x', 'y'], fl.resolve
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def test_add_return
|
|
53
|
-
f = FileList.new
|
|
54
|
-
g = f << "x"
|
|
55
|
-
assert_equal f.id, g.id
|
|
56
|
-
h = f.include("y")
|
|
57
|
-
assert_equal f.id, h.id
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def test_match
|
|
61
|
-
fl = FileList.new
|
|
62
|
-
fl.include('test/test*.rb')
|
|
63
|
-
assert fl.include?("test/testfilelist.rb")
|
|
64
|
-
assert fl.size > 3
|
|
65
|
-
fl.each { |fn| assert_match /\.rb$/, fn }
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def test_add_matching
|
|
69
|
-
fl = FileList.new
|
|
70
|
-
fl << "a.java"
|
|
71
|
-
fl.include("test/*.rb")
|
|
72
|
-
assert_equal "a.java", fl[0]
|
|
73
|
-
assert fl.size > 2
|
|
74
|
-
assert fl.include?("test/testfilelist.rb")
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def test_multiple_patterns
|
|
78
|
-
create_test_data
|
|
79
|
-
fl = FileList.new
|
|
80
|
-
fl.include('*.c', '*xist*')
|
|
81
|
-
assert_equal [], fl
|
|
82
|
-
fl.include('testdata/*.c', 'testdata/*xist*')
|
|
83
|
-
assert_equal [
|
|
84
|
-
'testdata/x.c', 'testdata/xyz.c', 'testdata/abc.c', 'testdata/existing'
|
|
85
|
-
].sort, fl.sort
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def test_reject
|
|
89
|
-
fl = FileList.new
|
|
90
|
-
fl.include %w(testdata/x.c testdata/abc.c testdata/xyz.c testdata/existing)
|
|
91
|
-
fl.reject! { |fn| fn =~ %r{/x} }
|
|
92
|
-
assert_equal [
|
|
93
|
-
'testdata/abc.c', 'testdata/existing'
|
|
94
|
-
], fl
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
def test_exclude
|
|
98
|
-
fl = FileList['testdata/x.c', 'testdata/abc.c', 'testdata/xyz.c', 'testdata/existing']
|
|
99
|
-
fl.each { |fn| touch fn, :verbose => false }
|
|
100
|
-
x = fl.exclude(%r{/x.+\.})
|
|
101
|
-
assert_equal FileList, x.class
|
|
102
|
-
assert_equal [
|
|
103
|
-
'testdata/x.c', 'testdata/abc.c', 'testdata/existing'
|
|
104
|
-
], fl
|
|
105
|
-
assert_equal fl.id, x.id
|
|
106
|
-
fl.exclude('testdata/*.c')
|
|
107
|
-
assert_equal ['testdata/existing'], fl
|
|
108
|
-
fl.exclude('testdata/existing')
|
|
109
|
-
assert_equal [], fl
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def test_exclude_return_on_create
|
|
113
|
-
fl = FileList['testdata/*'].exclude(/.*\.c$/)
|
|
114
|
-
assert_equal FileList, fl.class
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
def test_default_exclude
|
|
118
|
-
fl = FileList.new
|
|
119
|
-
fl.clear_exclude
|
|
120
|
-
fl.include("**/*~", "**/*.bak", "**/core")
|
|
121
|
-
assert fl.member?("testdata/core"), "Should include core"
|
|
122
|
-
assert fl.member?("testdata/x.bak"), "Should include .bak files"
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def test_unique
|
|
126
|
-
fl = FileList.new
|
|
127
|
-
fl << "x.c" << "a.c" << "b.rb" << "a.c"
|
|
128
|
-
assert_equal ['x.c', 'a.c', 'b.rb', 'a.c'], fl
|
|
129
|
-
fl.uniq!
|
|
130
|
-
assert_equal ['x.c', 'a.c', 'b.rb'], fl
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
def test_to_string
|
|
134
|
-
fl = FileList.new
|
|
135
|
-
fl << "a.java" << "b.java"
|
|
136
|
-
assert_equal "a.java b.java", fl.to_s
|
|
137
|
-
assert_equal "a.java b.java", "#{fl}"
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
def test_to_s_pending
|
|
141
|
-
fl = FileList['testdata/abc.*']
|
|
142
|
-
assert_equal %{testdata/abc.c}, fl.to_s
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
def test_inspect_pending
|
|
146
|
-
fl = FileList['testdata/abc.*']
|
|
147
|
-
assert_equal %{["testdata/abc.c"]}, fl.inspect
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
def test_sub
|
|
151
|
-
fl = FileList["testdata/*.c"]
|
|
152
|
-
f2 = fl.sub(/\.c$/, ".o")
|
|
153
|
-
assert_equal FileList, f2.class
|
|
154
|
-
assert_equal ["testdata/abc.o", "testdata/x.o", "testdata/xyz.o"].sort,
|
|
155
|
-
f2.sort
|
|
156
|
-
f3 = fl.gsub(/\.c$/, ".o")
|
|
157
|
-
assert_equal FileList, f3.class
|
|
158
|
-
assert_equal ["testdata/abc.o", "testdata/x.o", "testdata/xyz.o"].sort,
|
|
159
|
-
f3.sort
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
def test_sub!
|
|
163
|
-
f = "x/a.c"
|
|
164
|
-
fl = FileList[f, "x/b.c"]
|
|
165
|
-
res = fl.sub!(/\.c$/, ".o")
|
|
166
|
-
assert_equal ["x/a.o", "x/b.o"].sort, fl.sort
|
|
167
|
-
assert_equal "x/a.c", f
|
|
168
|
-
assert_equal fl.id, res.id
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
def test_sub_with_block
|
|
172
|
-
fl = FileList["src/org/onestepback/a.java", "src/org/onestepback/b.java"]
|
|
173
|
-
# The block version doesn't work the way I want it to ...
|
|
174
|
-
# f2 = fl.sub(%r{^src/(.*)\.java$}) { |x| "classes/" + $1 + ".class" }
|
|
175
|
-
f2 = fl.sub(%r{^src/(.*)\.java$}, "classes/\\1.class")
|
|
176
|
-
assert_equal [
|
|
177
|
-
"classes/org/onestepback/a.class",
|
|
178
|
-
"classes/org/onestepback/b.class"
|
|
179
|
-
].sort,
|
|
180
|
-
f2.sort
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
def test_gsub
|
|
184
|
-
create_test_data
|
|
185
|
-
fl = FileList["testdata/*.c"]
|
|
186
|
-
f2 = fl.gsub(/a/, "A")
|
|
187
|
-
assert_equal ["testdAtA/Abc.c", "testdAtA/x.c", "testdAtA/xyz.c"].sort,
|
|
188
|
-
f2.sort
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
def test_ignore_special
|
|
192
|
-
f = FileList['testdata/*']
|
|
193
|
-
assert ! f.include?("testdata/CVS"), "Should not contain CVS"
|
|
194
|
-
assert ! f.include?("testdata/.dummy"), "Should not contain dot files"
|
|
195
|
-
assert ! f.include?("testdata/x.bak"), "Should not contain .bak files"
|
|
196
|
-
assert ! f.include?("testdata/x~"), "Should not contain ~ files"
|
|
197
|
-
assert ! f.include?("testdata/core"), "Should not contain core files"
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
def test_clear_ignore_patterns
|
|
201
|
-
f = FileList['testdata/*']
|
|
202
|
-
f.clear_exclude
|
|
203
|
-
assert f.include?("testdata/abc.c")
|
|
204
|
-
assert f.include?("testdata/xyz.c")
|
|
205
|
-
assert f.include?("testdata/CVS")
|
|
206
|
-
assert f.include?("testdata/x.bak")
|
|
207
|
-
assert f.include?("testdata/x~")
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
def test_exclude_with_alternate_file_seps
|
|
211
|
-
fl = FileList.new
|
|
212
|
-
assert fl.exclude?("x/CVS/y")
|
|
213
|
-
assert fl.exclude?("x\\CVS\\y")
|
|
214
|
-
assert fl.exclude?("x/core")
|
|
215
|
-
assert fl.exclude?("x\\core")
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
def test_add_default_exclude_list
|
|
219
|
-
fl = FileList.new
|
|
220
|
-
fl.exclude(/~\d+$/)
|
|
221
|
-
assert fl.exclude?("x/CVS/y")
|
|
222
|
-
assert fl.exclude?("x\\CVS\\y")
|
|
223
|
-
assert fl.exclude?("x/core")
|
|
224
|
-
assert fl.exclude?("x\\core")
|
|
225
|
-
assert fl.exclude?("x/abc~1")
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
def test_basic_array_functions
|
|
229
|
-
f = FileList['b', 'c', 'a']
|
|
230
|
-
assert_equal 'b', f.first
|
|
231
|
-
assert_equal 'b', f[0]
|
|
232
|
-
assert_equal 'a', f.last
|
|
233
|
-
assert_equal 'a', f[2]
|
|
234
|
-
assert_equal 'a', f[-1]
|
|
235
|
-
assert_equal ['a', 'b', 'c'], f.sort
|
|
236
|
-
f.sort!
|
|
237
|
-
assert_equal ['a', 'b', 'c'], f
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
def create_test_data
|
|
241
|
-
verbose(false) do
|
|
242
|
-
mkdir "testdata" unless File.exist? "testdata"
|
|
243
|
-
mkdir "testdata/CVS" rescue nil
|
|
244
|
-
touch "testdata/.dummy"
|
|
245
|
-
touch "testdata/x.bak"
|
|
246
|
-
touch "testdata/x~"
|
|
247
|
-
touch "testdata/core"
|
|
248
|
-
touch "testdata/x.c"
|
|
249
|
-
touch "testdata/xyz.c"
|
|
250
|
-
touch "testdata/abc.c"
|
|
251
|
-
touch "testdata/existing"
|
|
252
|
-
end
|
|
253
|
-
end
|
|
254
|
-
|
|
255
|
-
end
|
data/test/testfileutils.rb
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require 'rake'
|
|
4
|
-
require 'test/unit'
|
|
5
|
-
require 'test/filecreation'
|
|
6
|
-
require 'fileutils'
|
|
7
|
-
|
|
8
|
-
class TestFileUtils < Test::Unit::TestCase
|
|
9
|
-
include FileCreation
|
|
10
|
-
|
|
11
|
-
def test_rm_one_file
|
|
12
|
-
create_file("testdata/a")
|
|
13
|
-
FileUtils.rm_r "testdata/a"
|
|
14
|
-
assert ! File.exist?("testdata/a")
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def test_rm_two_files
|
|
18
|
-
create_file("testdata/a")
|
|
19
|
-
create_file("testdata/b")
|
|
20
|
-
FileUtils.rm_r ["testdata/a", "testdata/b"]
|
|
21
|
-
assert ! File.exist?("testdata/a")
|
|
22
|
-
assert ! File.exist?("testdata/b")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def test_rm_filelist
|
|
26
|
-
list = Rake::FileList.new << "testdata/a" << "testdata/b"
|
|
27
|
-
list.each { |fn| create_file(fn) }
|
|
28
|
-
FileUtils.rm_r list
|
|
29
|
-
assert ! File.exist?("testdata/a")
|
|
30
|
-
assert ! File.exist?("testdata/b")
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def test_verbose
|
|
34
|
-
verbose true
|
|
35
|
-
assert_equal true, verbose
|
|
36
|
-
verbose false
|
|
37
|
-
assert_equal false, verbose
|
|
38
|
-
verbose(true){
|
|
39
|
-
assert_equal true, verbose
|
|
40
|
-
}
|
|
41
|
-
assert_equal false, verbose
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def test_nowrite
|
|
45
|
-
nowrite true
|
|
46
|
-
assert_equal true, nowrite
|
|
47
|
-
nowrite false
|
|
48
|
-
assert_equal false, nowrite
|
|
49
|
-
nowrite(true){
|
|
50
|
-
assert_equal true, nowrite
|
|
51
|
-
}
|
|
52
|
-
assert_equal false, nowrite
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def test_sh
|
|
56
|
-
verbose(false) { sh %{test/shellcommand.rb} }
|
|
57
|
-
assert true, "should not fail"
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def test_sh_failure
|
|
61
|
-
assert_raises(RuntimeError) {
|
|
62
|
-
verbose(false) { sh %{test/shellcommand.rb 1} }
|
|
63
|
-
}
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def test_sh_special_handling
|
|
67
|
-
count = 0
|
|
68
|
-
verbose(false) {
|
|
69
|
-
sh(%{test/shellcommand.rb}) do |ok, res|
|
|
70
|
-
assert(ok)
|
|
71
|
-
assert_equal 0, res.exitstatus
|
|
72
|
-
count += 1
|
|
73
|
-
end
|
|
74
|
-
sh(%{test/shellcommand.rb 1}) do |ok, res|
|
|
75
|
-
assert(!ok)
|
|
76
|
-
assert_equal 1, res.exitstatus
|
|
77
|
-
count += 1
|
|
78
|
-
end
|
|
79
|
-
}
|
|
80
|
-
assert_equal 2, count, "Block count should be 2"
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
end
|