tap 0.12.4 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History +34 -0
- data/README +62 -41
- data/bin/tap +36 -40
- data/cmd/console.rb +14 -6
- data/cmd/manifest.rb +62 -58
- data/cmd/run.rb +49 -31
- data/doc/API +84 -0
- data/doc/Class Reference +83 -115
- data/doc/Examples/Command Line +36 -0
- data/doc/Examples/Workflow +40 -0
- data/lib/tap/app.rb +293 -214
- data/lib/tap/app/node.rb +43 -0
- data/lib/tap/app/queue.rb +77 -0
- data/lib/tap/app/stack.rb +16 -0
- data/lib/tap/app/state.rb +22 -0
- data/lib/tap/constants.rb +2 -2
- data/lib/tap/env.rb +400 -314
- data/lib/tap/env/constant.rb +227 -0
- data/lib/tap/env/gems.rb +63 -0
- data/lib/tap/env/manifest.rb +89 -0
- data/lib/tap/env/minimap.rb +292 -0
- data/lib/tap/{support → env}/string_ext.rb +2 -2
- data/lib/tap/exe.rb +113 -125
- data/lib/tap/join.rb +175 -0
- data/lib/tap/joins.rb +9 -0
- data/lib/tap/joins/switch.rb +44 -0
- data/lib/tap/joins/sync.rb +99 -0
- data/lib/tap/root.rb +100 -491
- data/lib/tap/root/utils.rb +220 -0
- data/lib/tap/{support → root}/versions.rb +31 -29
- data/lib/tap/schema.rb +248 -0
- data/lib/tap/schema/parser.rb +413 -0
- data/lib/tap/schema/utils.rb +82 -0
- data/lib/tap/support/intern.rb +19 -6
- data/lib/tap/support/templater.rb +8 -3
- data/lib/tap/task.rb +175 -171
- data/lib/tap/tasks/dump.rb +58 -0
- data/lib/tap/tasks/load.rb +62 -0
- metadata +30 -73
- data/cmd/destroy.rb +0 -27
- data/cmd/generate.rb +0 -27
- data/doc/Command Reference +0 -105
- data/doc/Syntax Reference +0 -234
- data/doc/Tutorial +0 -348
- data/lib/tap/dump.rb +0 -142
- data/lib/tap/file_task.rb +0 -384
- data/lib/tap/generator/arguments.rb +0 -13
- data/lib/tap/generator/base.rb +0 -176
- data/lib/tap/generator/destroy.rb +0 -60
- data/lib/tap/generator/generate.rb +0 -93
- data/lib/tap/generator/generators/command/command_generator.rb +0 -21
- data/lib/tap/generator/generators/command/templates/command.erb +0 -32
- data/lib/tap/generator/generators/config/config_generator.rb +0 -98
- data/lib/tap/generator/generators/generator/generator_generator.rb +0 -37
- data/lib/tap/generator/generators/generator/templates/task.erb +0 -27
- data/lib/tap/generator/generators/generator/templates/test.erb +0 -26
- data/lib/tap/generator/generators/root/root_generator.rb +0 -84
- data/lib/tap/generator/generators/root/templates/MIT-LICENSE +0 -22
- data/lib/tap/generator/generators/root/templates/README +0 -14
- data/lib/tap/generator/generators/root/templates/Rakefile +0 -84
- data/lib/tap/generator/generators/root/templates/Rapfile +0 -11
- data/lib/tap/generator/generators/root/templates/gemspec +0 -27
- data/lib/tap/generator/generators/root/templates/test/tap_test_helper.rb +0 -3
- data/lib/tap/generator/generators/task/task_generator.rb +0 -25
- data/lib/tap/generator/generators/task/templates/task.erb +0 -14
- data/lib/tap/generator/generators/task/templates/test.erb +0 -19
- data/lib/tap/generator/manifest.rb +0 -20
- data/lib/tap/generator/preview.rb +0 -69
- data/lib/tap/load.rb +0 -64
- data/lib/tap/spec.rb +0 -41
- data/lib/tap/support/aggregator.rb +0 -65
- data/lib/tap/support/audit.rb +0 -333
- data/lib/tap/support/constant.rb +0 -143
- data/lib/tap/support/constant_manifest.rb +0 -126
- data/lib/tap/support/dependencies.rb +0 -54
- data/lib/tap/support/dependency.rb +0 -44
- data/lib/tap/support/executable.rb +0 -198
- data/lib/tap/support/executable_queue.rb +0 -125
- data/lib/tap/support/gems.rb +0 -43
- data/lib/tap/support/join.rb +0 -144
- data/lib/tap/support/joins.rb +0 -12
- data/lib/tap/support/joins/switch.rb +0 -27
- data/lib/tap/support/joins/sync_merge.rb +0 -38
- data/lib/tap/support/manifest.rb +0 -171
- data/lib/tap/support/minimap.rb +0 -90
- data/lib/tap/support/node.rb +0 -176
- data/lib/tap/support/parser.rb +0 -450
- data/lib/tap/support/schema.rb +0 -385
- data/lib/tap/support/shell_utils.rb +0 -67
- data/lib/tap/test.rb +0 -77
- data/lib/tap/test/assertions.rb +0 -38
- data/lib/tap/test/env_vars.rb +0 -29
- data/lib/tap/test/extensions.rb +0 -73
- data/lib/tap/test/file_test.rb +0 -362
- data/lib/tap/test/file_test_class.rb +0 -15
- data/lib/tap/test/regexp_escape.rb +0 -87
- data/lib/tap/test/script_test.rb +0 -46
- data/lib/tap/test/script_tester.rb +0 -115
- data/lib/tap/test/subset_test.rb +0 -260
- data/lib/tap/test/subset_test_class.rb +0 -99
- data/lib/tap/test/tap_test.rb +0 -109
- data/lib/tap/test/utils.rb +0 -231
data/History
CHANGED
@@ -1,3 +1,37 @@
|
|
1
|
+
== 0.17.0 / 2009-05-25
|
2
|
+
|
3
|
+
Significant reorganization and update to Tap internals.
|
4
|
+
The workflow syntax for joins has changed in incompatible
|
5
|
+
ways, and several key methods have been renamed.
|
6
|
+
Obviously not backwards compatible but most tasks will
|
7
|
+
work without alteration.
|
8
|
+
|
9
|
+
Upgrade Notes:
|
10
|
+
|
11
|
+
* Tasks now are identified by "::task" rather than "::manifest"
|
12
|
+
The manifest identifier still works for now but will be
|
13
|
+
removed by 1.0.
|
14
|
+
* Root#filepath and Root#relative_filepath have been renamed
|
15
|
+
Root#path and Root#relative_path
|
16
|
+
* Audits have been removed
|
17
|
+
* Generators, FileTask, and test modules have been removed
|
18
|
+
to separate modules (tap-gen, tap-tasks, tap-test). Install
|
19
|
+
tap-suite to get them all back.
|
20
|
+
* switched const_name, name on Constant
|
21
|
+
* refactored on_complete_block to join
|
22
|
+
* callbacks in Task have been removed
|
23
|
+
* schema syntax no longer supports rounds, globals
|
24
|
+
|
25
|
+
Changes:
|
26
|
+
|
27
|
+
* added application middleware
|
28
|
+
* reworked dump to use an io target config
|
29
|
+
* added unloading to Constant
|
30
|
+
* reworked App to use aggregators that respond_to? call
|
31
|
+
* reworked Join so that it may be dumped as YAML
|
32
|
+
* reworked Schema syntax
|
33
|
+
* etc
|
34
|
+
|
1
35
|
== 0.12.4 / 2009-03-23
|
2
36
|
|
3
37
|
* fixed bug in App#inspect
|
data/README
CHANGED
@@ -2,51 +2,47 @@
|
|
2
2
|
|
3
3
|
tap n. to draw a supply from a resource
|
4
4
|
|
5
|
-
A
|
5
|
+
A configurable, distributable workflow framework.
|
6
6
|
|
7
7
|
== Description
|
8
8
|
|
9
|
-
Tap
|
10
|
-
from the command line.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
Tap allows the construction of imperative and dependency-based workflows that
|
10
|
+
may be defined, configured, and run from the command line. The tasks and joins
|
11
|
+
composing a workflow are easy to test, subclass, and distribute as gems.
|
12
|
+
|
13
|
+
Tap is the core of the
|
14
|
+
{Tap-Suite}[http://tap.rubyforge.org/tap-suite/index.html]
|
15
|
+
which provides a standard library of
|
16
|
+
{tasks}[http://tap.rubyforge.org/tap-tasks/index.html],
|
17
|
+
{generators}[http://tap.rubyforge.org/tap-gen/index.html],
|
18
|
+
{test utilities}[http://tap.rubyforge.org/tap-test/index.html],
|
19
|
+
and a
|
20
|
+
{server}[http://tap.rubyforge.org/tap-server/index.html]
|
21
|
+
to execute workflows via HTTP.
|
22
|
+
|
23
|
+
* {Tutorial}[link:files/doc/Tutorial.html], {API}[link:files/doc/API.html], {Structure}[link:files/doc/Class%20Reference.html]
|
17
24
|
* Website[http://tap.rubyforge.org]
|
18
25
|
* Lighthouse[http://bahuvrihi.lighthouseapp.com/projects/9908-tap-task-application/tickets]
|
19
26
|
* Github[http://github.com/bahuvrihi/tap/tree/master]
|
20
27
|
* {Google Group}[http://groups.google.com/group/ruby-on-tap]
|
21
28
|
|
22
|
-
|
29
|
+
== Usage
|
23
30
|
|
24
|
-
|
25
|
-
but play well together. See the {Tutorial}[link:files/doc/Tutorial.html].
|
26
|
-
- Tap is tested on MRI (the standard Ruby interpreter, versions 1.8.6 and
|
27
|
-
1.9.0) and JRuby[http://jruby.codehaus.org/].
|
28
|
-
- Tap is the core of the {Tap-Suite}[http://tap.rubyforge.org/tap-suite], a
|
29
|
-
collection of several modules that simplify development.
|
30
|
-
|
31
|
-
=== Usage
|
32
|
-
|
33
|
-
A simple task illustrates the usage of tap:
|
31
|
+
Tasks are defined as subclasses of Tap::Task.
|
34
32
|
|
35
33
|
[lib/goodnight.rb]
|
36
34
|
|
37
|
-
# Goodnight::
|
35
|
+
# Goodnight::task your basic goodnight moon task
|
38
36
|
# Says goodnight with a configurable message.
|
39
37
|
class Goodnight < Tap::Task
|
40
|
-
|
41
38
|
config :message, 'goodnight' # a goodnight message
|
42
|
-
|
39
|
+
|
43
40
|
def process(name)
|
44
|
-
log(message, name)
|
45
41
|
"#{message} #{name}"
|
46
42
|
end
|
47
43
|
end
|
48
44
|
|
49
|
-
Tap pulls documentation out
|
45
|
+
Tap automatically discovers and pulls documentation out to generate manifests:
|
50
46
|
|
51
47
|
% tap run -T
|
52
48
|
sample:
|
@@ -71,26 +67,52 @@ And help:
|
|
71
67
|
--help Print this help
|
72
68
|
--name NAME Specifies the task name
|
73
69
|
--config FILE Specifies a config file
|
74
|
-
--use FILE Loads inputs to ARGV
|
75
70
|
|
76
|
-
Tasks are immediately
|
71
|
+
Tasks are available immediately for use in workflows. The process method takes
|
72
|
+
inputs from the command line and passes its result to other tasks.
|
73
|
+
|
74
|
+
% tap run -- goodnight moon --: dump
|
75
|
+
goodnight moon
|
76
|
+
|
77
|
+
Tasks may be configured as if they were individual executables:
|
78
|
+
|
79
|
+
% tap run -- goodnight world --message hello --: dump
|
80
|
+
hello world
|
81
|
+
|
82
|
+
=== Workflow Syntax
|
77
83
|
|
78
|
-
|
79
|
-
I[00:09:55] goodnight moon
|
84
|
+
Workflows are specified on the command line using argument vectors separated by option breaks. The argument vectors define the tasks and modifications to the breaks (--: or --[i,j][k]) specify joins.
|
80
85
|
|
81
|
-
|
86
|
+
A simple sequence:
|
82
87
|
|
83
|
-
% tap
|
84
|
-
|
85
|
-
% tap generate task goodnight
|
86
|
-
% tap run -- goodnight moon
|
88
|
+
% tap run -- load 'goodnight moon' --: dump
|
89
|
+
goodnight moon
|
87
90
|
|
88
|
-
|
91
|
+
A more formal way of specifying a sequence:
|
89
92
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
93
|
+
% tap run -- load 'goodnight moon' -- dump --[0][1]
|
94
|
+
goodnight moon
|
95
|
+
|
96
|
+
A fork:
|
97
|
+
|
98
|
+
% tap run -- load 'goodnight moon' -- dump -- dump --[0][1,2]
|
99
|
+
goodnight moon
|
100
|
+
goodnight moon
|
101
|
+
|
102
|
+
A merge (note that dump receives the inputs in serial):
|
103
|
+
|
104
|
+
% tap run -- load goodnight -- load moon -- dump --[0,1][2]
|
105
|
+
goodnight
|
106
|
+
moon
|
107
|
+
|
108
|
+
A synchronized merge where the results of each input are collected into an array before being passed to dump. The printout is: ['goodnight', 'moon'].to_s
|
109
|
+
|
110
|
+
% tap run -- load goodnight -- load moon -- dump --[0,1][2].sync
|
111
|
+
goodnightmoon
|
112
|
+
|
113
|
+
== Known Issues
|
114
|
+
|
115
|
+
Tap::Env and Tap::Schema are still in flux and have poor documentation. Neither should be treated as stable.
|
94
116
|
|
95
117
|
== Installation
|
96
118
|
|
@@ -109,5 +131,4 @@ Tap requires an updated version of RubyGems[http://docs.rubygems.org/]
|
|
109
131
|
Copyright (c) 2006-2009, Regents of the University of Colorado.
|
110
132
|
Developer:: {Simon Chiang}[http://bahuvrihi.wordpress.com], {Biomolecular Structure Program}[http://biomol.uchsc.edu/], {Hansen Lab}[http://hsc-proteomics.uchsc.edu/hansenlab/]
|
111
133
|
Support:: CU Denver School of Medicine Deans Academic Enrichment Fund
|
112
|
-
License:: {MIT-Style}[link:files/MIT-LICENSE.html]
|
113
|
-
|
134
|
+
License:: {MIT-Style}[link:files/MIT-LICENSE.html]
|
data/bin/tap
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# usage: tap <command> {options} [args]
|
2
|
+
# usage: tap <command> {options} [args]
|
3
3
|
#
|
4
|
-
# Launches a tap command.
|
4
|
+
# Launches a tap command.
|
5
5
|
#
|
6
6
|
# examples:
|
7
7
|
# tap generate root . # generates a root dir
|
@@ -14,9 +14,12 @@
|
|
14
14
|
|
15
15
|
require "#{File.dirname(__FILE__)}/../lib/tap.rb"
|
16
16
|
|
17
|
+
#
|
17
18
|
# setup the environment
|
19
|
+
#
|
20
|
+
|
18
21
|
begin
|
19
|
-
|
22
|
+
exe = Tap::Exe.setup
|
20
23
|
rescue(Tap::Env::ConfigError)
|
21
24
|
# catch errors and exit gracefully
|
22
25
|
# (errors usu from gem loading errors)
|
@@ -25,47 +28,40 @@ rescue(Tap::Env::ConfigError)
|
|
25
28
|
end
|
26
29
|
|
27
30
|
#
|
28
|
-
#
|
31
|
+
# launch tap
|
29
32
|
#
|
30
33
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
#
|
42
|
-
# run before script
|
43
|
-
#
|
34
|
+
exe.activate
|
35
|
+
exe.launch(ARGV) do
|
36
|
+
template = %Q{<% unless entries.empty? || count <= 1 %>
|
37
|
+
<%= env_key %>:
|
38
|
+
<% end %>
|
39
|
+
<% entries.each do |key, path| %>
|
40
|
+
<%= key.ljust(width) %>
|
41
|
+
<% end %>}
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
env.execute(ARGV) do
|
60
|
-
puts Lazydoc.usage(__FILE__)
|
61
|
-
puts
|
62
|
-
puts "available commands:"
|
63
|
-
puts env.summarize(:commands)
|
64
|
-
puts
|
65
|
-
puts "version #{Tap::VERSION} -- #{Tap::WEBSITE}"
|
43
|
+
commands = exe.manifest(:command).inspect(template,
|
44
|
+
:count => 0,
|
45
|
+
:width => 10
|
46
|
+
) do |templater, globals|
|
47
|
+
entries = templater.manifest.minimap
|
48
|
+
templater.entries = entries
|
49
|
+
|
50
|
+
# determine width, count
|
51
|
+
width = globals[:width]
|
52
|
+
entries.each do |key, path|
|
53
|
+
width = key.length if width < key.length
|
54
|
+
end
|
55
|
+
globals[:width] = width
|
56
|
+
globals[:count] += 1 unless entries.empty?
|
66
57
|
end
|
67
|
-
|
68
|
-
|
58
|
+
|
59
|
+
puts Lazydoc.usage(__FILE__)
|
60
|
+
puts
|
61
|
+
puts "available commands:"
|
62
|
+
puts commands
|
63
|
+
puts
|
64
|
+
puts "version #{Tap::VERSION} -- #{Tap::WEBSITE}"
|
69
65
|
end
|
70
66
|
|
71
67
|
exit(0)
|
data/cmd/console.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# usage: tap console [options]
|
2
2
|
#
|
3
3
|
# Opens up an IRB session with the Tap environment initialized as specified
|
4
|
-
# in tap.yml. Access
|
5
|
-
#
|
4
|
+
# in tap.yml. Access a Tap::App instance through 'app' and the execution
|
5
|
+
# environment through 'env'. For example:
|
6
6
|
#
|
7
7
|
# % tap console
|
8
|
-
# >> env
|
8
|
+
# >> env[:task][:dump]
|
9
|
+
# => Tap::Tasks::Dump
|
9
10
|
# >> app.info
|
10
|
-
# => "state: 0 (READY) queue: 0
|
11
|
+
# => "state: 0 (READY) queue: 0"
|
11
12
|
# >>
|
12
13
|
#
|
13
14
|
|
@@ -25,11 +26,18 @@ end.parse!(ARGV)
|
|
25
26
|
require "irb"
|
26
27
|
|
27
28
|
def app
|
28
|
-
Tap::App.
|
29
|
+
@app ||= Tap::App.new
|
29
30
|
end
|
30
31
|
|
31
32
|
def env
|
32
|
-
Tap::Env.instance
|
33
|
+
@env ||= Tap::Env.instance
|
34
|
+
end
|
35
|
+
|
36
|
+
def run(cmd, reset=true)
|
37
|
+
app.reset if reset
|
38
|
+
schema = Tap::Schema.parse(cmd)
|
39
|
+
env.run(schema, app)
|
40
|
+
nil
|
33
41
|
end
|
34
42
|
|
35
43
|
IRB.start
|
data/cmd/manifest.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
# usage: tap manifest [options]
|
1
|
+
# usage: tap manifest [options] [filter]
|
2
|
+
#
|
3
|
+
# Prints a manifest of all resources in the current tap environment. Env
|
4
|
+
# keys may be provided to select a specific set of environments to list.
|
5
|
+
#
|
6
|
+
# % tap manifest
|
7
|
+
# % tap manifest tap-tasks
|
2
8
|
#
|
3
|
-
# Prints a manifest of all resources in the current tap environment.
|
4
|
-
|
5
9
|
options = {}
|
6
10
|
ConfigParser.new do |opts|
|
7
11
|
|
@@ -13,85 +17,85 @@ ConfigParser.new do |opts|
|
|
13
17
|
puts opts
|
14
18
|
exit
|
15
19
|
end
|
16
|
-
|
17
|
-
# opts.on("-t", "--tree", "Just print the env tree.") do
|
18
|
-
# options[:tree] = true
|
19
|
-
# end
|
20
|
-
|
21
|
-
# opts.on("-r", "--require FILEPATH", "Require the specified file") do |value|
|
22
|
-
# require value
|
23
|
-
# end
|
24
|
-
|
25
20
|
end.parse!(ARGV)
|
26
21
|
|
27
|
-
|
28
|
-
|
29
|
-
env.
|
30
|
-
|
31
|
-
|
22
|
+
template = %Q{<% unless manifests.empty? %>
|
23
|
+
#{'-' * 80}
|
24
|
+
<%= (env_key + ':').ljust(width) %> (<%= env.root.root %>)
|
25
|
+
<% manifests.each do |type, entries| %>
|
26
|
+
<%= type %>
|
27
|
+
<% entries.each do |key, value| %>
|
28
|
+
<%= key.ljust(width-4) %> (<%= value %>)
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
}
|
32
33
|
|
33
|
-
filter
|
34
|
-
|
34
|
+
# filter envs to manifest
|
35
|
+
env = Tap::Env.instance
|
36
|
+
env_keys = env.minihash(true)
|
37
|
+
filter = if ARGV.empty?
|
38
|
+
env_keys.keys
|
35
39
|
else
|
36
40
|
ARGV.collect do |name|
|
37
|
-
|
38
|
-
raise "could not find an env matching: #{name}"
|
39
|
-
end
|
40
|
-
|
41
|
-
entry[1]
|
41
|
+
env.minimatch(name) or raise "could not find an env matching: #{name}"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
<% manifests.each do |manifest_name, entries| %>
|
48
|
-
<%= manifest_name %>
|
49
|
-
<% entries.each do |name, path| %>
|
50
|
-
<%= name.ljust(width-4) %> (<%= path %>)
|
51
|
-
<% end %>
|
52
|
-
<% end %>
|
53
|
-
}
|
54
|
-
|
55
|
-
width = 10
|
56
|
-
summary = env.inspect(template) do |templater, share|
|
45
|
+
# build the summary
|
46
|
+
summary = env.inspect(template, :width => 10) do |templater, globals|
|
57
47
|
current = templater.env
|
58
|
-
next unless filter.include?(current)
|
59
|
-
|
60
48
|
manifests = []
|
61
|
-
|
62
|
-
|
63
|
-
|
49
|
+
templater.manifests = manifests
|
50
|
+
next unless filter.include?(current)
|
51
|
+
|
52
|
+
# determine the width of the keys
|
53
|
+
width = globals[:width]
|
54
|
+
env_key = env_keys[current]
|
55
|
+
templater.env_key = env_key
|
56
|
+
width = env_key.length if width < env_key.length
|
57
|
+
|
58
|
+
# build up the entries for each type of resource
|
59
|
+
current.registry(true).to_a.sort_by do |(type, entries)|
|
60
|
+
type.to_s
|
61
|
+
end.each do |type, entries|
|
62
|
+
next if entries.empty?
|
64
63
|
|
65
|
-
entries
|
66
|
-
|
67
|
-
|
68
|
-
|
64
|
+
entries.extend(Tap::Env::Minimap)
|
65
|
+
entries = entries.minimap.collect do |key, entry|
|
66
|
+
path = if entry.kind_of?(Tap::Env::Constant)
|
67
|
+
entry.require_path
|
68
|
+
else
|
69
|
+
entry
|
69
70
|
end
|
70
71
|
|
71
|
-
width =
|
72
|
-
[
|
72
|
+
width = key.length if width < key.length
|
73
|
+
[key, current.root.relative_path(:root, path) || path]
|
73
74
|
end
|
74
75
|
|
75
|
-
manifests << [
|
76
|
+
manifests << [type, entries]
|
76
77
|
end
|
77
|
-
templater.manifests = manifests.compact
|
78
|
-
templater.env_name = env_names[current]
|
79
78
|
|
80
|
-
width =
|
81
|
-
share[:width] = width + 2
|
79
|
+
globals[:width] = width
|
82
80
|
end
|
83
81
|
puts summary
|
84
82
|
|
85
83
|
if ARGV.empty?
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
84
|
+
templaters = []
|
85
|
+
globals = env.recursive_inject([0, nil]) do |(nesting_depth, last), current|
|
86
|
+
leader = nesting_depth == 0 ? "" : '| ' * (nesting_depth - 1) + (last == current ? "`- " : "|- ")
|
87
|
+
templaters << Tap::Support::Templater.new("<%= leader %><%= env_key %> \n",
|
88
|
+
:env_key => env_keys[current],
|
89
|
+
:leader => leader
|
90
|
+
)
|
91
91
|
|
92
92
|
[nesting_depth + 1, current.envs[-1]]
|
93
93
|
end
|
94
|
-
|
94
|
+
|
95
|
+
tree = templaters.collect do |templater|
|
96
|
+
templater.build
|
97
|
+
end.join
|
98
|
+
|
95
99
|
puts '-' * 80
|
96
100
|
puts
|
97
101
|
puts tree
|