tap 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History +12 -0
- data/MIT-LICENSE +0 -2
- data/README +23 -32
- data/bin/rap +116 -0
- data/bin/tap +6 -9
- data/cgi/run.rb +67 -0
- data/cmd/console.rb +1 -1
- data/cmd/destroy.rb +4 -4
- data/cmd/generate.rb +4 -4
- data/cmd/manifest.rb +61 -53
- data/cmd/run.rb +8 -75
- data/doc/Class Reference +130 -121
- data/doc/Command Reference +76 -124
- data/doc/Syntax Reference +290 -0
- data/doc/Tutorial +305 -237
- data/lib/tap/app.rb +140 -467
- data/lib/tap/constants.rb +2 -2
- data/lib/tap/declarations.rb +211 -0
- data/lib/tap/env.rb +171 -193
- data/lib/tap/exe.rb +100 -21
- data/lib/tap/file_task.rb +3 -3
- data/lib/tap/generator/base.rb +1 -1
- data/lib/tap/generator/destroy.rb +10 -10
- data/lib/tap/generator/generate.rb +29 -18
- data/lib/tap/generator/generators/command/command_generator.rb +2 -2
- data/lib/tap/generator/generators/command/templates/command.erb +2 -2
- data/lib/tap/generator/generators/config/config_generator.rb +3 -3
- data/lib/tap/generator/generators/config/templates/doc.erb +1 -1
- data/lib/tap/generator/generators/file_task/file_task_generator.rb +1 -1
- data/lib/tap/generator/generators/file_task/templates/task.erb +1 -1
- data/lib/tap/generator/generators/file_task/templates/test.erb +1 -1
- data/lib/tap/generator/generators/generator/generator_generator.rb +27 -0
- data/lib/tap/generator/generators/generator/templates/task.erb +27 -0
- data/lib/tap/generator/generators/root/root_generator.rb +13 -13
- data/lib/tap/generator/generators/root/templates/README +0 -0
- data/lib/tap/generator/generators/root/templates/Rakefile +2 -2
- data/lib/tap/generator/generators/root/templates/gemspec +4 -5
- data/lib/tap/generator/generators/root/templates/tapfile +11 -8
- data/lib/tap/generator/generators/root/templates/test/tap_test_suite.rb +1 -1
- data/lib/tap/generator/generators/task/task_generator.rb +1 -3
- data/lib/tap/generator/generators/task/templates/test.erb +1 -3
- data/lib/tap/patches/optparse/summarize.rb +62 -0
- data/lib/tap/root.rb +41 -29
- data/lib/tap/support/aggregator.rb +16 -3
- data/lib/tap/support/assignments.rb +10 -9
- data/lib/tap/support/audit.rb +58 -64
- data/lib/tap/support/class_configuration.rb +33 -44
- data/lib/tap/support/combinator.rb +125 -0
- data/lib/tap/support/configurable.rb +13 -14
- data/lib/tap/support/configurable_class.rb +21 -43
- data/lib/tap/support/configuration.rb +55 -9
- data/lib/tap/support/constant.rb +87 -13
- data/lib/tap/support/constant_manifest.rb +116 -0
- data/lib/tap/support/dependencies.rb +54 -0
- data/lib/tap/support/dependency.rb +44 -0
- data/lib/tap/support/executable.rb +247 -32
- data/lib/tap/support/executable_queue.rb +1 -1
- data/lib/tap/support/gems/rake.rb +29 -8
- data/lib/tap/support/gems.rb +10 -30
- data/lib/tap/support/instance_configuration.rb +29 -3
- data/lib/tap/support/intern.rb +46 -0
- data/lib/tap/support/join.rb +143 -0
- data/lib/tap/support/joins/fork.rb +19 -0
- data/lib/tap/support/joins/merge.rb +22 -0
- data/lib/tap/support/joins/sequence.rb +21 -0
- data/lib/tap/support/joins/switch.rb +25 -0
- data/lib/tap/support/joins/sync_merge.rb +63 -0
- data/lib/tap/support/joins.rb +15 -0
- data/lib/tap/support/lazy_attributes.rb +17 -2
- data/lib/tap/support/lazydoc/comment.rb +503 -0
- data/lib/tap/support/lazydoc/config.rb +17 -0
- data/lib/tap/support/lazydoc/definition.rb +36 -0
- data/lib/tap/support/lazydoc/document.rb +152 -0
- data/lib/tap/support/lazydoc/method.rb +24 -0
- data/lib/tap/support/lazydoc.rb +269 -343
- data/lib/tap/support/manifest.rb +121 -103
- data/lib/tap/support/minimap.rb +90 -0
- data/lib/tap/support/node.rb +56 -0
- data/lib/tap/support/parser.rb +436 -0
- data/lib/tap/support/schema.rb +359 -0
- data/lib/tap/support/shell_utils.rb +3 -5
- data/lib/tap/support/string_ext.rb +60 -0
- data/lib/tap/support/tdoc.rb +7 -2
- data/lib/tap/support/templater.rb +30 -16
- data/lib/tap/support/validation.rb +77 -8
- data/lib/tap/task.rb +431 -143
- data/lib/tap/tasks/dump.rb +15 -10
- data/lib/tap/tasks/load.rb +112 -0
- data/lib/tap/tasks/rake.rb +4 -41
- data/lib/tap/test/assertions.rb +38 -0
- data/lib/tap/test/env_vars.rb +1 -1
- data/lib/tap/test/extensions.rb +79 -0
- data/lib/tap/test/file_test.rb +420 -0
- data/lib/tap/test/file_test_class.rb +12 -0
- data/lib/tap/test/regexp_escape.rb +87 -0
- data/lib/tap/test/script_test.rb +46 -0
- data/lib/tap/test/script_tester.rb +115 -0
- data/lib/tap/test/subset_test.rb +260 -0
- data/lib/tap/test/subset_test_class.rb +99 -0
- data/lib/tap/test/{tap_methods.rb → tap_test.rb} +45 -43
- data/lib/tap/test/utils.rb +231 -0
- data/lib/tap/test.rb +53 -26
- data/lib/tap.rb +3 -20
- metadata +50 -27
- data/lib/tap/generator/generators/root/templates/test/tapfile_test.rb +0 -15
- data/lib/tap/patches/rake/rake_test_loader.rb +0 -8
- data/lib/tap/patches/rake/testtask.rb +0 -57
- data/lib/tap/patches/ruby19/backtrace_filter.rb +0 -51
- data/lib/tap/patches/ruby19/parsedate.rb +0 -16
- data/lib/tap/support/batchable.rb +0 -47
- data/lib/tap/support/batchable_class.rb +0 -107
- data/lib/tap/support/command_line.rb +0 -98
- data/lib/tap/support/comment.rb +0 -270
- data/lib/tap/support/constant_utils.rb +0 -127
- data/lib/tap/support/declarations.rb +0 -111
- data/lib/tap/support/framework.rb +0 -83
- data/lib/tap/support/framework_class.rb +0 -180
- data/lib/tap/support/run_error.rb +0 -39
- data/lib/tap/support/summary.rb +0 -30
- data/lib/tap/test/file_methods.rb +0 -377
- data/lib/tap/test/script_methods/script_test.rb +0 -98
- data/lib/tap/test/script_methods.rb +0 -107
- data/lib/tap/test/subset_methods.rb +0 -420
- data/lib/tap/workflow.rb +0 -200
@@ -0,0 +1,231 @@
|
|
1
|
+
require 'tap/root'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'tempfile'
|
4
|
+
|
5
|
+
module Tap
|
6
|
+
module Support
|
7
|
+
autoload(:Templater, 'tap/support/templater')
|
8
|
+
end
|
9
|
+
|
10
|
+
module Test
|
11
|
+
module Utils
|
12
|
+
module_function
|
13
|
+
|
14
|
+
# Generates an array of [source, reference] pairs mapping source
|
15
|
+
# files to reference files under the source and reference dirs,
|
16
|
+
# respectively. Only files under source dir matching the pattern
|
17
|
+
# will be mapped. Mappings are either (in this order):
|
18
|
+
#
|
19
|
+
# - the path under reference_dir contained in the source file
|
20
|
+
# - a direct translation of the source file from the source to
|
21
|
+
# the reference dir, minus the extname
|
22
|
+
#
|
23
|
+
# Notes:
|
24
|
+
# - Source files may contain comments but should otherwise
|
25
|
+
# consist only of indentation (which is stripped) and
|
26
|
+
# the reference path.
|
27
|
+
# - If a mapped path cannot be found, dereference raises
|
28
|
+
# a DereferenceError.
|
29
|
+
#
|
30
|
+
# === example
|
31
|
+
#
|
32
|
+
# root
|
33
|
+
# |- input
|
34
|
+
# | |- dir.ref
|
35
|
+
# | |- ignored.txt
|
36
|
+
# | |- one.txt.ref
|
37
|
+
# | `- two.txt.ref
|
38
|
+
# `- ref
|
39
|
+
# |- dir
|
40
|
+
# |- one.txt
|
41
|
+
# `- path
|
42
|
+
# `- to
|
43
|
+
# `- two.txt
|
44
|
+
#
|
45
|
+
# The 'two.txt.ref' file contains a reference path:
|
46
|
+
#
|
47
|
+
# File.read('/root/input/two.txt.ref') # => 'path/to/two.txt'
|
48
|
+
#
|
49
|
+
# Now:
|
50
|
+
#
|
51
|
+
# reference_map('/root/input', '/root/ref')
|
52
|
+
# # => [
|
53
|
+
# # ['/root/input/dir.ref', '/root/ref/dir'],
|
54
|
+
# # ['/root/input/one.txt.ref', '/root/ref/one.txt'],
|
55
|
+
# # ['/root/input/two.txt.ref', '/root/ref/path/to/two.txt']]
|
56
|
+
#
|
57
|
+
# And since no path matches 'ignored.txt':
|
58
|
+
#
|
59
|
+
# reference_map('/root/input', '/root/ref', '**/*.txt')
|
60
|
+
# # !> DereferenceError
|
61
|
+
#
|
62
|
+
def reference_map(source_dir, reference_dir, pattern='**/*.ref')
|
63
|
+
Dir.glob(File.join(source_dir, pattern)).sort.collect do |source|
|
64
|
+
# use the path specified in the source file
|
65
|
+
relative_path = File.read(source).gsub(/#.*$/, "").strip
|
66
|
+
|
67
|
+
# use the relative filepath of the source file to the
|
68
|
+
# source dir (minus the extname) if no path is specified
|
69
|
+
if relative_path.empty?
|
70
|
+
relative_path = Tap::Root.relative_filepath(source_dir, source).chomp(File.extname(source))
|
71
|
+
end
|
72
|
+
|
73
|
+
reference = File.join(reference_dir, relative_path)
|
74
|
+
|
75
|
+
# raise an error if no reference file is found
|
76
|
+
unless File.exists?(reference)
|
77
|
+
raise DereferenceError, "no reference found for: #{source}"
|
78
|
+
end
|
79
|
+
|
80
|
+
[source, reference]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Dereferences source files with reference files for the duration
|
85
|
+
# of the block. The mappings of source to reference files are
|
86
|
+
# determined using reference_map; dereferenced files are at the
|
87
|
+
# same location as the source files, but with the '.ref' extname
|
88
|
+
# removed.
|
89
|
+
#
|
90
|
+
# Notes:
|
91
|
+
# - The reference extname is implicitly specified in pattern;
|
92
|
+
# the final extname of the source file is removed during
|
93
|
+
# dereferencing regardless of what it is.
|
94
|
+
#
|
95
|
+
def dereference(source_dirs, reference_dir, pattern='**/*.ref', tempdir=Dir::tmpdir)
|
96
|
+
mapped_paths = []
|
97
|
+
begin
|
98
|
+
[*source_dirs].each do |source_dir|
|
99
|
+
reference_map(source_dir, reference_dir, pattern).each do |source, reference|
|
100
|
+
|
101
|
+
# move the source file to a temporary location
|
102
|
+
tempfile = Tempfile.new(File.basename(source), tempdir)
|
103
|
+
tempfile.close
|
104
|
+
FileUtils.mv(source, tempfile.path)
|
105
|
+
|
106
|
+
# copy the reference to the target
|
107
|
+
target = source.chomp(File.extname(source))
|
108
|
+
FileUtils.cp_r(reference, target)
|
109
|
+
|
110
|
+
mapped_paths << [target, source, tempfile]
|
111
|
+
end
|
112
|
+
end unless reference_dir == nil
|
113
|
+
|
114
|
+
yield
|
115
|
+
|
116
|
+
ensure
|
117
|
+
mapped_paths.each do |target, source, tempfile|
|
118
|
+
# remove the target and restore the original source file
|
119
|
+
FileUtils.rm_r(target) if File.exists?(target)
|
120
|
+
FileUtils.mv(tempfile.path, source)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
# Uses a Tap::Support::Templater to template and replace the contents of path,
|
126
|
+
# for the duration of the block. The attributes will be available in the
|
127
|
+
# template context.
|
128
|
+
def template(paths, attributes={}, tempdir=Dir::tmpdir)
|
129
|
+
mapped_paths = []
|
130
|
+
begin
|
131
|
+
[*paths].each do |path|
|
132
|
+
# move the source file to a temporary location
|
133
|
+
tempfile = Tempfile.new(File.basename(path), tempdir)
|
134
|
+
tempfile.close
|
135
|
+
FileUtils.cp(path, tempfile.path)
|
136
|
+
|
137
|
+
# template the source file
|
138
|
+
content = File.read(path)
|
139
|
+
File.open(path, "wb") do |file|
|
140
|
+
file << Support::Templater.new(content, attributes).build
|
141
|
+
end
|
142
|
+
|
143
|
+
mapped_paths << [path, tempfile]
|
144
|
+
end
|
145
|
+
|
146
|
+
yield
|
147
|
+
|
148
|
+
ensure
|
149
|
+
mapped_paths.each do |path, tempfile|
|
150
|
+
# restore the original source file
|
151
|
+
FileUtils.rm(path) if File.exists?(path)
|
152
|
+
FileUtils.mv(tempfile.path, path)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Yields to the input block for each pair of entries in the input
|
158
|
+
# arrays. An error is raised if the input arrays do not have equal
|
159
|
+
# numbers of entries.
|
160
|
+
def each_pair(a, b, &block) # :yields: entry_a, entry_b,
|
161
|
+
each_pair_with_index(a,b) do |entry_a, entry_b, index|
|
162
|
+
yield(entry_a, entry_b)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Same as each_pair but yields the index of the entries as well.
|
167
|
+
def each_pair_with_index(a, b, error_msg=nil, &block) # :yields: entry_a, entry_b, index
|
168
|
+
a = [a] unless a.kind_of?(Array)
|
169
|
+
b = [b] unless b.kind_of?(Array)
|
170
|
+
|
171
|
+
unless a.length == b.length
|
172
|
+
raise ArgumentError, (error_msg || "The input arrays must have an equal number of entries.")
|
173
|
+
end
|
174
|
+
|
175
|
+
0.upto(a.length-1) do |index|
|
176
|
+
yield(a[index], b[index], index)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Attempts to recursively remove the specified method directory and all
|
181
|
+
# files within it. Raises an error if the removal does not succeed.
|
182
|
+
def clear_dir(dir)
|
183
|
+
# clear out the folder if it exists
|
184
|
+
FileUtils.rm_r(dir) if File.exists?(dir)
|
185
|
+
end
|
186
|
+
|
187
|
+
# Attempts to remove the specified directory. The root
|
188
|
+
# will not be removed if the directory does not exist, or
|
189
|
+
# is not empty.
|
190
|
+
def try_remove_dir(dir)
|
191
|
+
# Remove the directory if possible
|
192
|
+
begin
|
193
|
+
FileUtils.rmdir(dir) if File.exists?(dir) && Dir.glob(File.join(dir, "*")).empty?
|
194
|
+
rescue
|
195
|
+
# rescue cases where there is a hidden file, for example .svn
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# Sets ARGV to the input argv for the duration of the block.
|
200
|
+
def with_argv(argv=[])
|
201
|
+
current_argv = ARGV.dup
|
202
|
+
begin
|
203
|
+
ARGV.clear
|
204
|
+
ARGV.concat(argv)
|
205
|
+
|
206
|
+
yield
|
207
|
+
|
208
|
+
ensure
|
209
|
+
ARGV.clear
|
210
|
+
ARGV.concat(current_argv)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
def whitespace_escape(str)
|
215
|
+
str.to_s.gsub(/\s/) do |match|
|
216
|
+
case match
|
217
|
+
when "\n" then "\\n\n"
|
218
|
+
when "\t" then "\\t"
|
219
|
+
when "\r" then "\\r"
|
220
|
+
when "\f" then "\\f"
|
221
|
+
else match
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# Raised when no reference can be found for a reference path.
|
227
|
+
class DereferenceError < StandardError
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
data/lib/tap/test.rb
CHANGED
@@ -1,37 +1,64 @@
|
|
1
|
-
require '
|
1
|
+
require 'test/unit'
|
2
|
+
$:.unshift File.expand_path("#{File.dirname(__FILE__)}/..")
|
3
|
+
require 'tap/test/extensions'
|
2
4
|
|
3
5
|
module Test # :nodoc:
|
4
6
|
module Unit # :nodoc:
|
5
7
|
|
6
|
-
# Methods extending TestCase.
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# come through in the documentation. Hence, not all of them will be available
|
12
|
-
# if you're only using SubsetMethods or FileMethods. Breaks down like this:
|
13
|
-
#
|
14
|
-
# Using: Methods Available:
|
15
|
-
# TapMethods all
|
16
|
-
# FileMethods all, except acts_as_tap_test
|
17
|
-
# SubsetMethods all, except acts_as_tap_test, acts_as_file_test, file_test_root
|
18
|
-
#
|
8
|
+
# Methods extending TestCase. For more information see:
|
9
|
+
# - Tap::Test::SubsetTest
|
10
|
+
# - Tap::Test::FileTest
|
11
|
+
# - Tap::Test::TapTest
|
12
|
+
#
|
19
13
|
#--
|
20
14
|
#See the TestTutorial for more information.
|
21
15
|
class TestCase
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
16
|
+
extend Tap::Test::Extensions
|
17
|
+
|
18
|
+
class << self
|
19
|
+
alias tap_original_test_case_inherited inherited
|
20
|
+
|
21
|
+
def inherited(child)
|
22
|
+
super
|
23
|
+
tap_original_test_case_inherited(child)
|
24
|
+
child.instance_variable_set(:@skip_messages, [])
|
25
|
+
child.instance_variable_set(:@run_test_suite, true)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Indicates when the test suite should be run or skipped.
|
29
|
+
attr_accessor :run_test_suite
|
30
|
+
|
31
|
+
# An array of messages printed when a test is skipped
|
32
|
+
# by setting run_test_suite to false.
|
33
|
+
attr_reader :skip_messages
|
34
34
|
|
35
|
+
# Causes a test suite to be skipped. If a message is given, it will
|
36
|
+
# print and notify the user the test suite has been skipped.
|
37
|
+
def skip_test(msg=nil)
|
38
|
+
self.run_test_suite = false
|
35
39
|
|
40
|
+
# experimental -- perhaps use this so that a test can be skipped
|
41
|
+
# for multiple reasons?
|
42
|
+
skip_messages << msg
|
43
|
+
end
|
36
44
|
|
45
|
+
alias :original_suite :suite
|
37
46
|
|
47
|
+
# Modifies the default suite method to skip the suit unless
|
48
|
+
# run_test_suite is true. If the test is skipped, the skip_messages
|
49
|
+
# will be printed along with the default 'Skipping <Test>' message.
|
50
|
+
def suite # :nodoc:
|
51
|
+
if run_test_suite
|
52
|
+
original_suite
|
53
|
+
else
|
54
|
+
skip_message = skip_messages.compact.join(', ')
|
55
|
+
puts "Skipping #{name}#{skip_message.empty? ? '' : ': ' + skip_message}"
|
56
|
+
|
57
|
+
# return an empty test suite of the appropriate name
|
58
|
+
Test::Unit::TestSuite.new(name)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/lib/tap.rb
CHANGED
@@ -1,27 +1,10 @@
|
|
1
|
-
|
2
|
-
require 'thread'
|
3
|
-
|
4
|
-
# Apply version-specific patches
|
5
|
-
case RUBY_VERSION
|
6
|
-
when /^1.9/
|
7
|
-
$: << File.expand_path(File.dirname(__FILE__) + "/tap/patches/ruby19")
|
8
|
-
end
|
1
|
+
autoload(:YAML, 'yaml') # expensive to load
|
9
2
|
|
10
3
|
$:.unshift File.expand_path(File.dirname(__FILE__))
|
11
4
|
|
12
5
|
require 'tap/constants'
|
13
6
|
|
14
7
|
# require in order...
|
15
|
-
require 'tap/
|
16
|
-
require 'tap/app'
|
8
|
+
require 'tap/exe'
|
17
9
|
require 'tap/task'
|
18
|
-
require 'tap/file_task'
|
19
|
-
require 'tap/workflow'
|
20
|
-
|
21
|
-
require 'tap/support/declarations'
|
22
|
-
Tap.extend Tap::Support::Declarations
|
23
|
-
|
24
|
-
# Apply platform-specific patches
|
25
|
-
# case RUBY_PLATFORM
|
26
|
-
# when 'java'
|
27
|
-
# end
|
10
|
+
require 'tap/file_task'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Chiang
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-20 00:00:00 -06:00
|
13
13
|
default_executable: tap
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -17,19 +17,19 @@ description:
|
|
17
17
|
email: simon.a.chiang@gmail.com
|
18
18
|
executables:
|
19
19
|
- tap
|
20
|
+
- rap
|
20
21
|
extensions: []
|
21
22
|
|
22
23
|
extra_rdoc_files:
|
23
24
|
- README
|
24
25
|
- MIT-LICENSE
|
25
26
|
- History
|
26
|
-
- doc/Tutorial
|
27
27
|
- doc/Class Reference
|
28
28
|
- doc/Command Reference
|
29
|
+
- doc/Syntax Reference
|
30
|
+
- doc/Tutorial
|
29
31
|
files:
|
30
|
-
-
|
31
|
-
- MIT-LICENSE
|
32
|
-
- History
|
32
|
+
- cgi/run.rb
|
33
33
|
- cmd/console.rb
|
34
34
|
- cmd/destroy.rb
|
35
35
|
- cmd/generate.rb
|
@@ -38,9 +38,11 @@ files:
|
|
38
38
|
- doc/Tutorial
|
39
39
|
- doc/Class Reference
|
40
40
|
- doc/Command Reference
|
41
|
+
- bin/rap
|
41
42
|
- bin/tap
|
42
43
|
- lib/tap/app.rb
|
43
44
|
- lib/tap/constants.rb
|
45
|
+
- lib/tap/declarations.rb
|
44
46
|
- lib/tap/env.rb
|
45
47
|
- lib/tap/exe.rb
|
46
48
|
- lib/tap/file_task.rb
|
@@ -57,67 +59,88 @@ files:
|
|
57
59
|
- lib/tap/generator/generators/file_task/templates/result.yml
|
58
60
|
- lib/tap/generator/generators/file_task/templates/task.erb
|
59
61
|
- lib/tap/generator/generators/file_task/templates/test.erb
|
62
|
+
- lib/tap/generator/generators/generator/generator_generator.rb
|
63
|
+
- lib/tap/generator/generators/generator/templates/task.erb
|
60
64
|
- lib/tap/generator/generators/root/root_generator.rb
|
65
|
+
- lib/tap/generator/generators/root/templates/README
|
61
66
|
- lib/tap/generator/generators/root/templates/Rakefile
|
62
67
|
- lib/tap/generator/generators/root/templates/tapfile
|
63
68
|
- lib/tap/generator/generators/root/templates/gemspec
|
64
69
|
- lib/tap/generator/generators/root/templates/test/tap_test_helper.rb
|
65
70
|
- lib/tap/generator/generators/root/templates/test/tap_test_suite.rb
|
66
|
-
- lib/tap/generator/generators/root/templates/test/tapfile_test.rb
|
67
71
|
- lib/tap/generator/generators/task/task_generator.rb
|
68
72
|
- lib/tap/generator/generators/task/templates/task.erb
|
69
73
|
- lib/tap/generator/generators/task/templates/test.erb
|
70
74
|
- lib/tap/generator/manifest.rb
|
71
|
-
- lib/tap/patches/
|
72
|
-
- lib/tap/patches/rake/testtask.rb
|
73
|
-
- lib/tap/patches/ruby19/backtrace_filter.rb
|
74
|
-
- lib/tap/patches/ruby19/parsedate.rb
|
75
|
+
- lib/tap/patches/optparse/summarize.rb
|
75
76
|
- lib/tap/root.rb
|
76
77
|
- lib/tap/support/aggregator.rb
|
77
78
|
- lib/tap/support/assignments.rb
|
78
79
|
- lib/tap/support/audit.rb
|
79
|
-
- lib/tap/support/batchable.rb
|
80
|
-
- lib/tap/support/batchable_class.rb
|
81
80
|
- lib/tap/support/class_configuration.rb
|
82
|
-
- lib/tap/support/
|
83
|
-
- lib/tap/support/comment.rb
|
81
|
+
- lib/tap/support/combinator.rb
|
84
82
|
- lib/tap/support/configurable.rb
|
85
83
|
- lib/tap/support/configurable_class.rb
|
86
84
|
- lib/tap/support/configuration.rb
|
87
85
|
- lib/tap/support/constant.rb
|
88
|
-
- lib/tap/support/
|
89
|
-
- lib/tap/support/
|
86
|
+
- lib/tap/support/constant_manifest.rb
|
87
|
+
- lib/tap/support/dependencies.rb
|
88
|
+
- lib/tap/support/dependency.rb
|
90
89
|
- lib/tap/support/executable.rb
|
91
90
|
- lib/tap/support/executable_queue.rb
|
92
|
-
- lib/tap/support/framework.rb
|
93
|
-
- lib/tap/support/framework_class.rb
|
94
91
|
- lib/tap/support/gems/rake.rb
|
95
92
|
- lib/tap/support/gems.rb
|
96
93
|
- lib/tap/support/instance_configuration.rb
|
94
|
+
- lib/tap/support/intern.rb
|
95
|
+
- lib/tap/support/join.rb
|
96
|
+
- lib/tap/support/joins.rb
|
97
|
+
- lib/tap/support/joins/fork.rb
|
98
|
+
- lib/tap/support/joins/merge.rb
|
99
|
+
- lib/tap/support/joins/sequence.rb
|
100
|
+
- lib/tap/support/joins/switch.rb
|
101
|
+
- lib/tap/support/joins/sync_merge.rb
|
97
102
|
- lib/tap/support/lazy_attributes.rb
|
98
103
|
- lib/tap/support/lazydoc.rb
|
104
|
+
- lib/tap/support/lazydoc/comment.rb
|
105
|
+
- lib/tap/support/lazydoc/config.rb
|
106
|
+
- lib/tap/support/lazydoc/definition.rb
|
107
|
+
- lib/tap/support/lazydoc/document.rb
|
108
|
+
- lib/tap/support/lazydoc/method.rb
|
99
109
|
- lib/tap/support/manifest.rb
|
100
|
-
- lib/tap/support/
|
110
|
+
- lib/tap/support/minimap.rb
|
111
|
+
- lib/tap/support/node.rb
|
112
|
+
- lib/tap/support/parser.rb
|
113
|
+
- lib/tap/support/schema.rb
|
101
114
|
- lib/tap/support/shell_utils.rb
|
115
|
+
- lib/tap/support/string_ext.rb
|
102
116
|
- lib/tap/support/tdoc.rb
|
103
117
|
- lib/tap/support/tdoc/tdoc_html_generator.rb
|
104
118
|
- lib/tap/support/tdoc/tdoc_html_template.rb
|
105
|
-
- lib/tap/support/summary.rb
|
106
119
|
- lib/tap/support/templater.rb
|
107
120
|
- lib/tap/support/validation.rb
|
108
121
|
- lib/tap/support/versions.rb
|
109
122
|
- lib/tap/task.rb
|
110
123
|
- lib/tap/tasks/dump.rb
|
124
|
+
- lib/tap/tasks/load.rb
|
111
125
|
- lib/tap/tasks/rake.rb
|
126
|
+
- lib/tap/test/assertions.rb
|
112
127
|
- lib/tap/test/env_vars.rb
|
113
|
-
- lib/tap/test/
|
114
|
-
- lib/tap/test/
|
115
|
-
- lib/tap/test/
|
116
|
-
- lib/tap/test/
|
117
|
-
- lib/tap/test/
|
128
|
+
- lib/tap/test/extensions.rb
|
129
|
+
- lib/tap/test/file_test.rb
|
130
|
+
- lib/tap/test/file_test_class.rb
|
131
|
+
- lib/tap/test/script_test.rb
|
132
|
+
- lib/tap/test/regexp_escape.rb
|
133
|
+
- lib/tap/test/script_tester.rb
|
134
|
+
- lib/tap/test/subset_test.rb
|
135
|
+
- lib/tap/test/subset_test_class.rb
|
136
|
+
- lib/tap/test/tap_test.rb
|
137
|
+
- lib/tap/test/utils.rb
|
118
138
|
- lib/tap/test.rb
|
119
|
-
- lib/tap/workflow.rb
|
120
139
|
- lib/tap.rb
|
140
|
+
- README
|
141
|
+
- MIT-LICENSE
|
142
|
+
- History
|
143
|
+
- doc/Syntax Reference
|
121
144
|
has_rdoc: true
|
122
145
|
homepage: http://tap.rubyforge.org
|
123
146
|
post_install_message:
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/tap_test_helper.rb'
|
2
|
-
require File.dirname(__FILE__) + '/../tapfile.rb'
|
3
|
-
|
4
|
-
class TapfileTest < Test::Unit::TestCase
|
5
|
-
acts_as_tap_test
|
6
|
-
|
7
|
-
def test_goodnight
|
8
|
-
task = Goodnight.new :message => "goodnight"
|
9
|
-
|
10
|
-
# a simple test
|
11
|
-
assert_equal({:message => 'goodnight'}, task.config)
|
12
|
-
assert_equal "goodnight moon", task.process("moon")
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# this is the same code as in rake/rake_test_loader.rb
|
2
|
-
# except it duplicates ARGV before iterating over it.
|
3
|
-
#
|
4
|
-
# This prevents an error in Ruby 1.9 when one of the
|
5
|
-
# loaded files attempts to modify ARGV. In that case
|
6
|
-
# you get an error like: 'can't modify array during
|
7
|
-
# iteration (RuntimeError)'
|
8
|
-
ARGV.dup.each { |f| load f unless f =~ /^-/ }
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# NO idea why this prevents an error with @ruby_opts=nil,
|
2
|
-
# or even how @ruby_opts could be nil, on ruby 1.9 with
|
3
|
-
# rake test and tdoc. It does, though.
|
4
|
-
require 'pp'
|
5
|
-
|
6
|
-
module Rake # :nodoc:
|
7
|
-
|
8
|
-
class TestTask < TaskLib # :nodoc:
|
9
|
-
|
10
|
-
# Patch for TestTask#define in 'rake\testtask.rb'
|
11
|
-
#
|
12
|
-
# This patch lets you specify Windows-style paths in lib
|
13
|
-
# (ie with spaces and slashes) and to do something like:
|
14
|
-
#
|
15
|
-
# Rake::TestTask.new(:test) do |t|
|
16
|
-
# t.libs = $: << 'lib'
|
17
|
-
# end
|
18
|
-
#
|
19
|
-
# Using this patch you can specify additional load paths
|
20
|
-
# for the test from the command line using --lib-dir
|
21
|
-
#
|
22
|
-
def define
|
23
|
-
lib_opt = @libs.collect {|f| "-I\"#{File.expand_path(f)}\""}.join(' ')
|
24
|
-
desc "Run tests" + (@name==:test ? "" : " for #{@name}")
|
25
|
-
task @name do
|
26
|
-
run_code = ''
|
27
|
-
RakeFileUtils.verbose(@verbose) do
|
28
|
-
run_code =
|
29
|
-
case @loader
|
30
|
-
when :direct
|
31
|
-
"-e 'ARGV.each{|f| load f}'"
|
32
|
-
when :testrb
|
33
|
-
"-S testrb #{fix}"
|
34
|
-
when :rake
|
35
|
-
rake_loader
|
36
|
-
end
|
37
|
-
@ruby_opts.unshift(lib_opt)
|
38
|
-
@ruby_opts.unshift( "-w" ) if @warning
|
39
|
-
ruby @ruby_opts.join(" ") +
|
40
|
-
" \"#{run_code}\" " +
|
41
|
-
file_list.collect { |fn| "\"#{fn}\"" }.join(' ') +
|
42
|
-
" #{option_list}"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
self
|
46
|
-
end
|
47
|
-
|
48
|
-
# Loads in the patched rake_test_loader to avoid the ARGV
|
49
|
-
# modification error, which arises within TDoc.
|
50
|
-
#--
|
51
|
-
# May be out of date...
|
52
|
-
def rake_loader # :nodoc:
|
53
|
-
File.expand_path(File.join(File.dirname(__FILE__), 'rake_test_loader.rb'))
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
module Test
|
2
|
-
module Unit
|
3
|
-
module Util # :nodoc:
|
4
|
-
module BacktraceFilter # :nodoc:
|
5
|
-
|
6
|
-
if method_defined?(:filter_backtrace)
|
7
|
-
alias :tap_original_filter_backtrace :filter_backtrace
|
8
|
-
end
|
9
|
-
|
10
|
-
# This is a slightly-modified version of the default BacktraceFilter
|
11
|
-
# provided in the Ruby 1.9 distribution. It solves the issue documented
|
12
|
-
# below, and hopefully will not be necessary when Ruby 1.9 is stable.
|
13
|
-
#
|
14
|
-
def filter_backtrace(backtrace, prefix=nil)
|
15
|
-
return ["No backtrace"] unless(backtrace)
|
16
|
-
split_p = if(prefix)
|
17
|
-
prefix.split(TESTUNIT_FILE_SEPARATORS)
|
18
|
-
else
|
19
|
-
TESTUNIT_PREFIX
|
20
|
-
end
|
21
|
-
match = proc do |e|
|
22
|
-
split_e = e.split(TESTUNIT_FILE_SEPARATORS)[0, split_p.size]
|
23
|
-
next false unless(split_e[0..-2] == split_p[0..-2])
|
24
|
-
split_e[-1].sub(TESTUNIT_RB_FILE, '') == split_p[-1]
|
25
|
-
end
|
26
|
-
|
27
|
-
# The Ruby 1.9 issue is that sometimes backtrace is a String
|
28
|
-
# and String is no longer Enumerable (hence it doesn't respond
|
29
|
-
# respond to detect). Arrayify to solve.
|
30
|
-
backtrace = [backtrace] unless backtrace.kind_of?(Array)
|
31
|
-
|
32
|
-
return backtrace unless(backtrace.detect(&match))
|
33
|
-
found_prefix = false
|
34
|
-
new_backtrace = backtrace.reverse.reject do |e|
|
35
|
-
if(match[e])
|
36
|
-
found_prefix = true
|
37
|
-
true
|
38
|
-
elsif(found_prefix)
|
39
|
-
false
|
40
|
-
else
|
41
|
-
true
|
42
|
-
end
|
43
|
-
end.reverse
|
44
|
-
new_backtrace = (new_backtrace.empty? ? backtrace : new_backtrace)
|
45
|
-
new_backtrace = new_backtrace.reject(&match)
|
46
|
-
new_backtrace.empty? ? backtrace : new_backtrace
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'date/format'
|
2
|
-
|
3
|
-
# Taken directly from the Ruby 1.8.6 standard library. Ruby 1.9 has apparently
|
4
|
-
# eliminated this class, but it is currently (2008-02-08) required by ActiveSupport.
|
5
|
-
#
|
6
|
-
# Making this file available to ActiveSupport allows testing under Ruby 1.9,
|
7
|
-
# but this patch should be unnecessary when ActiveSupport upgrades and becomes
|
8
|
-
# compatible with Ruby 1.9
|
9
|
-
module ParseDate # :nodoc:
|
10
|
-
def parsedate(str, comp=false)
|
11
|
-
Date._parse(str, comp).
|
12
|
-
values_at(:year, :mon, :mday, :hour, :min, :sec, :zone, :wday)
|
13
|
-
end
|
14
|
-
|
15
|
-
module_function :parsedate
|
16
|
-
end
|