rake 0.9.6 → 10.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rake might be problematic. Click here for more details.
- data/README.rdoc +12 -0
- data/Rakefile +0 -1
- data/doc/command_line_usage.rdoc +17 -60
- data/doc/release_notes/rake-0.9.3.rdoc +23 -70
- data/lib/rake.rb +0 -1
- data/lib/rake/application.rb +23 -63
- data/lib/rake/backtrace.rb +2 -3
- data/lib/rake/contrib/ftptools.rb +2 -2
- data/lib/rake/dsl_definition.rb +0 -26
- data/lib/rake/ext/module.rb +0 -39
- data/lib/rake/ext/string.rb +1 -2
- data/lib/rake/ext/time.rb +1 -2
- data/lib/rake/file_list.rb +1 -8
- data/lib/rake/file_utils.rb +1 -1
- data/lib/rake/phony.rb +2 -4
- data/lib/rake/rake_module.rb +7 -0
- data/lib/rake/ruby182_test_unit_fix.rb +0 -0
- data/lib/rake/runtest.rb +1 -2
- data/lib/rake/task.rb +8 -9
- data/lib/rake/task_manager.rb +0 -11
- data/lib/rake/testtask.rb +1 -4
- data/lib/rake/thread_history_display.rb +4 -7
- data/lib/rake/thread_pool.rb +76 -42
- data/lib/rake/version.rb +6 -7
- data/test/helper.rb +4 -44
- data/test/test_rake_application.rb +0 -47
- data/test/test_rake_application_options.rb +6 -39
- data/test/test_rake_backtrace.rb +11 -33
- data/test/test_rake_dsl.rb +0 -37
- data/test/test_rake_file_task.rb +4 -4
- data/test/test_rake_functional.rb +8 -32
- data/test/test_rake_rake_test_loader.rb +1 -1
- data/test/test_rake_reduce_compat.rb +5 -33
- data/test/test_rake_task_manager_argument_resolution.rb +0 -5
- data/test/test_rake_task_with_arguments.rb +6 -17
- data/test/test_rake_thread_pool.rb +24 -1
- data/test/test_rake_top_level_functions.rb +0 -40
- data/test/test_thread_history_display.rb +14 -14
- metadata +3 -22
- data/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
- data/doc/release_notes/rake-0.9.4.rdoc +0 -110
- data/doc/release_notes/rake-0.9.5.rdoc +0 -114
- data/doc/release_notes/rake-0.9.6.rdoc +0 -127
- data/lib/rake/classic_namespace.rb +0 -11
- data/lib/rake/contrib/sys.rb +0 -192
- data/lib/rake/gempackagetask.rb +0 -15
- data/lib/rake/private_reader.rb +0 -20
- data/lib/rake/promise.rb +0 -99
- data/lib/rake/rdoctask.rb +0 -234
- data/lib/rake/trace_output.rb +0 -19
- data/test/test_private_reader.rb +0 -42
- data/test/test_rake_rdoc_task.rb +0 -83
- data/test/test_sys.rb +0 -20
- data/test/test_trace_output.rb +0 -43
data/lib/rake/gempackagetask.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# rake/gempackagetask is deprecated in favor of rubygems/package_task
|
2
|
-
|
3
|
-
warn 'rake/gempackagetask is deprecated. Use rubygems/package_task instead'
|
4
|
-
|
5
|
-
require 'rubygems'
|
6
|
-
require 'rubygems/package_task'
|
7
|
-
|
8
|
-
require 'rake'
|
9
|
-
|
10
|
-
# :stopdoc:
|
11
|
-
|
12
|
-
module Rake
|
13
|
-
GemPackageTask = Gem::PackageTask
|
14
|
-
end
|
15
|
-
|
data/lib/rake/private_reader.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module Rake
|
2
|
-
|
3
|
-
# Include PrivateReader to use +private_reader+.
|
4
|
-
module PrivateReader # :nodoc: all
|
5
|
-
|
6
|
-
def self.included(base)
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
|
-
|
12
|
-
# Declare a list of private accessors
|
13
|
-
def private_reader(*names)
|
14
|
-
attr_reader(*names)
|
15
|
-
private(*names)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
data/lib/rake/promise.rb
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
module Rake
|
2
|
-
|
3
|
-
# A Promise object represents a promise to do work (a chore) in the
|
4
|
-
# future. The promise is created with a block and a list of
|
5
|
-
# arguments for the block. Calling value will return the value of
|
6
|
-
# the promised chore.
|
7
|
-
#
|
8
|
-
# Used by ThreadPool.
|
9
|
-
#
|
10
|
-
class Promise # :nodoc: all
|
11
|
-
NOT_SET = Object.new.freeze # :nodoc:
|
12
|
-
|
13
|
-
attr_accessor :recorder
|
14
|
-
|
15
|
-
# Create a promise to do the chore specified by the block.
|
16
|
-
def initialize(args, &block)
|
17
|
-
@mutex = Mutex.new
|
18
|
-
@result = NOT_SET
|
19
|
-
@error = NOT_SET
|
20
|
-
@args = args.collect { |a| begin; a.dup; rescue; a; end }
|
21
|
-
@block = block
|
22
|
-
end
|
23
|
-
|
24
|
-
# Return the value of this promise.
|
25
|
-
#
|
26
|
-
# If the promised chore is not yet complete, then do the work
|
27
|
-
# synchronously. We will wait.
|
28
|
-
def value
|
29
|
-
unless complete?
|
30
|
-
stat :sleeping_on, :item_id => object_id
|
31
|
-
@mutex.synchronize do
|
32
|
-
stat :has_lock_on, :item_id => object_id
|
33
|
-
chore
|
34
|
-
stat :releasing_lock_on, :item_id => object_id
|
35
|
-
end
|
36
|
-
end
|
37
|
-
error? ? raise(@error) : @result
|
38
|
-
end
|
39
|
-
|
40
|
-
# If no one else is working this promise, go ahead and do the chore.
|
41
|
-
def work
|
42
|
-
stat :attempting_lock_on, :item_id => object_id
|
43
|
-
if @mutex.try_lock
|
44
|
-
stat :has_lock_on, :item_id => object_id
|
45
|
-
chore
|
46
|
-
stat :releasing_lock_on, :item_id => object_id
|
47
|
-
@mutex.unlock
|
48
|
-
else
|
49
|
-
stat :bailed_on, :item_id => object_id
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
|
55
|
-
# Perform the chore promised
|
56
|
-
def chore
|
57
|
-
if complete?
|
58
|
-
stat :found_completed, :item_id => object_id
|
59
|
-
return
|
60
|
-
end
|
61
|
-
stat :will_execute, :item_id => object_id
|
62
|
-
begin
|
63
|
-
@result = @block.call(*@args)
|
64
|
-
rescue Exception => e
|
65
|
-
@error = e
|
66
|
-
end
|
67
|
-
stat :did_execute, :item_id => object_id
|
68
|
-
discard
|
69
|
-
end
|
70
|
-
|
71
|
-
# Do we have a result for the promise
|
72
|
-
def result?
|
73
|
-
! @result.equal?(NOT_SET)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Did the promise throw an error
|
77
|
-
def error?
|
78
|
-
! @error.equal?(NOT_SET)
|
79
|
-
end
|
80
|
-
|
81
|
-
# Are we done with the promise
|
82
|
-
def complete?
|
83
|
-
result? || error?
|
84
|
-
end
|
85
|
-
|
86
|
-
# free up these items for the GC
|
87
|
-
def discard
|
88
|
-
@args = nil
|
89
|
-
@block = nil
|
90
|
-
end
|
91
|
-
|
92
|
-
# Record execution statistics if there is a recorder
|
93
|
-
def stat(*args)
|
94
|
-
@recorder.call(*args) if @recorder
|
95
|
-
end
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
end
|
data/lib/rake/rdoctask.rb
DELETED
@@ -1,234 +0,0 @@
|
|
1
|
-
# rake/rdoctask is deprecated in favor of rdoc/task
|
2
|
-
|
3
|
-
if Rake.application
|
4
|
-
Rake.application.deprecate('require \'rake/rdoctask\'', 'require \'rdoc/task\' (in RDoc 2.4.2+)', caller.first)
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'rubygems'
|
8
|
-
|
9
|
-
begin
|
10
|
-
gem 'rdoc'
|
11
|
-
require 'rdoc'
|
12
|
-
require 'rdoc/task'
|
13
|
-
rescue LoadError, Gem::LoadError
|
14
|
-
end
|
15
|
-
|
16
|
-
# :stopdoc:
|
17
|
-
|
18
|
-
if defined?(RDoc::Task) then
|
19
|
-
module Rake
|
20
|
-
RDocTask = RDoc::Task unless const_defined? :RDocTask
|
21
|
-
end
|
22
|
-
else
|
23
|
-
require 'rake'
|
24
|
-
require 'rake/tasklib'
|
25
|
-
|
26
|
-
module Rake
|
27
|
-
|
28
|
-
# NOTE: Rake::RDocTask is deprecated in favor of RDoc:Task which is included
|
29
|
-
# in RDoc 2.4.2+. Use require 'rdoc/task' to require it.
|
30
|
-
#
|
31
|
-
# Create a documentation task that will generate the RDoc files for
|
32
|
-
# a project.
|
33
|
-
#
|
34
|
-
# The RDocTask will create the following targets:
|
35
|
-
#
|
36
|
-
# [<b><em>rdoc</em></b>]
|
37
|
-
# Main task for this RDOC task.
|
38
|
-
#
|
39
|
-
# [<b>:clobber_<em>rdoc</em></b>]
|
40
|
-
# Delete all the rdoc files. This target is automatically
|
41
|
-
# added to the main clobber target.
|
42
|
-
#
|
43
|
-
# [<b>:re<em>rdoc</em></b>]
|
44
|
-
# Rebuild the rdoc files from scratch, even if they are not out
|
45
|
-
# of date.
|
46
|
-
#
|
47
|
-
# Simple Example:
|
48
|
-
#
|
49
|
-
# Rake::RDocTask.new do |rd|
|
50
|
-
# rd.main = "README.rdoc"
|
51
|
-
# rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
|
52
|
-
# end
|
53
|
-
#
|
54
|
-
# The +rd+ object passed to the block is an RDocTask object. See the
|
55
|
-
# attributes list for the RDocTask class for available customization options.
|
56
|
-
#
|
57
|
-
# == Specifying different task names
|
58
|
-
#
|
59
|
-
# You may wish to give the task a different name, such as if you are
|
60
|
-
# generating two sets of documentation. For instance, if you want to have a
|
61
|
-
# development set of documentation including private methods:
|
62
|
-
#
|
63
|
-
# Rake::RDocTask.new(:rdoc_dev) do |rd|
|
64
|
-
# rd.main = "README.doc"
|
65
|
-
# rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
|
66
|
-
# rd.options << "--all"
|
67
|
-
# end
|
68
|
-
#
|
69
|
-
# The tasks would then be named :<em>rdoc_dev</em>, :clobber_<em>rdoc_dev</em>, and
|
70
|
-
# :re<em>rdoc_dev</em>.
|
71
|
-
#
|
72
|
-
# If you wish to have completely different task names, then pass a Hash as
|
73
|
-
# first argument. With the <tt>:rdoc</tt>, <tt>:clobber_rdoc</tt> and
|
74
|
-
# <tt>:rerdoc</tt> options, you can customize the task names to your liking.
|
75
|
-
# For example:
|
76
|
-
#
|
77
|
-
# Rake::RDocTask.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force")
|
78
|
-
#
|
79
|
-
# This will create the tasks <tt>:rdoc</tt>, <tt>:rdoc_clean</tt> and
|
80
|
-
# <tt>:rdoc:force</tt>.
|
81
|
-
#
|
82
|
-
class RDocTask < TaskLib
|
83
|
-
# Name of the main, top level task. (default is :rdoc)
|
84
|
-
attr_accessor :name
|
85
|
-
|
86
|
-
# Name of directory to receive the html output files. (default is "html")
|
87
|
-
attr_accessor :rdoc_dir
|
88
|
-
|
89
|
-
# Title of RDoc documentation. (defaults to rdoc's default)
|
90
|
-
attr_accessor :title
|
91
|
-
|
92
|
-
# Name of file to be used as the main, top level file of the
|
93
|
-
# RDoc. (default is none)
|
94
|
-
attr_accessor :main
|
95
|
-
|
96
|
-
# Name of template to be used by rdoc. (defaults to rdoc's default)
|
97
|
-
attr_accessor :template
|
98
|
-
|
99
|
-
# List of files to be included in the rdoc generation. (default is [])
|
100
|
-
attr_accessor :rdoc_files
|
101
|
-
|
102
|
-
# Additional list of options to be passed rdoc. (default is [])
|
103
|
-
attr_accessor :options
|
104
|
-
|
105
|
-
# Whether to run the rdoc process as an external shell (default is false)
|
106
|
-
attr_accessor :external
|
107
|
-
|
108
|
-
attr_accessor :inline_source
|
109
|
-
|
110
|
-
# Create an RDoc task with the given name. See the RDocTask class overview
|
111
|
-
# for documentation.
|
112
|
-
def initialize(name = :rdoc) # :yield: self
|
113
|
-
if name.is_a?(Hash)
|
114
|
-
invalid_options = name.keys.map { |k| k.to_sym } - [:rdoc, :clobber_rdoc, :rerdoc]
|
115
|
-
if !invalid_options.empty?
|
116
|
-
raise ArgumentError, "Invalid option(s) passed to RDocTask.new: #{invalid_options.join(", ")}"
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
@name = name
|
121
|
-
@rdoc_files = Rake::FileList.new
|
122
|
-
@rdoc_dir = 'html'
|
123
|
-
@main = nil
|
124
|
-
@title = nil
|
125
|
-
@template = nil
|
126
|
-
@external = false
|
127
|
-
@inline_source = true
|
128
|
-
@options = []
|
129
|
-
yield self if block_given?
|
130
|
-
define
|
131
|
-
end
|
132
|
-
|
133
|
-
# Create the tasks defined by this task lib.
|
134
|
-
def define
|
135
|
-
if rdoc_task_name != "rdoc"
|
136
|
-
desc "Build the RDOC HTML Files"
|
137
|
-
else
|
138
|
-
desc "Build the #{rdoc_task_name} HTML Files"
|
139
|
-
end
|
140
|
-
task rdoc_task_name
|
141
|
-
|
142
|
-
desc "Force a rebuild of the RDOC files"
|
143
|
-
task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
|
144
|
-
|
145
|
-
desc "Remove rdoc products"
|
146
|
-
task clobber_task_name do
|
147
|
-
rm_r rdoc_dir rescue nil
|
148
|
-
end
|
149
|
-
|
150
|
-
task :clobber => [clobber_task_name]
|
151
|
-
|
152
|
-
directory @rdoc_dir
|
153
|
-
task rdoc_task_name => [rdoc_target]
|
154
|
-
file rdoc_target => @rdoc_files + [Rake.application.rakefile] do
|
155
|
-
rm_r @rdoc_dir rescue nil
|
156
|
-
@before_running_rdoc.call if @before_running_rdoc
|
157
|
-
args = option_list + @rdoc_files
|
158
|
-
if @external
|
159
|
-
argstring = args.join(' ')
|
160
|
-
sh %{ruby -Ivendor vendor/rd #{argstring}}
|
161
|
-
else
|
162
|
-
require 'rdoc/rdoc'
|
163
|
-
RDoc::RDoc.new.document(args)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
self
|
167
|
-
end
|
168
|
-
|
169
|
-
def option_list
|
170
|
-
result = @options.dup
|
171
|
-
result << "-o" << @rdoc_dir
|
172
|
-
result << "--main" << quote(main) if main
|
173
|
-
result << "--title" << quote(title) if title
|
174
|
-
result << "-T" << quote(template) if template
|
175
|
-
result << "--inline-source" if inline_source && !@options.include?("--inline-source") && !@options.include?("-S")
|
176
|
-
result
|
177
|
-
end
|
178
|
-
|
179
|
-
def quote(str)
|
180
|
-
if @external
|
181
|
-
"'#{str}'"
|
182
|
-
else
|
183
|
-
str
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
def option_string
|
188
|
-
option_list.join(' ')
|
189
|
-
end
|
190
|
-
|
191
|
-
# The block passed to this method will be called just before running the
|
192
|
-
# RDoc generator. It is allowed to modify RDocTask attributes inside the
|
193
|
-
# block.
|
194
|
-
def before_running_rdoc(&block)
|
195
|
-
@before_running_rdoc = block
|
196
|
-
end
|
197
|
-
|
198
|
-
private
|
199
|
-
|
200
|
-
def rdoc_target
|
201
|
-
"#{rdoc_dir}/index.html"
|
202
|
-
end
|
203
|
-
|
204
|
-
def rdoc_task_name
|
205
|
-
case name
|
206
|
-
when Hash
|
207
|
-
(name[:rdoc] || "rdoc").to_s
|
208
|
-
else
|
209
|
-
name.to_s
|
210
|
-
end
|
211
|
-
end
|
212
|
-
|
213
|
-
def clobber_task_name
|
214
|
-
case name
|
215
|
-
when Hash
|
216
|
-
(name[:clobber_rdoc] || "clobber_rdoc").to_s
|
217
|
-
else
|
218
|
-
"clobber_#{name}"
|
219
|
-
end
|
220
|
-
end
|
221
|
-
|
222
|
-
def rerdoc_task_name
|
223
|
-
case name
|
224
|
-
when Hash
|
225
|
-
(name[:rerdoc] || "rerdoc").to_s
|
226
|
-
else
|
227
|
-
"re#{name}"
|
228
|
-
end
|
229
|
-
end
|
230
|
-
|
231
|
-
end
|
232
|
-
end
|
233
|
-
end
|
234
|
-
|
data/lib/rake/trace_output.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
module Rake
|
2
|
-
module TraceOutput
|
3
|
-
|
4
|
-
# Write trace output to output stream +out+.
|
5
|
-
#
|
6
|
-
# The write is done as a single IO call (to print) to lessen the
|
7
|
-
# chance that the trace output is interrupted by other tasks also
|
8
|
-
# producing output.
|
9
|
-
def trace_on(out, *strings)
|
10
|
-
sep = $\ || "\n"
|
11
|
-
if strings.empty?
|
12
|
-
output = sep
|
13
|
-
else
|
14
|
-
output = strings.map { |s| s.end_with?(sep) ? s : s + sep }.join
|
15
|
-
end
|
16
|
-
out.print(output)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/test/test_private_reader.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
require File.expand_path('../helper', __FILE__)
|
2
|
-
require 'rake/private_reader'
|
3
|
-
|
4
|
-
class TestPrivateAttrs < Rake::TestCase
|
5
|
-
|
6
|
-
class Sample
|
7
|
-
include Rake::PrivateReader
|
8
|
-
|
9
|
-
private_reader :reader, :a
|
10
|
-
|
11
|
-
def initialize
|
12
|
-
@reader = :RVALUE
|
13
|
-
end
|
14
|
-
|
15
|
-
def get_reader
|
16
|
-
reader
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
def setup
|
22
|
-
super
|
23
|
-
@sample = Sample.new
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_private_reader_is_private
|
27
|
-
assert_private do @sample.reader end
|
28
|
-
assert_private do @sample.a end
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_private_reader_returns_data
|
32
|
-
assert_equal :RVALUE, @sample.get_reader
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def assert_private
|
38
|
-
ex = assert_raises(NoMethodError) do yield end
|
39
|
-
assert_match(/private/, ex.message)
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
data/test/test_rake_rdoc_task.rb
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
require File.expand_path('../helper', __FILE__)
|
2
|
-
begin
|
3
|
-
old_stderr = $stderr
|
4
|
-
dev_null = File.exist?('/dev/null') ? '/dev/null' : 'NUL'
|
5
|
-
$stderr = open dev_null, 'w'
|
6
|
-
require 'rake/rdoctask'
|
7
|
-
ensure
|
8
|
-
$stderr.close
|
9
|
-
$stderr = old_stderr
|
10
|
-
end
|
11
|
-
|
12
|
-
class TestRakeRDocTask < Rake::TestCase
|
13
|
-
include Rake
|
14
|
-
|
15
|
-
def setup
|
16
|
-
super
|
17
|
-
|
18
|
-
Task.clear
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_tasks_creation
|
22
|
-
Rake::RDocTask.new
|
23
|
-
assert Task[:rdoc]
|
24
|
-
assert Task[:clobber_rdoc]
|
25
|
-
assert Task[:rerdoc]
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_tasks_creation_with_custom_name_symbol
|
29
|
-
rd = Rake::RDocTask.new(:rdoc_dev)
|
30
|
-
assert Task[:rdoc_dev]
|
31
|
-
assert Task[:clobber_rdoc_dev]
|
32
|
-
assert Task[:rerdoc_dev]
|
33
|
-
assert_equal :rdoc_dev, rd.name
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_tasks_creation_with_custom_name_string
|
37
|
-
rd = Rake::RDocTask.new("rdoc_dev")
|
38
|
-
assert Task[:rdoc_dev]
|
39
|
-
assert Task[:clobber_rdoc_dev]
|
40
|
-
assert Task[:rerdoc_dev]
|
41
|
-
assert_equal "rdoc_dev", rd.name
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_tasks_creation_with_custom_name_hash
|
45
|
-
options = { :rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force" }
|
46
|
-
rd = Rake::RDocTask.new(options)
|
47
|
-
assert Task[:"rdoc"]
|
48
|
-
assert Task[:"rdoc:clean"]
|
49
|
-
assert Task[:"rdoc:force"]
|
50
|
-
assert_raises(RuntimeError) { Task[:clobber_rdoc] }
|
51
|
-
assert_equal options, rd.name
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_tasks_creation_with_custom_name_hash_will_use_default_if_an_option_isnt_given
|
55
|
-
Rake::RDocTask.new(:clobber_rdoc => "rdoc:clean")
|
56
|
-
assert Task[:rdoc]
|
57
|
-
assert Task[:"rdoc:clean"]
|
58
|
-
assert Task[:rerdoc]
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_tasks_creation_with_custom_name_hash_raises_exception_if_invalid_option_given
|
62
|
-
assert_raises(ArgumentError) do
|
63
|
-
Rake::RDocTask.new(:foo => "bar")
|
64
|
-
end
|
65
|
-
|
66
|
-
begin
|
67
|
-
Rake::RDocTask.new(:foo => "bar")
|
68
|
-
rescue ArgumentError => e
|
69
|
-
assert_match(/foo/, e.message)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_inline_source_option_is_only_appended_if_option_not_already_given
|
74
|
-
rd = Rake::RDocTask.new
|
75
|
-
rd.options << '--inline-source'
|
76
|
-
assert_equal 1, rd.option_list.grep('--inline-source').size
|
77
|
-
|
78
|
-
rd = Rake::RDocTask.new
|
79
|
-
rd.options << '-S'
|
80
|
-
assert_equal 1, rd.option_list.grep('-S').size
|
81
|
-
assert_equal 0, rd.option_list.grep('--inline-source').size
|
82
|
-
end
|
83
|
-
end
|