drake 0.8.2.1.0.13 → 0.8.3.1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +10 -0
- data/CHANGES.drake +4 -0
- data/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/lib/rake.rb +20 -45
- data/lib/rake/win32.rb +54 -0
- data/test/rake_test_setup.rb +7 -2
- data/test/test_application.rb +4 -24
- data/test/test_win32.rb +57 -0
- metadata +6 -2
data/CHANGES
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
|
2
2
|
= Rake Changelog
|
3
3
|
|
4
|
+
== Version 0.8.3
|
5
|
+
|
6
|
+
* Enhanced the system directory detection in windows. We now check
|
7
|
+
HOMEDRIVE/HOMEPATH and USERPROFILE if APPDATA isn't found. (Patch
|
8
|
+
supplied by James Tucker). Rake no long aborts if it can't find the
|
9
|
+
directory.
|
10
|
+
|
11
|
+
* Added fix to handle ruby installations in directories with spaces in
|
12
|
+
their name.
|
13
|
+
|
4
14
|
== Version 0.8.2
|
5
15
|
|
6
16
|
* Fixed bug in package task so that it will include the subdir
|
data/CHANGES.drake
CHANGED
@@ -0,0 +1,112 @@
|
|
1
|
+
= Rake 0.8.3 Released
|
2
|
+
|
3
|
+
Rake version 0.8.3 is a bug-fix release of rake.
|
4
|
+
|
5
|
+
== Changes
|
6
|
+
|
7
|
+
=== Bug Fixes in Version 0.8.3
|
8
|
+
|
9
|
+
* Enhanced the system directory detection in windows. We now check
|
10
|
+
HOMEDRIVE/HOMEPATH and USERPROFILE if APPDATA isn't found. (Patch
|
11
|
+
supplied by James Tucker). Rake no long aborts if it can't find the
|
12
|
+
directory.
|
13
|
+
|
14
|
+
* Added fix to handle ruby installations in directories with spaces in
|
15
|
+
their name.
|
16
|
+
|
17
|
+
== What is Rake
|
18
|
+
|
19
|
+
Rake is a build tool similar to the make program in many ways. But
|
20
|
+
instead of cryptic make recipes, Rake uses standard Ruby code to
|
21
|
+
declare tasks and dependencies. You have the full power of a modern
|
22
|
+
scripting language built right into your build tool.
|
23
|
+
|
24
|
+
== Availability
|
25
|
+
|
26
|
+
The easiest way to get and install rake is via RubyGems ...
|
27
|
+
|
28
|
+
gem install rake (you may need root/admin privileges)
|
29
|
+
|
30
|
+
Otherwise, you can get it from the more traditional places:
|
31
|
+
|
32
|
+
Home Page:: http://rake.rubyforge.org/
|
33
|
+
Download:: http://rubyforge.org/project/showfiles.php?group_id=50
|
34
|
+
|
35
|
+
== Task Argument Examples
|
36
|
+
|
37
|
+
Prior to version 0.8.0, rake was only able to handle command line
|
38
|
+
arguments of the form NAME=VALUE that were passed into Rake via the
|
39
|
+
ENV hash. Many folks had asked for some kind of simple command line
|
40
|
+
arguments, perhaps using "--" to separate regular task names from
|
41
|
+
argument values on the command line. The problem is that there was no
|
42
|
+
easy way to associate positional arguments on the command line with
|
43
|
+
different tasks. Suppose both tasks :a and :b expect a command line
|
44
|
+
argument: does the first value go with :a? What if :b is run first?
|
45
|
+
Should it then get the first command line argument.
|
46
|
+
|
47
|
+
Rake 0.8.0 solves this problem by explicitly passing values directly
|
48
|
+
to the tasks that need them. For example, if I had a release task
|
49
|
+
that required a version number, I could say:
|
50
|
+
|
51
|
+
rake release[0.8.3]
|
52
|
+
|
53
|
+
And the string "0.8.3" will be passed to the :release task. Multiple
|
54
|
+
arguments can be passed by separating them with a comma, for example:
|
55
|
+
|
56
|
+
rake name[john,doe]
|
57
|
+
|
58
|
+
Just a few words of caution. The rake task name and its arguments
|
59
|
+
need to be a single command line argument to rake. This generally
|
60
|
+
means no spaces. If spaces are needed, then the entire rake +
|
61
|
+
argument string should be quoted. Something like this:
|
62
|
+
|
63
|
+
rake "name[billy bob, smith]"
|
64
|
+
|
65
|
+
(Quoting rules vary between operating systems and shells, so make sure
|
66
|
+
you consult the proper docs for your OS/shell).
|
67
|
+
|
68
|
+
=== Tasks that Expect Parameters
|
69
|
+
|
70
|
+
Parameters are only given to tasks that are setup to expect them. In
|
71
|
+
order to handle named parameters, the task declaration syntax for
|
72
|
+
tasks has been extended slightly.
|
73
|
+
|
74
|
+
For example, a task that needs a first name and last name might be
|
75
|
+
declared as:
|
76
|
+
|
77
|
+
task :name, :first_name, :last_name
|
78
|
+
|
79
|
+
The first argument is still the name of the task (:name in this case).
|
80
|
+
The next to argumements are the names of the parameters expected by
|
81
|
+
:name (:first_name and :last_name in the example).
|
82
|
+
|
83
|
+
To access the values of the paramters, the block defining the task
|
84
|
+
behaviour can now accept a second parameter:
|
85
|
+
|
86
|
+
task :name, :first_name, :last_name do |t, args|
|
87
|
+
puts "First name is #{args.first_name}"
|
88
|
+
puts "Last name is #{args.last_name}"
|
89
|
+
end
|
90
|
+
|
91
|
+
The first argument of the block "t" is always bound to the current
|
92
|
+
task object. The second argument "args" is an open-struct like object
|
93
|
+
that allows access to the task arguments. Extra command line
|
94
|
+
arguments to a task are ignored. Missing command line arguments are
|
95
|
+
given the nil value.
|
96
|
+
|
97
|
+
== Thanks
|
98
|
+
|
99
|
+
As usual, it was input from users that drove a alot of these changes. The
|
100
|
+
following people either contributed patches, made suggestions or made
|
101
|
+
otherwise helpful comments. Thanks to ...
|
102
|
+
|
103
|
+
* Edwin Pratomo
|
104
|
+
* Gavin Stark
|
105
|
+
* Adam Q. Salter
|
106
|
+
* Adam Majer
|
107
|
+
* Emanuel Inderm�hle
|
108
|
+
* Ittay Dror
|
109
|
+
* Bheeshmar Redheendran (for spending an afternoon with me debugging
|
110
|
+
windows issues)
|
111
|
+
|
112
|
+
-- Jim Weirich
|
data/lib/rake.rb
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
# as a library via a require statement, but it can be distributed
|
30
30
|
# independently as an application.
|
31
31
|
|
32
|
-
RAKEVERSION = '0.8.
|
32
|
+
RAKEVERSION = '0.8.3.1.0.14'
|
33
33
|
|
34
34
|
require 'rbconfig'
|
35
35
|
require 'fileutils'
|
@@ -39,6 +39,8 @@ require 'optparse'
|
|
39
39
|
require 'ostruct'
|
40
40
|
require 'rake/parallel'
|
41
41
|
|
42
|
+
require 'rake/win32'
|
43
|
+
|
42
44
|
######################################################################
|
43
45
|
# Rake extensions to Module.
|
44
46
|
#
|
@@ -262,11 +264,6 @@ module Rake
|
|
262
264
|
end
|
263
265
|
end
|
264
266
|
|
265
|
-
# Error indicating a problem in locating the home directory on a
|
266
|
-
# Win32 system.
|
267
|
-
class Win32HomeError < RuntimeError
|
268
|
-
end
|
269
|
-
|
270
267
|
# --------------------------------------------------------------------------
|
271
268
|
# Rake module singleton methods.
|
272
269
|
#
|
@@ -1032,7 +1029,8 @@ end
|
|
1032
1029
|
# added to the FileUtils utility functions.
|
1033
1030
|
#
|
1034
1031
|
module FileUtils
|
1035
|
-
RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
|
1032
|
+
RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']).
|
1033
|
+
sub(/.*\s.*/m, '"\&"')
|
1036
1034
|
|
1037
1035
|
OPT_TABLE['sh'] = %w(noop verbose)
|
1038
1036
|
OPT_TABLE['ruby'] = %w(noop verbose)
|
@@ -1078,23 +1076,14 @@ module FileUtils
|
|
1078
1076
|
end
|
1079
1077
|
|
1080
1078
|
def rake_system(*cmd)
|
1081
|
-
if Rake.
|
1082
|
-
|
1079
|
+
if Rake::Win32.windows?
|
1080
|
+
Rake::Win32.rake_system(*cmd)
|
1083
1081
|
else
|
1084
1082
|
system(*cmd)
|
1085
1083
|
end
|
1086
1084
|
end
|
1087
1085
|
private :rake_system
|
1088
1086
|
|
1089
|
-
def rake_win32_system(*cmd)
|
1090
|
-
if cmd.size == 1
|
1091
|
-
system("call #{cmd}")
|
1092
|
-
else
|
1093
|
-
system(*cmd)
|
1094
|
-
end
|
1095
|
-
end
|
1096
|
-
private :rake_win32_system
|
1097
|
-
|
1098
1087
|
# Run a Ruby interpreter with the given arguments.
|
1099
1088
|
#
|
1100
1089
|
# Example:
|
@@ -2244,7 +2233,7 @@ module Rake
|
|
2244
2233
|
end
|
2245
2234
|
|
2246
2235
|
def windows?
|
2247
|
-
|
2236
|
+
Win32.windows?
|
2248
2237
|
end
|
2249
2238
|
|
2250
2239
|
def truncate(string, width)
|
@@ -2457,7 +2446,7 @@ module Rake
|
|
2457
2446
|
rakefile, location = find_rakefile_location
|
2458
2447
|
if (! options.ignore_system) &&
|
2459
2448
|
(options.load_system || rakefile.nil?) &&
|
2460
|
-
directory?(system_dir)
|
2449
|
+
system_dir && File.directory?(system_dir)
|
2461
2450
|
puts "(in #{Dir.pwd})" unless options.silent
|
2462
2451
|
glob("#{system_dir}/*.rake") do |name|
|
2463
2452
|
add_import name
|
@@ -2486,38 +2475,24 @@ module Rake
|
|
2486
2475
|
|
2487
2476
|
# The directory path containing the system wide rakefiles.
|
2488
2477
|
def system_dir
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2478
|
+
@system_dir ||=
|
2479
|
+
begin
|
2480
|
+
if ENV['RAKE_SYSTEM']
|
2481
|
+
ENV['RAKE_SYSTEM']
|
2482
|
+
elsif Win32.windows?
|
2483
|
+
Win32.win32_system_dir
|
2484
|
+
else
|
2485
|
+
standard_system_dir
|
2486
|
+
end
|
2487
|
+
end
|
2496
2488
|
end
|
2497
|
-
|
2489
|
+
|
2498
2490
|
# The standard directory containing system wide rake files.
|
2499
2491
|
def standard_system_dir #:nodoc:
|
2500
2492
|
File.join(File.expand_path('~'), '.rake')
|
2501
2493
|
end
|
2502
2494
|
private :standard_system_dir
|
2503
2495
|
|
2504
|
-
# The standard directory containing system wide rake files on Win
|
2505
|
-
# 32 systems.
|
2506
|
-
def win32_system_dir #:nodoc:
|
2507
|
-
win32home = File.join(ENV['APPDATA'], 'Rake')
|
2508
|
-
unless directory?(win32home)
|
2509
|
-
raise Win32HomeError, "Unable to determine home path environment variable."
|
2510
|
-
else
|
2511
|
-
win32home
|
2512
|
-
end
|
2513
|
-
end
|
2514
|
-
private :win32_system_dir
|
2515
|
-
|
2516
|
-
def directory?(path)
|
2517
|
-
File.directory?(path)
|
2518
|
-
end
|
2519
|
-
private :directory?
|
2520
|
-
|
2521
2496
|
# Collect the list of tasks on the command line. If no tasks are
|
2522
2497
|
# given, return a list containing only the default task.
|
2523
2498
|
# Environmental assignments are processed at this time as well.
|
data/lib/rake/win32.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
module Rake
|
2
|
+
|
3
|
+
# Win 32 interface methods for Rake. Windows specific functionality
|
4
|
+
# will be placed here to collect that knowledge in one spot.
|
5
|
+
module Win32
|
6
|
+
|
7
|
+
# Error indicating a problem in locating the home directory on a
|
8
|
+
# Win32 system.
|
9
|
+
class Win32HomeError < RuntimeError
|
10
|
+
end
|
11
|
+
|
12
|
+
class << self
|
13
|
+
# True if running on a windows system.
|
14
|
+
def windows?
|
15
|
+
Config::CONFIG['host_os'] =~ /mswin/
|
16
|
+
end
|
17
|
+
|
18
|
+
# Run a command line on windows.
|
19
|
+
def rake_system(*cmd)
|
20
|
+
if cmd.size == 1
|
21
|
+
system("call #{cmd}")
|
22
|
+
else
|
23
|
+
system(*cmd)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# The standard directory containing system wide rake files on
|
28
|
+
# Win 32 systems. Try the following environment variables (in
|
29
|
+
# order):
|
30
|
+
#
|
31
|
+
# * APPDATA
|
32
|
+
# * HOMEDRIVE + HOMEPATH
|
33
|
+
# * USERPROFILE
|
34
|
+
#
|
35
|
+
# If the above are not defined, the return nil.
|
36
|
+
def win32_system_dir #:nodoc:
|
37
|
+
win32_shared_path = ENV['APPDATA']
|
38
|
+
if win32_shared_path.nil? && ENV['HOMEDRIVE'] && ENV['HOMEPATH']
|
39
|
+
win32_shared_path = ENV['HOMEDRIVE'] + ENV['HOMEPATH']
|
40
|
+
end
|
41
|
+
win32_shared_path ||= ENV['USERPROFILE']
|
42
|
+
raise Win32HomeError, "Unable to determine home path environment variable." if
|
43
|
+
win32_shared_path.nil? or win32_shared_path.empty?
|
44
|
+
normalize(File.join(win32_shared_path, 'Rake'))
|
45
|
+
end
|
46
|
+
|
47
|
+
# Normalize a win32 path so that the slashes are all forward slashes.
|
48
|
+
def normalize(path)
|
49
|
+
path.gsub(/\\/, '/')
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/test/rake_test_setup.rb
CHANGED
data/test/test_application.rb
CHANGED
@@ -109,7 +109,7 @@ class TestApplication < Test::Unit::TestCase
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def test_finding_rakefile
|
112
|
-
|
112
|
+
assert_match(/[Rr]akefile/, @app.instance_eval { have_rakefile })
|
113
113
|
end
|
114
114
|
|
115
115
|
def test_not_finding_rakefile
|
@@ -193,10 +193,10 @@ class TestApplication < Test::Unit::TestCase
|
|
193
193
|
end
|
194
194
|
|
195
195
|
def test_load_from_system_rakefile_on_windows
|
196
|
-
flexmock(
|
197
|
-
|
196
|
+
flexmock(Rake::Win32, :windows? => true)
|
197
|
+
flexmock(@app, :standard_system_dir => "XX")
|
198
198
|
flexmock(@app).should_receive(:directory?).with("/AD/Rake").and_return(true)
|
199
|
-
flexmock(@app).should_receive(:load).and_return
|
199
|
+
flexmock(@app).should_receive(:load).and_return(nil)
|
200
200
|
in_environment('RAKE_SYSTEM' => nil, 'APPDATA' => '/AD') do
|
201
201
|
@app.options.rakelib = []
|
202
202
|
@app.instance_eval do
|
@@ -209,26 +209,6 @@ class TestApplication < Test::Unit::TestCase
|
|
209
209
|
end
|
210
210
|
end
|
211
211
|
|
212
|
-
def test_load_from_system_rakefile_on_windows_with_no_appdata
|
213
|
-
flexmock(@app, :windows? => true,
|
214
|
-
:standard_system_dir => "XX"
|
215
|
-
)
|
216
|
-
flexmock(File).should_receive(:exists?).with("/AD/Rake").and_return(false)
|
217
|
-
out = capture_stderr do
|
218
|
-
assert_raise(SystemExit) do
|
219
|
-
in_environment('RAKE_SYSTEM' => nil, 'APPDATA' => "/AD") do
|
220
|
-
@app.options.rakelib = []
|
221
|
-
@app.instance_eval do
|
222
|
-
handle_options
|
223
|
-
options.silent = true
|
224
|
-
options.load_system = true
|
225
|
-
load_rakefile
|
226
|
-
end
|
227
|
-
end
|
228
|
-
end
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
212
|
def test_loading_imports
|
233
213
|
mock = flexmock("loader")
|
234
214
|
mock.should_receive(:load).with("x.dummy").once
|
data/test/test_win32.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'test/rake_test_setup'
|
5
|
+
require 'test/in_environment'
|
6
|
+
|
7
|
+
require 'rake'
|
8
|
+
|
9
|
+
class TestWin32 < Test::Unit::TestCase
|
10
|
+
include InEnvironment
|
11
|
+
|
12
|
+
Win32 = Rake::Win32
|
13
|
+
|
14
|
+
def test_win32_system_dir_uses_appdata_if_defined
|
15
|
+
in_environment('RAKE_SYSTEM' => nil, 'APPDATA' => '\\AD') do
|
16
|
+
assert_equal "/AD/Rake", Win32.win32_system_dir
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_win32_system_dir_uses_homedrive_otherwise
|
21
|
+
in_environment(
|
22
|
+
'RAKE_SYSTEM' => nil,
|
23
|
+
'APPDATA' => nil,
|
24
|
+
'HOMEDRIVE' => "C:",
|
25
|
+
"HOMEPATH" => "\\HP"
|
26
|
+
) do
|
27
|
+
assert_equal "C:/HP/Rake", Win32.win32_system_dir
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_win32_system_dir_uses_userprofile_otherwise
|
32
|
+
in_environment(
|
33
|
+
'RAKE_SYSTEM' => nil,
|
34
|
+
'APPDATA' => nil,
|
35
|
+
'HOMEDRIVE' => nil,
|
36
|
+
"HOMEPATH" => nil,
|
37
|
+
"USERPROFILE" => '\\UP'
|
38
|
+
) do
|
39
|
+
assert_equal "/UP/Rake", Win32.win32_system_dir
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_win32_system_dir_nil_of_no_env_vars
|
44
|
+
in_environment(
|
45
|
+
'RAKE_SYSTEM' => nil,
|
46
|
+
'APPDATA' => nil,
|
47
|
+
'HOMEDRIVE' => nil,
|
48
|
+
"HOMEPATH" => nil,
|
49
|
+
"USERPROFILE" => nil
|
50
|
+
) do
|
51
|
+
assert_raise(Rake::Win32::Win32HomeError) do
|
52
|
+
Win32.win32_system_dir
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3.1.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James M. Lawrence
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-09-
|
12
|
+
date: 2008-09-25 00:00:00 -04:00
|
13
13
|
default_executable: drake
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -40,6 +40,7 @@ extra_rdoc_files:
|
|
40
40
|
- doc/release_notes/rake-0.7.3.rdoc
|
41
41
|
- doc/release_notes/rake-0.8.0.rdoc
|
42
42
|
- doc/release_notes/rake-0.8.2.rdoc
|
43
|
+
- doc/release_notes/rake-0.8.3.rdoc
|
43
44
|
files:
|
44
45
|
- install.rb
|
45
46
|
- CHANGES
|
@@ -68,6 +69,7 @@ files:
|
|
68
69
|
- lib/rake/runtest.rb
|
69
70
|
- lib/rake/tasklib.rb
|
70
71
|
- lib/rake/testtask.rb
|
72
|
+
- lib/rake/win32.rb
|
71
73
|
- lib/rake.rb
|
72
74
|
- lib/rake/comp_tree/algorithm.rb
|
73
75
|
- lib/rake/comp_tree/diagnostic.rb
|
@@ -118,6 +120,7 @@ files:
|
|
118
120
|
- test/test_tasks.rb
|
119
121
|
- test/test_test_task.rb
|
120
122
|
- test/test_top_level_functions.rb
|
123
|
+
- test/test_win32.rb
|
121
124
|
- test/data/imports/deps.mf
|
122
125
|
- test/data/sample.mf
|
123
126
|
- test/Rakefile.seq
|
@@ -157,6 +160,7 @@ files:
|
|
157
160
|
- doc/release_notes/rake-0.7.3.rdoc
|
158
161
|
- doc/release_notes/rake-0.8.0.rdoc
|
159
162
|
- doc/release_notes/rake-0.8.2.rdoc
|
163
|
+
- doc/release_notes/rake-0.8.3.rdoc
|
160
164
|
has_rdoc: true
|
161
165
|
homepage: http://drake.rubyforge.org
|
162
166
|
post_install_message:
|