jimweirich-rake 0.8.3.1 → 0.8.3.99
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 +22 -0
- data/README +84 -173
- data/Rakefile +2 -4
- data/doc/command_line_usage.rdoc +102 -0
- data/doc/rakefile.rdoc +4 -4
- data/doc/release_notes/rake-0.8.4.rdoc +125 -0
- data/lib/rake/gempackagetask.rb +0 -6
- data/lib/rake/loaders/makefile.rb +8 -1
- data/lib/rake/packagetask.rb +0 -1
- data/lib/rake/rdoctask.rb +80 -18
- data/lib/rake/testtask.rb +2 -2
- data/lib/rake/win32.rb +7 -4
- data/lib/rake.rb +33 -23
- data/test/data/sample.mf +2 -0
- data/test/rake_test_setup.rb +14 -0
- data/test/session_functional.rb +2 -0
- data/test/test_application.rb +33 -14
- data/test/test_definitions.rb +4 -1
- data/test/test_file_task.rb +20 -16
- data/test/test_filelist.rb +3 -1
- data/test/test_fileutils.rb +24 -8
- data/test/test_invocation_chain.rb +8 -2
- data/test/test_makefile_loader.rb +2 -1
- data/test/test_namespace.rb +30 -11
- data/test/test_package_task.rb +3 -1
- data/test/test_pathmap.rb +3 -2
- data/test/test_rdoc_task.rb +88 -0
- data/test/test_require.rb +3 -1
- data/test/test_rules.rb +6 -4
- data/test/test_task_manager.rb +4 -1
- data/test/test_tasks.rb +6 -3
- data/test/test_test_task.rb +2 -0
- data/test/test_top_level_functions.rb +4 -2
- data/test/test_win32.rb +29 -14
- metadata +8 -2
data/CHANGES
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
|
2
2
|
= Rake Changelog
|
3
3
|
|
4
|
+
== Version 0.8.4
|
5
|
+
|
6
|
+
* Preserve case when locating rakefiles (patch from James
|
7
|
+
M. Lawrence/quix)
|
8
|
+
|
9
|
+
* Better support for windows paths in the test task (patch from Simon
|
10
|
+
Chiang/bahuvrihi)
|
11
|
+
|
12
|
+
* Windows system dir search order is now: HOME, HOMEDRIVE + HOMEPATH,
|
13
|
+
APPDATA, USERPROFILE (patch from Luis Lavena)
|
14
|
+
|
15
|
+
* MingGW is now recognized as a windows platform. (patch from Luis
|
16
|
+
Lavena)
|
17
|
+
|
18
|
+
* Numerous fixes to the windows test suite (patch from Luis Lavena).
|
19
|
+
|
20
|
+
* Improved Rakefile case insensitivity testing (patch from Luis
|
21
|
+
Lavena).
|
22
|
+
|
23
|
+
* Fixed stray ARGV option problem that was interfering with
|
24
|
+
Test::Unit::Runner.
|
25
|
+
|
4
26
|
== Version 0.8.3
|
5
27
|
|
6
28
|
* Enhanced the system directory detection in windows. We now check
|
data/README
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= RAKE -- Ruby Make
|
2
2
|
|
3
|
-
Supporting Rake version: 0.8.
|
3
|
+
Supporting Rake version: 0.8.4
|
4
4
|
|
5
5
|
This package contains Rake, a simple ruby build program with
|
6
6
|
capabilities similar to make.
|
@@ -15,103 +15,126 @@ Rake has the following features:
|
|
15
15
|
|
16
16
|
* Rake supports rule patterns to synthesize implicit tasks.
|
17
17
|
|
18
|
-
*
|
19
|
-
|
18
|
+
* Flexible FileLists that act like arrays but know about manipulating
|
19
|
+
file names and paths.
|
20
20
|
|
21
|
-
* A library of prepackaged tasks to make building rakefiles easier.
|
21
|
+
* A library of prepackaged tasks to make building rakefiles easier. For example,
|
22
|
+
tasks for building tarballs, gems and RDoc output are provided.
|
22
23
|
|
23
|
-
|
24
|
+
* Supports parallel execution of tasks.
|
24
25
|
|
25
|
-
The latest version of rake can be found at
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
== Source Repository
|
27
|
+
== Installation
|
30
28
|
|
31
|
-
|
32
|
-
http://github.com/jimweirich/rake. The public git clone URL is
|
29
|
+
=== Gem Installation
|
33
30
|
|
34
|
-
|
31
|
+
Download and install rake with the following.
|
35
32
|
|
36
|
-
|
33
|
+
gem install rake
|
37
34
|
|
38
35
|
=== Normal Installation
|
39
36
|
|
40
|
-
You can
|
37
|
+
You can download the source tarball of the latest version of Rake from
|
41
38
|
|
42
|
-
|
39
|
+
* http://rubyforge.org/project/showfiles.php?group_id=50
|
43
40
|
|
44
|
-
|
41
|
+
Extract the tarball and run
|
45
42
|
|
46
|
-
|
43
|
+
% ruby install.rb
|
47
44
|
|
48
|
-
|
45
|
+
from its distribution directory.
|
49
46
|
|
50
|
-
|
47
|
+
== Usage
|
51
48
|
|
52
|
-
===
|
49
|
+
=== Simple Example
|
53
50
|
|
54
|
-
|
51
|
+
First, you must write a "Rakefile" file which contains the build rules. Here's
|
52
|
+
a simple example:
|
55
53
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
task :default => [:test]
|
55
|
+
|
56
|
+
task :test do
|
57
|
+
ruby "test/unittest.rb"
|
58
|
+
end
|
60
59
|
|
61
|
-
|
62
|
-
ruby -Ilib bin/rake # If you do not have a version of rake installed.
|
60
|
+
This Rakefile has two tasks:
|
63
61
|
|
64
|
-
|
62
|
+
* A task named "test", which - upon invocation - will run a unit test file in
|
63
|
+
Ruby.
|
64
|
+
* A task named "default". This task does nothing by itself, but it has exactly
|
65
|
+
one dependency, namely the "test" task. Invoking the "default" task will
|
66
|
+
cause Rake to invoke the "test" task as well.
|
65
67
|
|
66
|
-
|
68
|
+
Running the "rake" command without any options will cause it to run the
|
69
|
+
"default" task in the Rakefile:
|
67
70
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
71
|
+
% ls
|
72
|
+
Rakefile test/
|
73
|
+
% rake
|
74
|
+
(in /home/some_user/Projects/rake)
|
75
|
+
ruby test/unittest.rb
|
76
|
+
....unit test output here...
|
73
77
|
|
74
|
-
|
78
|
+
Type "rake --help" for all available options.
|
75
79
|
|
76
|
-
* Jim Weirich's 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/
|
77
|
-
* Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html
|
78
80
|
|
79
|
-
===
|
81
|
+
=== More Information
|
80
82
|
|
81
|
-
*
|
82
|
-
|
83
|
+
* For details on Rake's command-line invocation, read
|
84
|
+
doc/command_line_usage.rdoc[http://rake.rubyforge.org/files/doc/command_line_usage_rdoc.html]
|
85
|
+
* For details on writing Rakefiles, see
|
83
86
|
doc/rakefile.rdoc[http://rake.rubyforge.org/files/doc/rakefile_rdoc.html].
|
84
|
-
*
|
87
|
+
* For the original announcement of Rake, see
|
85
88
|
doc/rational.rdoc[http://rake.rubyforge.org/files/doc/rational_rdoc.html].
|
86
|
-
*
|
89
|
+
* For a glossary of terms, see
|
87
90
|
doc/glossary.rdoc[http://rake.rubyforge.org/files/doc/glossary_rdoc.html].
|
88
91
|
|
89
|
-
== Simple Example
|
90
92
|
|
91
|
-
|
93
|
+
== Development
|
94
|
+
|
95
|
+
=== Source Repository
|
96
|
+
|
97
|
+
Rake is currently hosted at github. The github web page is
|
98
|
+
http://github.com/jimweirich/rake. The public git clone URL is
|
99
|
+
|
100
|
+
* git://github.com/jimweirich/rake.git
|
92
101
|
|
93
|
-
|
102
|
+
=== Running the Rake Test Suite
|
94
103
|
|
95
|
-
|
104
|
+
If you wish to run the unit and functional tests that come with Rake:
|
96
105
|
|
97
|
-
|
98
|
-
|
106
|
+
* Install the 'session' gem in order to run the functional tests.
|
107
|
+
* CD into the top project directory of rake.
|
108
|
+
* Type one of the following:
|
99
109
|
|
100
|
-
|
110
|
+
rake # If you have a version of rake installed
|
111
|
+
ruby -Ilib bin/rake # If you do not have a version of rake installed.
|
101
112
|
|
102
|
-
|
113
|
+
=== Issues and Bug Reports
|
103
114
|
|
104
|
-
|
105
|
-
ruby "test/unittest.rb"
|
106
|
-
end
|
115
|
+
Bugs, features requests and other issues can be logged at
|
107
116
|
|
108
|
-
|
117
|
+
* http://onestepback.org/redmine/projects/show/rake
|
109
118
|
|
110
|
-
|
119
|
+
You will need an account to before you can post issues. Register at
|
120
|
+
http://onestepback.org/redmine/account/register. Or you can send me
|
121
|
+
an email (at jim dot weirich at gmail dot com)
|
111
122
|
|
112
|
-
|
113
|
-
|
114
|
-
|
123
|
+
|
124
|
+
== Online Resources
|
125
|
+
|
126
|
+
=== Rake References
|
127
|
+
|
128
|
+
* Rake Documentation Home: http://docs.rubyrake.org
|
129
|
+
* Rake Project Page: http://rubyforge.org/projects/rake
|
130
|
+
* Rake API Documents: http://rake.rubyforge.org
|
131
|
+
* Rake Source Code Repo: http://github.com/jimweirich/rake
|
132
|
+
* Rake Git Repo Clone URL: git://github.com/jimweirich/rake.git
|
133
|
+
|
134
|
+
=== Presentations and Articles about Rake
|
135
|
+
|
136
|
+
* Jim Weirich's 2003 RubyConf presentation: http://onestepback.org/articles/buildingwithrake/
|
137
|
+
* Martin Fowler's article on Rake: http://martinfowler.com/articles/rake.html
|
115
138
|
|
116
139
|
== Other Make Reinvisionings ...
|
117
140
|
|
@@ -153,127 +176,15 @@ new feature to be submitted in the form of new unit tests.
|
|
153
176
|
|
154
177
|
For other information, feel free to ask on the ruby-talk mailing list
|
155
178
|
(which is mirrored to comp.lang.ruby) or contact
|
156
|
-
|
157
|
-
|
158
|
-
----
|
159
|
-
|
160
|
-
= Usage
|
161
|
-
|
162
|
-
Rake is invoked from the command line using:
|
163
|
-
|
164
|
-
% rake [<em>options</em> ...] [<em>VAR</em>=<em>VALUE</em>] [<em>targets</em> ...]
|
165
|
-
|
166
|
-
Options are:
|
167
|
-
|
168
|
-
[<tt><em>name</em>=<em>value</em></tt>]
|
169
|
-
Set the environment variable <em>name</em> to <em>value</em>
|
170
|
-
during the execution of the <b>rake</b> command. You can access
|
171
|
-
the value by using ENV['<em>name</em>'].
|
172
|
-
|
173
|
-
[<tt>--classic-namespace</tt> (-n)]
|
174
|
-
Import the Task, FileTask, and FileCreateTask into the top-level
|
175
|
-
scope to be compatible with older versions of Rake. Alternatively
|
176
|
-
you can include the line <code>require
|
177
|
-
'rake/classic_namespace'</code> in your Rakefile to get the
|
178
|
-
classic behavior.
|
179
|
-
|
180
|
-
[<tt>--describe</tt> _pattern_ (-D)]
|
181
|
-
Describe the tasks (matching optional PATTERN), then exit.
|
182
|
-
|
183
|
-
[<tt>--dry-run</tt> (-n)]
|
184
|
-
Do a dry run. Print the tasks invoked and executed, but do not
|
185
|
-
actually execute any of the actions.
|
186
|
-
|
187
|
-
[<tt>--execute</tt> _code_ (-e)]
|
188
|
-
Execute some Ruby code and exit.
|
189
|
-
|
190
|
-
[<tt>--execute-print</tt> _code_ (-p)]
|
191
|
-
Execute some Ruby code, print the result, and exit.
|
192
|
-
|
193
|
-
[<tt>--execute-continue</tt> _code_ (-p)]
|
194
|
-
Execute some Ruby code, then continue with normal task processing.
|
195
|
-
|
196
|
-
[<tt>--help</tt> (-H)]
|
197
|
-
Display some help text and exit.
|
198
|
-
|
199
|
-
[<tt>--libdir</tt> _directory_ (-I)]
|
200
|
-
Add _directory_ to the list of directories searched for require.
|
201
|
-
|
202
|
-
[<tt>--nosearch</tt> (-N)]
|
203
|
-
Do not search for a Rakefile in parent directories.
|
204
|
-
|
205
|
-
[<tt>--prereqs</tt> (-P)]
|
206
|
-
Display a list of all tasks and their immediate prerequisites.
|
207
|
-
|
208
|
-
[<tt>--quiet</tt> (-q)]
|
209
|
-
Do not echo commands from FileUtils.
|
210
|
-
|
211
|
-
[<tt>--rakefile</tt> _filename_ (-f)]
|
212
|
-
Use _filename_ as the name of the rakefile. The default rakefile
|
213
|
-
names are +rakefile+ and +Rakefile+ (with +rakefile+ taking
|
214
|
-
precedence). If the rakefile is not found in the current
|
215
|
-
directory, +rake+ will search parent directories for a match. The
|
216
|
-
directory where the Rakefile is found will become the current
|
217
|
-
directory for the actions executed in the Rakefile.
|
218
|
-
|
219
|
-
[<tt>--rakelibdir</tt> _rakelibdir_ (-R)]
|
220
|
-
Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')
|
221
|
-
|
222
|
-
[<tt>--require</tt> _name_ (-r)]
|
223
|
-
Require _name_ before executing the Rakefile.
|
224
|
-
|
225
|
-
[<tt>--rules</tt>]
|
226
|
-
Trace the rules resolution.
|
227
|
-
|
228
|
-
[<tt>--silent (-s)]
|
229
|
-
Like --quiet, but also suppresses the 'in directory' announcement.
|
230
|
-
|
231
|
-
[<tt>--system</tt> (-g)]
|
232
|
-
Use the system wide (global) rakefiles. The project Rakefile is
|
233
|
-
ignored. By default, the system wide rakefiles are used only if no
|
234
|
-
project Rakefile is found. On Unix-like system, the system wide
|
235
|
-
rake files are located in $HOME/.rake. On a windows system they
|
236
|
-
are stored in $APPDATA/Rake.
|
237
|
-
|
238
|
-
[<tt>--no-system</tt> (-G)]
|
239
|
-
Use the project level Rakefile, ignoring the system-wide (global)
|
240
|
-
rakefiles.
|
241
|
-
|
242
|
-
[<tt>--tasks</tt> (-T)]
|
243
|
-
Display a list of the major tasks and their comments. Comments
|
244
|
-
are defined using the "desc" command.
|
245
|
-
|
246
|
-
[<tt>--trace</tt> (-t)]
|
247
|
-
Turn on invoke/execute tracing. Also enable full backtrace on
|
248
|
-
errors.
|
249
|
-
|
250
|
-
[<tt>--usage</tt> (-h)]
|
251
|
-
Display a usage message and exit.
|
252
|
-
|
253
|
-
[<tt>--verbose</tt> (-v)]
|
254
|
-
Echo the Sys commands to standard output.
|
255
|
-
|
256
|
-
[<tt>--version</tt> (-V)]
|
257
|
-
Display the program version and exit.
|
258
|
-
|
259
|
-
In addition, any command line option of the form
|
260
|
-
<em>VAR</em>=<em>VALUE</em> will be added to the environment hash
|
261
|
-
<tt>ENV</tt> and may be tested in the Rakefile.
|
262
|
-
|
263
|
-
---
|
264
|
-
|
265
|
-
= Rakefile Format
|
266
|
-
|
267
|
-
See doc/rakefile.rdoc[http://rake.rubyforge.org/files/doc/rakefile_rdoc.html]
|
268
|
-
for details on the Rakefile format.
|
179
|
+
jim dot weirich at gmail.com.
|
269
180
|
|
270
181
|
---
|
271
182
|
|
272
183
|
= Other stuff
|
273
184
|
|
274
|
-
Author:: Jim Weirich <jim@
|
185
|
+
Author:: Jim Weirich <jim.weirich@gmail.com>
|
275
186
|
Requires:: Ruby 1.8.0 or later
|
276
|
-
License:: Copyright 2003
|
187
|
+
License:: Copyright 2003-2008 by Jim Weirich.
|
277
188
|
Released under an MIT-style license. See the LICENSE file
|
278
189
|
included in the distribution.
|
279
190
|
|
data/Rakefile
CHANGED
@@ -130,13 +130,11 @@ end
|
|
130
130
|
|
131
131
|
rd = Rake::RDocTask.new("rdoc") { |rdoc|
|
132
132
|
rdoc.rdoc_dir = 'html'
|
133
|
-
# rdoc.template = 'kilmer'
|
134
|
-
# rdoc.template = 'css2'
|
135
133
|
rdoc.template = 'doc/jamis.rb'
|
136
134
|
rdoc.title = "Rake -- Ruby Make"
|
137
135
|
rdoc.options << '--line-numbers' << '--inline-source' <<
|
138
|
-
'--main'
|
139
|
-
'--title' <<
|
136
|
+
'--main' << 'README' <<
|
137
|
+
'--title' << 'Rake -- Ruby Make'
|
140
138
|
rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGES')
|
141
139
|
rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
|
142
140
|
rdoc.rdoc_files.exclude(/\bcontrib\b/)
|
@@ -0,0 +1,102 @@
|
|
1
|
+
= Rake Command Line Usage
|
2
|
+
|
3
|
+
Rake is invoked from the command line using:
|
4
|
+
|
5
|
+
% rake [<em>options</em> ...] [<em>VAR</em>=<em>VALUE</em>] [<em>targets</em> ...]
|
6
|
+
|
7
|
+
Options are:
|
8
|
+
|
9
|
+
[<tt><em>name</em>=<em>value</em></tt>]
|
10
|
+
Set the environment variable <em>name</em> to <em>value</em>
|
11
|
+
during the execution of the <b>rake</b> command. You can access
|
12
|
+
the value by using ENV['<em>name</em>'].
|
13
|
+
|
14
|
+
[<tt>--classic-namespace</tt> (-n)]
|
15
|
+
Import the Task, FileTask, and FileCreateTask into the top-level
|
16
|
+
scope to be compatible with older versions of Rake. Alternatively
|
17
|
+
you can include the line <code>require
|
18
|
+
'rake/classic_namespace'</code> in your Rakefile to get the
|
19
|
+
classic behavior.
|
20
|
+
|
21
|
+
[<tt>--describe</tt> _pattern_ (-D)]
|
22
|
+
Describe the tasks (matching optional PATTERN), then exit.
|
23
|
+
|
24
|
+
[<tt>--dry-run</tt> (-n)]
|
25
|
+
Do a dry run. Print the tasks invoked and executed, but do not
|
26
|
+
actually execute any of the actions.
|
27
|
+
|
28
|
+
[<tt>--execute</tt> _code_ (-e)]
|
29
|
+
Execute some Ruby code and exit.
|
30
|
+
|
31
|
+
[<tt>--execute-print</tt> _code_ (-p)]
|
32
|
+
Execute some Ruby code, print the result, and exit.
|
33
|
+
|
34
|
+
[<tt>--execute-continue</tt> _code_ (-p)]
|
35
|
+
Execute some Ruby code, then continue with normal task processing.
|
36
|
+
|
37
|
+
[<tt>--help</tt> (-H)]
|
38
|
+
Display some help text and exit.
|
39
|
+
|
40
|
+
[<tt>--libdir</tt> _directory_ (-I)]
|
41
|
+
Add _directory_ to the list of directories searched for require.
|
42
|
+
|
43
|
+
[<tt>--nosearch</tt> (-N)]
|
44
|
+
Do not search for a Rakefile in parent directories.
|
45
|
+
|
46
|
+
[<tt>--prereqs</tt> (-P)]
|
47
|
+
Display a list of all tasks and their immediate prerequisites.
|
48
|
+
|
49
|
+
[<tt>--quiet</tt> (-q)]
|
50
|
+
Do not echo commands from FileUtils.
|
51
|
+
|
52
|
+
[<tt>--rakefile</tt> _filename_ (-f)]
|
53
|
+
Use _filename_ as the name of the rakefile. The default rakefile
|
54
|
+
names are +rakefile+ and +Rakefile+ (with +rakefile+ taking
|
55
|
+
precedence). If the rakefile is not found in the current
|
56
|
+
directory, +rake+ will search parent directories for a match. The
|
57
|
+
directory where the Rakefile is found will become the current
|
58
|
+
directory for the actions executed in the Rakefile.
|
59
|
+
|
60
|
+
[<tt>--rakelibdir</tt> _rakelibdir_ (-R)]
|
61
|
+
Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')
|
62
|
+
|
63
|
+
[<tt>--require</tt> _name_ (-r)]
|
64
|
+
Require _name_ before executing the Rakefile.
|
65
|
+
|
66
|
+
[<tt>--rules</tt>]
|
67
|
+
Trace the rules resolution.
|
68
|
+
|
69
|
+
[<tt>--silent (-s)</tt>]
|
70
|
+
Like --quiet, but also suppresses the 'in directory' announcement.
|
71
|
+
|
72
|
+
[<tt>--system</tt> (-g)]
|
73
|
+
Use the system wide (global) rakefiles. The project Rakefile is
|
74
|
+
ignored. By default, the system wide rakefiles are used only if no
|
75
|
+
project Rakefile is found. On Unix-like system, the system wide
|
76
|
+
rake files are located in $HOME/.rake. On a windows system they
|
77
|
+
are stored in $APPDATA/Rake.
|
78
|
+
|
79
|
+
[<tt>--no-system</tt> (-G)]
|
80
|
+
Use the project level Rakefile, ignoring the system-wide (global)
|
81
|
+
rakefiles.
|
82
|
+
|
83
|
+
[<tt>--tasks</tt> (-T)]
|
84
|
+
Display a list of the major tasks and their comments. Comments
|
85
|
+
are defined using the "desc" command.
|
86
|
+
|
87
|
+
[<tt>--trace</tt> (-t)]
|
88
|
+
Turn on invoke/execute tracing. Also enable full backtrace on
|
89
|
+
errors.
|
90
|
+
|
91
|
+
[<tt>--usage</tt> (-h)]
|
92
|
+
Display a usage message and exit.
|
93
|
+
|
94
|
+
[<tt>--verbose</tt> (-v)]
|
95
|
+
Echo the Sys commands to standard output.
|
96
|
+
|
97
|
+
[<tt>--version</tt> (-V)]
|
98
|
+
Display the program version and exit.
|
99
|
+
|
100
|
+
In addition, any command line option of the form
|
101
|
+
<em>VAR</em>=<em>VALUE</em> will be added to the environment hash
|
102
|
+
<tt>ENV</tt> and may be tested in the Rakefile.
|
data/doc/rakefile.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= Rakefile Format (as of version 0.8.
|
1
|
+
= Rakefile Format (as of version 0.8.3)
|
2
2
|
|
3
3
|
First of all, there is no special format for a Rakefile. A Rakefile
|
4
4
|
contains executable Ruby code. Anything legal in a ruby script is
|
@@ -225,8 +225,8 @@ where we specify default values for the first and last names:
|
|
225
225
|
=== Tasks that Expect Parameters and Have Prerequisites
|
226
226
|
|
227
227
|
Tasks that use parameters have a slightly different format for
|
228
|
-
prerequisites. Use the
|
229
|
-
|
228
|
+
prerequisites. Use the arrow notation to indicate the prerequisites
|
229
|
+
for tasks with arguments. For example:
|
230
230
|
|
231
231
|
task :name, [:first_name, :last_name] => [:pre_name] do |t, args|
|
232
232
|
args.with_defaults(:first_name => "John", :last_name => "Dough")
|
@@ -237,7 +237,7 @@ prerequisites for tasks with arguments. For example:
|
|
237
237
|
=== Deprecated Task Parameters Format
|
238
238
|
|
239
239
|
There is an older format for declaring task parameters that omitted
|
240
|
-
the task array and used the :needs keyword to introduce the
|
240
|
+
the task argument array and used the :needs keyword to introduce the
|
241
241
|
dependencies. That format is still supported for compatibility, but
|
242
242
|
is not recommended for use.
|
243
243
|
|
@@ -0,0 +1,125 @@
|
|
1
|
+
= Rake 0.8.4 Released
|
2
|
+
|
3
|
+
Rake version 0.8.4 is a bug-fix release of rake.
|
4
|
+
|
5
|
+
== Changes
|
6
|
+
|
7
|
+
=== New Features / Enhancements in Version 0.8.4
|
8
|
+
|
9
|
+
* Case is preserved on rakefile names. (patch from James
|
10
|
+
M. Lawrence/quix)
|
11
|
+
|
12
|
+
* Windows system dir search order is now: HOME, HOMEDRIVE + HOMEPATH,
|
13
|
+
APPDATA, USERPROFILE (patch from Luis Lavena)
|
14
|
+
|
15
|
+
* MingGW is now recognized as a windows platform. (patch from Luis
|
16
|
+
Lavena)
|
17
|
+
|
18
|
+
=== Bug Fixes in Version 0.8.4
|
19
|
+
|
20
|
+
* Fixed stray ARGV option problem that was interfering with
|
21
|
+
Test::Unit::Runner. (patch from Pivotal Labs)
|
22
|
+
|
23
|
+
=== Infrastructure Improvements in Version 0.8.4
|
24
|
+
|
25
|
+
* Numerous fixes to the windows test suite (patch from Luis Lavena).
|
26
|
+
|
27
|
+
* Improved Rakefile case insensitivity testing (patch from Luis
|
28
|
+
Lavena).
|
29
|
+
|
30
|
+
* Better support for windows paths in the test task (patch from Simon
|
31
|
+
Chiang/bahuvrihi)
|
32
|
+
|
33
|
+
== What is Rake
|
34
|
+
|
35
|
+
Rake is a build tool similar to the make program in many ways. But
|
36
|
+
instead of cryptic make recipes, Rake uses standard Ruby code to
|
37
|
+
declare tasks and dependencies. You have the full power of a modern
|
38
|
+
scripting language built right into your build tool.
|
39
|
+
|
40
|
+
== Availability
|
41
|
+
|
42
|
+
The easiest way to get and install rake is via RubyGems ...
|
43
|
+
|
44
|
+
gem install rake (you may need root/admin privileges)
|
45
|
+
|
46
|
+
Otherwise, you can get it from the more traditional places:
|
47
|
+
|
48
|
+
Home Page:: http://rake.rubyforge.org/
|
49
|
+
Download:: http://rubyforge.org/project/showfiles.php?group_id=50
|
50
|
+
GitHub:: git://github.com/jimweirich/rake.git
|
51
|
+
|
52
|
+
== Task Argument Examples
|
53
|
+
|
54
|
+
Prior to version 0.8.0, rake was only able to handle command line
|
55
|
+
arguments of the form NAME=VALUE that were passed into Rake via the
|
56
|
+
ENV hash. Many folks had asked for some kind of simple command line
|
57
|
+
arguments, perhaps using "--" to separate regular task names from
|
58
|
+
argument values on the command line. The problem is that there was no
|
59
|
+
easy way to associate positional arguments on the command line with
|
60
|
+
different tasks. Suppose both tasks :a and :b expect a command line
|
61
|
+
argument: does the first value go with :a? What if :b is run first?
|
62
|
+
Should it then get the first command line argument.
|
63
|
+
|
64
|
+
Rake 0.8.0 solves this problem by explicitly passing values directly
|
65
|
+
to the tasks that need them. For example, if I had a release task
|
66
|
+
that required a version number, I could say:
|
67
|
+
|
68
|
+
rake release[0.8.4]
|
69
|
+
|
70
|
+
And the string "0.8.4" will be passed to the :release task. Multiple
|
71
|
+
arguments can be passed by separating them with a comma, for example:
|
72
|
+
|
73
|
+
rake name[john,doe]
|
74
|
+
|
75
|
+
Just a few words of caution. The rake task name and its arguments
|
76
|
+
need to be a single command line argument to rake. This generally
|
77
|
+
means no spaces. If spaces are needed, then the entire rake +
|
78
|
+
argument string should be quoted. Something like this:
|
79
|
+
|
80
|
+
rake "name[billy bob, smith]"
|
81
|
+
|
82
|
+
(Quoting rules vary between operating systems and shells, so make sure
|
83
|
+
you consult the proper docs for your OS/shell).
|
84
|
+
|
85
|
+
=== Tasks that Expect Parameters
|
86
|
+
|
87
|
+
Parameters are only given to tasks that are setup to expect them. In
|
88
|
+
order to handle named parameters, the task declaration syntax for
|
89
|
+
tasks has been extended slightly.
|
90
|
+
|
91
|
+
For example, a task that needs a first name and last name might be
|
92
|
+
declared as:
|
93
|
+
|
94
|
+
task :name, :first_name, :last_name
|
95
|
+
|
96
|
+
The first argument is still the name of the task (:name in this case).
|
97
|
+
The next to argumements are the names of the parameters expected by
|
98
|
+
:name (:first_name and :last_name in the example).
|
99
|
+
|
100
|
+
To access the values of the paramters, the block defining the task
|
101
|
+
behaviour can now accept a second parameter:
|
102
|
+
|
103
|
+
task :name, :first_name, :last_name do |t, args|
|
104
|
+
puts "First name is #{args.first_name}"
|
105
|
+
puts "Last name is #{args.last_name}"
|
106
|
+
end
|
107
|
+
|
108
|
+
The first argument of the block "t" is always bound to the current
|
109
|
+
task object. The second argument "args" is an open-struct like object
|
110
|
+
that allows access to the task arguments. Extra command line
|
111
|
+
arguments to a task are ignored. Missing command line arguments are
|
112
|
+
given the nil value.
|
113
|
+
|
114
|
+
== Thanks
|
115
|
+
|
116
|
+
As usual, it was input from users that drove a alot of these changes. The
|
117
|
+
following people either contributed patches, made suggestions or made
|
118
|
+
otherwise helpful comments. Thanks to ...
|
119
|
+
|
120
|
+
* James M. Lawrence/quix
|
121
|
+
* Luis Lavena
|
122
|
+
* Pivotal Labs
|
123
|
+
* Simon Chiang/bahuvrihi
|
124
|
+
|
125
|
+
-- Jim Weirich
|
data/lib/rake/gempackagetask.rb
CHANGED
@@ -9,12 +9,6 @@ require 'rake/packagetask'
|
|
9
9
|
require 'rubygems/user_interaction'
|
10
10
|
require 'rubygems/builder'
|
11
11
|
|
12
|
-
begin
|
13
|
-
Gem.manage_gems
|
14
|
-
rescue NoMethodError => ex
|
15
|
-
# Using rubygems prior to 0.6.1
|
16
|
-
end
|
17
|
-
|
18
12
|
module Rake
|
19
13
|
|
20
14
|
# Create a package based upon a Gem spec. Gem packages, as well as
|
@@ -4,11 +4,13 @@ module Rake
|
|
4
4
|
|
5
5
|
# Makefile loader to be used with the import file loader.
|
6
6
|
class MakefileLoader
|
7
|
+
SPACE_MARK = "__&NBSP;__"
|
7
8
|
|
8
9
|
# Load the makefile dependencies in +fn+.
|
9
10
|
def load(fn)
|
10
11
|
open(fn) do |mf|
|
11
12
|
lines = mf.read
|
13
|
+
lines.gsub!(/\\ /, SPACE_MARK)
|
12
14
|
lines.gsub!(/#[^\n]*\n/m, "")
|
13
15
|
lines.gsub!(/\\\n/, ' ')
|
14
16
|
lines.split("\n").each do |line|
|
@@ -23,11 +25,16 @@ module Rake
|
|
23
25
|
def process_line(line)
|
24
26
|
file_tasks, args = line.split(':')
|
25
27
|
return if args.nil?
|
26
|
-
dependents = args.split
|
28
|
+
dependents = args.split.map { |d| respace(d) }
|
27
29
|
file_tasks.strip.split.each do |file_task|
|
30
|
+
file_task = respace(file_task)
|
28
31
|
file file_task => dependents
|
29
32
|
end
|
30
33
|
end
|
34
|
+
|
35
|
+
def respace(str)
|
36
|
+
str.gsub(/#{SPACE_MARK}/, ' ')
|
37
|
+
end
|
31
38
|
end
|
32
39
|
|
33
40
|
# Install the handler
|
data/lib/rake/packagetask.rb
CHANGED