gd_bam 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/bam +36 -3
- data/lib/bam/version.rb +1 -1
- data/lib/base/flow.rb +4 -0
- metadata +2 -2
data/bin/bam
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'gli'
|
3
3
|
require 'bam'
|
4
|
-
|
4
|
+
require "highline/import"
|
5
5
|
include GLI::App
|
6
6
|
|
7
7
|
program_desc 'Describe your application here'
|
@@ -172,8 +172,41 @@ end
|
|
172
172
|
desc "Prepares params.prm file for debugging that particular graph"
|
173
173
|
command :debug do |c|
|
174
174
|
c.action do |global_options,options,args|
|
175
|
-
|
176
|
-
|
175
|
+
debug_path = args.first
|
176
|
+
vs = []
|
177
|
+
Pathname(debug_path).ascend {|v| vs << v }
|
178
|
+
project_path = vs.last
|
179
|
+
debug_path = Pathname(debug_path).basename
|
180
|
+
# fail "Arguments should be passed as \"project\" \"flow\" \"graph\"" if args.length < 3
|
181
|
+
params = global_options[:user_params]
|
182
|
+
params = PARAMS.merge({
|
183
|
+
:project_name => "downloaders-#{PARAMS[:project_name]}",
|
184
|
+
:graph_repos => [
|
185
|
+
GoodData::Bam::Repository.create(:type => :file, :base => './local_graphs'),
|
186
|
+
GoodData::Bam::Repository.create(:type => :file, :base => GoodData::CloverGenerator::BAM_DEFINED_GRAPHS_ROOT)]
|
187
|
+
})
|
188
|
+
home = '.'
|
189
|
+
home = Pathname(home)
|
190
|
+
project = GoodData::Bam::Project.build_project(home, params)
|
191
|
+
flows = project[:flows].find_all do |flow|
|
192
|
+
GoodData::Bam::Flow.find_graphs(flow).map {|s| GoodData::Bam::Step.get_graph_path(s).basename}.any? {|name| name == debug_path}
|
193
|
+
end
|
194
|
+
index = if flows.count > 1
|
195
|
+
m = HighLine::Menu.new
|
196
|
+
m.choose do |menu|
|
197
|
+
menu.prompt = "There is more than one flow using this graph. Pick the flow you want to debug."
|
198
|
+
flows.each_with_index do |flow, i|
|
199
|
+
menu.choice(flow[:name]) do i end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
else
|
203
|
+
0
|
204
|
+
end
|
205
|
+
|
206
|
+
steps = flows.map {|flow|GoodData::Bam::Flow.find_graphs(flow).find {|s| GoodData::Bam::Step.get_graph_path(s).basename == debug_path }}
|
207
|
+
stuff = flows.map {|f| f[:name]}.zip(steps.map {|s| GoodData::Bam::Step.step_name(s)})
|
208
|
+
|
209
|
+
GoodData::Bam::Commands::set_up_debug(project_path, stuff[index][0], stuff[index][1])
|
177
210
|
end
|
178
211
|
end
|
179
212
|
|
data/lib/bam/version.rb
CHANGED
data/lib/base/flow.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gd_bam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|