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
@@ -1,111 +0,0 @@
|
|
1
|
-
module Tap
|
2
|
-
module Support
|
3
|
-
module Declarations
|
4
|
-
def self.set_declaration_base(base)
|
5
|
-
# TODO -- warn if base is Object -- conflict with Rake
|
6
|
-
declaration_base = base.to_s
|
7
|
-
declaration_base = "" if ["Object", "Tap"].include?(declaration_base)
|
8
|
-
|
9
|
-
base.instance_variable_set(:@tap_declaration_base, declaration_base.underscore)
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.included(base)
|
13
|
-
set_declaration_base(base)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.extended(base)
|
17
|
-
set_declaration_base(base)
|
18
|
-
end
|
19
|
-
|
20
|
-
def tasc(name, configs={}, options={}, &block)
|
21
|
-
Tap::Task.subclass(nest(name), configs, options, &block)
|
22
|
-
end
|
23
|
-
|
24
|
-
def task(name, configs={}, options={}, &block)
|
25
|
-
options[:arity] = arity(block)
|
26
|
-
tasc(name, configs, options, &task_block(block)).new
|
27
|
-
end
|
28
|
-
|
29
|
-
def file_tasc(name, configs={}, options={}, &block)
|
30
|
-
Tap::FileTask.subclass(nest(name), configs, options, &block)
|
31
|
-
end
|
32
|
-
|
33
|
-
def file_task(name, configs={}, options={}, &block)
|
34
|
-
options[:arity] = arity(block)
|
35
|
-
file_tasc(nest(name), configs, options, &task_block(block)).new
|
36
|
-
end
|
37
|
-
|
38
|
-
def worcflow(name, configs={}, options={}, &block)
|
39
|
-
Tap::Workflow.subclass(nest(name), configs, options, &block)
|
40
|
-
end
|
41
|
-
|
42
|
-
def workflow(name, configs={}, options={}, &block)
|
43
|
-
options[:arity] = arity(block)
|
44
|
-
worcflow(name, configs, options, &task_block(block)).new
|
45
|
-
end
|
46
|
-
|
47
|
-
protected
|
48
|
-
|
49
|
-
def config(key, value=nil, options={}, &block)
|
50
|
-
caller.each do |line|
|
51
|
-
case line
|
52
|
-
when /^(([A-z]:)?[^:]+):(\d+)/
|
53
|
-
options[:desc] = Support::Lazydoc.register($1, $3.to_i - 1)
|
54
|
-
break
|
55
|
-
end
|
56
|
-
end if options[:desc] == nil
|
57
|
-
|
58
|
-
[:config, key, value, options, block]
|
59
|
-
end
|
60
|
-
|
61
|
-
def config_attr(key, value=nil, options={}, &block)
|
62
|
-
caller.each do |line|
|
63
|
-
case line
|
64
|
-
when /^(([A-z]:)?[^:]+):(\d+)/
|
65
|
-
options[:desc] = Support::Lazydoc.register($1, $3.to_i - 1)
|
66
|
-
break
|
67
|
-
end
|
68
|
-
end if options[:desc] == nil
|
69
|
-
|
70
|
-
[:config_attr, key, value, options, block]
|
71
|
-
end
|
72
|
-
|
73
|
-
def c
|
74
|
-
Support::Validation
|
75
|
-
end
|
76
|
-
|
77
|
-
private
|
78
|
-
|
79
|
-
def nest(name)
|
80
|
-
# use self if self is a Module or Class,
|
81
|
-
# or self.class if self is an instance.
|
82
|
-
File.join((self.kind_of?(Module) ? self : self.class).instance_variable_get(:@tap_declaration_base), name.to_s)
|
83
|
-
end
|
84
|
-
|
85
|
-
def arity(block)
|
86
|
-
arity = block.arity
|
87
|
-
|
88
|
-
case
|
89
|
-
when arity > 0 then arity -= 1
|
90
|
-
when arity < 0 then arity += 1
|
91
|
-
end
|
92
|
-
|
93
|
-
arity
|
94
|
-
end
|
95
|
-
|
96
|
-
def task_block(block)
|
97
|
-
lambda do |*inputs|
|
98
|
-
inputs.unshift(self)
|
99
|
-
|
100
|
-
arity = block.arity
|
101
|
-
n = inputs.length
|
102
|
-
unless n == arity || (arity < 0 && (-1-n) <= arity)
|
103
|
-
raise ArgumentError.new("wrong number of arguments (#{n} for #{arity})")
|
104
|
-
end
|
105
|
-
|
106
|
-
block.call(*inputs)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
require 'tap/support/batchable'
|
2
|
-
require 'tap/support/executable'
|
3
|
-
require 'tap/support/framework_class'
|
4
|
-
|
5
|
-
module Tap
|
6
|
-
module Support
|
7
|
-
|
8
|
-
# Framework encapsulates the basic framework functionality (batching,
|
9
|
-
# configuration, documentation, etc) used by Task and Workflow. Note
|
10
|
-
# that Framework does NOT encapsulate the functionality needed to
|
11
|
-
# make a class useful in workflows, such as enq and on_complete.
|
12
|
-
module Framework
|
13
|
-
include Batchable
|
14
|
-
include Configurable
|
15
|
-
|
16
|
-
def self.included(mod)
|
17
|
-
mod.extend Support::BatchableClass
|
18
|
-
mod.extend Support::ConfigurableClass
|
19
|
-
mod.extend Support::FrameworkClass
|
20
|
-
mod.lazy_attr :manifest
|
21
|
-
mod.lazy_attr :args
|
22
|
-
end
|
23
|
-
|
24
|
-
# The application used to load config_file templates
|
25
|
-
# (and hence, to initialize batched objects).
|
26
|
-
attr_reader :app
|
27
|
-
|
28
|
-
# The name of self.
|
29
|
-
#--
|
30
|
-
# Currently names may be any object. Audit makes use of name
|
31
|
-
# via to_s, as does app when figuring configuration filepaths.
|
32
|
-
attr_accessor :name
|
33
|
-
|
34
|
-
# Initializes a new instance and associated batch objects. Batch
|
35
|
-
# objects will be initialized for each configuration template
|
36
|
-
# specified by app.each_config_template(config_file) where
|
37
|
-
# config_file = app.config_filepath(name).
|
38
|
-
def initialize(config={}, name=nil, app=App.instance)
|
39
|
-
super()
|
40
|
-
@app = app
|
41
|
-
@name = name || self.class.default_name
|
42
|
-
|
43
|
-
case config
|
44
|
-
when InstanceConfiguration
|
45
|
-
@config = config
|
46
|
-
config.bind(self)
|
47
|
-
else
|
48
|
-
initialize_config(config)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# Creates a new batched object and adds the object to batch. The batched object
|
53
|
-
# will be a duplicate of the current object but with a new name and/or
|
54
|
-
# configurations.
|
55
|
-
def initialize_batch_obj(overrides={}, name=nil)
|
56
|
-
obj = super().reconfigure(overrides)
|
57
|
-
obj.name = name if name
|
58
|
-
obj
|
59
|
-
end
|
60
|
-
|
61
|
-
# Logs the inputs to the application logger (via app.log)
|
62
|
-
def log(action, msg="", level=Logger::INFO)
|
63
|
-
# TODO - add a task identifier?
|
64
|
-
app.log(action, msg, level)
|
65
|
-
end
|
66
|
-
|
67
|
-
# Raises a TerminateError if app.state == State::TERMINATE.
|
68
|
-
# check_terminate may be called at any time to provide a
|
69
|
-
# breakpoint in long-running processes.
|
70
|
-
def check_terminate
|
71
|
-
if app.state == App::State::TERMINATE
|
72
|
-
raise App::TerminateError.new
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
# Returns self.name
|
77
|
-
def to_s
|
78
|
-
name.to_s
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
@@ -1,180 +0,0 @@
|
|
1
|
-
require 'tap/support/command_line'
|
2
|
-
|
3
|
-
module Tap
|
4
|
-
module Support
|
5
|
-
|
6
|
-
# FrameworkClass encapsulates class methods related to Framework.
|
7
|
-
module FrameworkClass
|
8
|
-
|
9
|
-
# Returns the default name for the class: to_s.underscore
|
10
|
-
attr_accessor :default_name
|
11
|
-
|
12
|
-
def self.extended(base)
|
13
|
-
caller.each do |line|
|
14
|
-
case line
|
15
|
-
when /\/framework.rb/ then next
|
16
|
-
when /^(([A-z]:)?[^:]+):(\d+)/
|
17
|
-
base.instance_variable_set(:@source_file, File.expand_path($1))
|
18
|
-
break
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
base.instance_variable_set(:@default_name, base.to_s.underscore)
|
23
|
-
end
|
24
|
-
|
25
|
-
def inherited(child)
|
26
|
-
unless child.instance_variable_defined?(:@source_file)
|
27
|
-
caller.first =~ /^(([A-z]:)?[^:]+):(\d+)/
|
28
|
-
child.instance_variable_set(:@source_file, File.expand_path($1))
|
29
|
-
end
|
30
|
-
|
31
|
-
child.instance_variable_set(:@default_name, child.to_s.underscore)
|
32
|
-
super
|
33
|
-
end
|
34
|
-
|
35
|
-
def subclass(const_name, configs={}, options={}, &block)
|
36
|
-
# Generate the nesting module
|
37
|
-
current, constants = const_name.to_s.constants_split
|
38
|
-
raise ArgumentError, "#{current} is already defined!" if constants.empty?
|
39
|
-
|
40
|
-
subclass_const = constants.pop
|
41
|
-
constants.each {|const| current = current.const_set(const, Module.new)}
|
42
|
-
|
43
|
-
# Generate the subclass
|
44
|
-
subclass = Class.new(self)
|
45
|
-
configs = configs[0] if configs.kind_of?(Array) && configs.length == 1 && configs[0].kind_of?(Hash)
|
46
|
-
|
47
|
-
case configs
|
48
|
-
when Hash
|
49
|
-
subclass.send(:attr_accessor, *configs.keys)
|
50
|
-
configs.each_pair do |key, value|
|
51
|
-
subclass.configurations.add(key, value)
|
52
|
-
end
|
53
|
-
when Array
|
54
|
-
configs.each do |method, key, value, opts, config_block|
|
55
|
-
subclass.send(method, key, value, opts, &config_block)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
block_method = options[:block_method] || :process
|
60
|
-
subclass.send(:define_method, block_method, &block)
|
61
|
-
subclass.default_name = const_name
|
62
|
-
|
63
|
-
const_name = current == Object ? subclass_const : "#{current}::#{subclass_const}"
|
64
|
-
caller.each_with_index do |line, index|
|
65
|
-
case line
|
66
|
-
when /\/tap\/support\/declarations.rb/ then next
|
67
|
-
when /^(([A-z]:)?[^:]+):(\d+)/
|
68
|
-
subclass.source_file = File.expand_path($1)
|
69
|
-
lzd = subclass.lazydoc(false)
|
70
|
-
lzd[const_name, false]['manifest'] = lzd.register($3.to_i - 1)
|
71
|
-
break
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
arity = options[:arity] || block.arity
|
76
|
-
comment = Comment.new
|
77
|
-
comment.subject = case
|
78
|
-
when arity > 0
|
79
|
-
Array.new(arity, "INPUT").join(' ')
|
80
|
-
when arity < 0
|
81
|
-
array = Array.new(-1 * arity - 1, "INPUT")
|
82
|
-
array << "INPUTS..."
|
83
|
-
array.join(' ')
|
84
|
-
else ""
|
85
|
-
end
|
86
|
-
subclass.lazydoc(false)[const_name, false]['args'] ||= comment
|
87
|
-
|
88
|
-
# Set the subclass constant
|
89
|
-
current.const_set(subclass_const, subclass)
|
90
|
-
end
|
91
|
-
|
92
|
-
DEFAULT_HELP_TEMPLATE = %Q{<% manifest = task_class.manifest %>
|
93
|
-
<%= task_class %><%= manifest.subject.to_s.strip.empty? ? '' : ' -- ' %><%= manifest.subject %>
|
94
|
-
|
95
|
-
<% unless manifest.empty? %>
|
96
|
-
<%= '-' * 80 %>
|
97
|
-
|
98
|
-
<% manifest.wrap(77, 2, nil).each do |line| %>
|
99
|
-
<%= line %>
|
100
|
-
<% end %>
|
101
|
-
<%= '-' * 80 %>
|
102
|
-
<% end %>
|
103
|
-
|
104
|
-
}
|
105
|
-
|
106
|
-
def instantiate(argv, app=Tap::App.instance) # => instance, argv
|
107
|
-
opts = OptionParser.new
|
108
|
-
|
109
|
-
# Add configurations
|
110
|
-
config = {}
|
111
|
-
unless configurations.empty?
|
112
|
-
opts.separator ""
|
113
|
-
opts.separator "configurations:"
|
114
|
-
end
|
115
|
-
|
116
|
-
configurations.each do |receiver, key, configuration|
|
117
|
-
opts.on(*CommandLine.configv(configuration)) do |value|
|
118
|
-
config[key] = value
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
# Add options on_tail, giving priority to configurations
|
123
|
-
opts.separator ""
|
124
|
-
opts.separator "options:"
|
125
|
-
|
126
|
-
opts.on_tail("-h", "--help", "Print this help") do
|
127
|
-
opts.banner = "#{help}usage: tap run -- #{to_s.underscore} #{args.subject}"
|
128
|
-
puts opts
|
129
|
-
exit
|
130
|
-
end
|
131
|
-
|
132
|
-
# Add option for name
|
133
|
-
name = default_name
|
134
|
-
opts.on_tail('--name NAME', /^[^-].*/, 'Specify a name') do |value|
|
135
|
-
name = value
|
136
|
-
end
|
137
|
-
|
138
|
-
# Add option to add args
|
139
|
-
use_args = []
|
140
|
-
opts.on_tail('--use FILE', /^[^-].*/, 'Loads inputs from file') do |value|
|
141
|
-
obj = YAML.load_file(value)
|
142
|
-
case obj
|
143
|
-
when Hash
|
144
|
-
obj.values.each do |array|
|
145
|
-
# error if value isn't an array
|
146
|
-
use_args.concat(array)
|
147
|
-
end
|
148
|
-
when Array
|
149
|
-
use_args.concat(obj)
|
150
|
-
else
|
151
|
-
use_args << obj
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
opts.parse!(argv)
|
156
|
-
obj = new({}, name, app)
|
157
|
-
|
158
|
-
path_configs = load_config(app.config_filepath(name))
|
159
|
-
if path_configs.kind_of?(Array)
|
160
|
-
path_configs.each_with_index do |path_config, i|
|
161
|
-
obj.initialize_batch_obj(path_config, "#{name}_#{i}") unless i == 0
|
162
|
-
end
|
163
|
-
path_configs = path_configs[0]
|
164
|
-
end
|
165
|
-
|
166
|
-
[obj.reconfigure(path_configs).reconfigure(config), argv + use_args]
|
167
|
-
end
|
168
|
-
|
169
|
-
def lazydoc(resolve=true)
|
170
|
-
lazydoc = super(false)
|
171
|
-
lazydoc.register_method_pattern('args', :process) unless lazydoc.resolved?
|
172
|
-
super
|
173
|
-
end
|
174
|
-
|
175
|
-
def help
|
176
|
-
Tap::Support::Templater.new(DEFAULT_HELP_TEMPLATE, :task_class => self).build
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
180
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Tap
|
2
|
-
module Support
|
3
|
-
# Raised when an exception is raised during App#run. All errors generated during
|
4
|
-
# termination are collected into the RunError.
|
5
|
-
class RunError < RuntimeError
|
6
|
-
attr_reader :errors
|
7
|
-
|
8
|
-
def initialize(errors)
|
9
|
-
@errors = errors
|
10
|
-
@backtrace = nil
|
11
|
-
end
|
12
|
-
|
13
|
-
#The join of all the error messages.
|
14
|
-
def message
|
15
|
-
lines = []
|
16
|
-
errors.each_with_index do |error, i|
|
17
|
-
lines << "\nRunError [#{i}] #{error.class} #{error.message}"
|
18
|
-
end
|
19
|
-
lines.join + "\n"
|
20
|
-
end
|
21
|
-
|
22
|
-
#The join of all the error backtraces.
|
23
|
-
def backtrace
|
24
|
-
# backtrace gets called every time RunError is re-raised, leading to multiple
|
25
|
-
# repeats of the error backtraces. This ensures the additional backtrace
|
26
|
-
# information is only added once.
|
27
|
-
return @backtrace unless @backtrace == nil
|
28
|
-
return nil unless @backtrace = super
|
29
|
-
|
30
|
-
errors.each_with_index do |error, i|
|
31
|
-
@backtrace [-1] += "\n\n---------------------- RunError [#{i}] ----------------------\n#{error.class} #{error.message}"
|
32
|
-
@backtrace.concat(error.backtrace || ["missing backtrace"])
|
33
|
-
end
|
34
|
-
@backtrace
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
data/lib/tap/support/summary.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
module Tap
|
2
|
-
module Support
|
3
|
-
class Summary
|
4
|
-
def initialize
|
5
|
-
@map = []
|
6
|
-
@width = 10
|
7
|
-
end
|
8
|
-
|
9
|
-
def add(env_key, env, map)
|
10
|
-
unless map.empty?
|
11
|
-
@map << [env_key, env, map]
|
12
|
-
map.each {|(key, path)| @width = key.length if @width < key.length }
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def lines
|
17
|
-
lines = []
|
18
|
-
@map.each do |(env_lookup, env, map)|
|
19
|
-
lines << "#{env_lookup}:" if @map.length > 1
|
20
|
-
map.each do |(key, path)|
|
21
|
-
desc = block_given? ? (yield(path) || '') : ''
|
22
|
-
desc = " # #{desc}" unless desc.empty?
|
23
|
-
lines << (" %-#{@width}s%s" % [key, desc])
|
24
|
-
end
|
25
|
-
end
|
26
|
-
lines
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|