zillabyte-cli 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/zillabyte-cli/version.rb +1 -1
- data/lib/zillabyte/api/apps.rb +6 -2
- data/lib/zillabyte/cli/apps.rb +23 -15
- data/lib/zillabyte/cli/config.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjAzZDgxMjBiY2M0NDU3ODEyNjEyMmJhZjA4MWQ1MjU2NjE0Zjk2YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjM2ZjY2NTRiZGU3ZmMwMzI1ZDQ5NjNkOTZmMTEzMzAxMzJmZmZkYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmJhYzkwZWZiMGNkMGJlNzY1N2NlNzdkMjA0ZTU4NzhmNGM3YTBhZjFkZWMz
|
10
|
+
Nzc0ZmJlOGQ3NjQ3NTM3YzE5NDIwNTYxZGI5ZDI4NWY2NjZiOTRkMTY0ZmYz
|
11
|
+
NGI2YjljM2RjNzc0ZGQ3ZTc5N2Y2YmMxYTZiNTkwNjQ5MWExMWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjIxYjU5Mzg3MTYzYTA5OGNkZTNlOGI5ZTFhMjVjNWY2YjE2ZDg1MmQ0YjRl
|
14
|
+
NWFmZTNhNmJhODY5ODgzOTM4YzhjYTI1ZmMyMTRjMjM5ZWJjNTk5YTcyMDc1
|
15
|
+
Yzk0ZTEzZTNkMzY0M2JhMTI2OTBhNDQ2YzY0Yjg0ZjgyNzEyNWI=
|
data/lib/zillabyte/api/apps.rb
CHANGED
@@ -169,7 +169,11 @@ class Zillabyte::API::Apps < Zillabyte::API::Base
|
|
169
169
|
options[:local_flag] = 1
|
170
170
|
hash = Zillabyte::API::Apps.get_rich_meta_info_from_script(dir, session, options)
|
171
171
|
if hash.nil?
|
172
|
-
error("unable to extract app meta information", type)
|
172
|
+
session.error("unable to extract app meta information", type) if session
|
173
|
+
end
|
174
|
+
|
175
|
+
if hash["error"]
|
176
|
+
session.error(hash["error_message"], type) if session
|
173
177
|
end
|
174
178
|
|
175
179
|
# Tar up everything...
|
@@ -242,7 +246,7 @@ class Zillabyte::API::Apps < Zillabyte::API::Base
|
|
242
246
|
full_script = File.join(dir, hash['script'])
|
243
247
|
command = nil
|
244
248
|
|
245
|
-
info_file = SecureRandom.uuid
|
249
|
+
info_file = "#{dir}/#{SecureRandom.uuid}"
|
246
250
|
arg = "--info --file #{info_file}"
|
247
251
|
|
248
252
|
case hash["language"]
|
data/lib/zillabyte/cli/apps.rb
CHANGED
@@ -53,6 +53,7 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
53
53
|
#
|
54
54
|
# --config CONFIG_FILE # use the given config file
|
55
55
|
# --type TYPE # specify an output type i.e. json
|
56
|
+
# --directory DIR # app directory
|
56
57
|
#
|
57
58
|
#Examples:
|
58
59
|
#
|
@@ -197,12 +198,17 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
197
198
|
# apps:prep [DIR]
|
198
199
|
#
|
199
200
|
# prepares an app for execution
|
200
|
-
#
|
201
|
+
# --directory DIR # app directory
|
202
|
+
# --type TYPE # specify an output type i.e. json
|
201
203
|
#
|
202
204
|
def prep
|
203
|
-
|
205
|
+
|
206
|
+
type = options[:type]
|
204
207
|
dir = options[:directory] || shift_argument || Dir.pwd
|
205
208
|
meta = Zillabyte::CLI::Config.get_config_info(dir)
|
209
|
+
if meta.nil?
|
210
|
+
error("The specified directory (#{dir}) does not appear to contain a valid Zillabyte configuration file.", type)
|
211
|
+
end
|
206
212
|
|
207
213
|
case meta["language"]
|
208
214
|
when "ruby"
|
@@ -451,7 +457,7 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
451
457
|
end
|
452
458
|
|
453
459
|
|
454
|
-
# apps:test
|
460
|
+
# apps:test [DIR]
|
455
461
|
#
|
456
462
|
# tests a local app with sample data
|
457
463
|
#
|
@@ -459,11 +465,12 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
459
465
|
# --output OUTPUT_FILE # writes sink output to a file
|
460
466
|
# --wait MAX # max time to spend on each operation (default 10 seconds)
|
461
467
|
# --batches BATCHES # number of batches to emit (default 1)
|
468
|
+
# --directory DIR # app directory
|
462
469
|
#
|
463
470
|
def test
|
464
471
|
|
465
472
|
output = options[:output]
|
466
|
-
|
473
|
+
otype = options[:type] #type is used below for something else
|
467
474
|
|
468
475
|
max_seconds = (options[:wait] || "30").to_i
|
469
476
|
batches = (options[:batches] || "1").to_i
|
@@ -515,7 +522,7 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
515
522
|
|
516
523
|
|
517
524
|
# INIT
|
518
|
-
dir = options[:
|
525
|
+
dir = options[:directory] || shift_argument || Dir.pwd
|
519
526
|
|
520
527
|
meta = Zillabyte::API::Apps.get_rich_meta_info_from_script(dir, self, {:test => true})
|
521
528
|
if meta.nil?
|
@@ -686,7 +693,7 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
686
693
|
end
|
687
694
|
|
688
695
|
|
689
|
-
cmd = command("--execute_live --name #{name}")
|
696
|
+
cmd = command("--execute_live --name #{name}", otype, dir)
|
690
697
|
begin
|
691
698
|
|
692
699
|
# Start the operation...
|
@@ -931,6 +938,7 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
931
938
|
#
|
932
939
|
# --config CONFIG_FILE # use the given config file
|
933
940
|
# --type TYPE # specify an output type i.e. json
|
941
|
+
# --directory DIR # directory of app
|
934
942
|
#
|
935
943
|
# HIDDEN:
|
936
944
|
def live_run
|
@@ -947,9 +955,9 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
947
955
|
end
|
948
956
|
|
949
957
|
if(thread_id == "")
|
950
|
-
exec(command("--execute_live --name #{name.to_s}"))
|
958
|
+
exec(command("--execute_live --name #{name.to_s}", type, dir))
|
951
959
|
else
|
952
|
-
exec(command("--execute_live --name #{name.to_s} --pipe #{thread_id}"))
|
960
|
+
exec(command("--execute_live --name #{name.to_s} --pipe #{thread_id}", type, dir))
|
953
961
|
end
|
954
962
|
end
|
955
963
|
alias_command "live_run", "apps:live_run"
|
@@ -961,16 +969,18 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
961
969
|
#
|
962
970
|
# --pretty # Pretty prints the info output
|
963
971
|
# --type TYPE # specify an output type i.e. json
|
964
|
-
#
|
972
|
+
# --directory DIR # Directory of the app
|
973
|
+
#
|
965
974
|
def info
|
966
|
-
|
975
|
+
dir = options[:directory] || shift_argument || Dir.pwd
|
967
976
|
type = options[:type]
|
977
|
+
info_file = "#{dir}/#{SecureRandom.uuid}"
|
968
978
|
|
969
|
-
cmd = command("--info --file #{info_file}")
|
979
|
+
cmd = command("--info --file #{info_file}", type, dir)
|
970
980
|
app_info = Zillabyte::Command::Apps.get_info(cmd, info_file)
|
971
981
|
|
972
982
|
if type == "json"
|
973
|
-
puts
|
983
|
+
puts app_info
|
974
984
|
else
|
975
985
|
if options[:pretty]
|
976
986
|
puts JSON.pretty_generate(JSON.parse(app_info))
|
@@ -1029,10 +1039,8 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Base
|
|
1029
1039
|
#
|
1030
1040
|
# --type TYPE # specify an output type i.e. json
|
1031
1041
|
#
|
1032
|
-
def command(arg="--execute_live", ignore_stderr = false)
|
1042
|
+
def command(arg="--execute_live", type = nil, dir = Dir.pwd, ignore_stderr = false)
|
1033
1043
|
|
1034
|
-
dir = options[:directory] || shift_argument || Dir.pwd
|
1035
|
-
type = options[:type]
|
1036
1044
|
meta = Zillabyte::CLI::Config.get_config_info(dir, self, options)
|
1037
1045
|
#meta = Zillabyte::API::Functions.get_rich_meta_info_from_script(dir, self)
|
1038
1046
|
error("could not extract meta information. missing zillabyte.conf.yml?", type) if meta.nil?
|
data/lib/zillabyte/cli/config.rb
CHANGED
@@ -11,7 +11,7 @@ module Zillabyte
|
|
11
11
|
################################################################################
|
12
12
|
|
13
13
|
def self.get_config_info(dir, session = nil, options = {})
|
14
|
-
|
14
|
+
|
15
15
|
conf_file = nil
|
16
16
|
if options[:config_file] and File.exists?(options[:config_file])
|
17
17
|
conf_file = options[:config_file]
|
@@ -19,7 +19,7 @@ module Zillabyte
|
|
19
19
|
conf_file = File.join(dir, options[:config_file] || DEFAULT_CONFIG_FILE)
|
20
20
|
end
|
21
21
|
type = options[:type]
|
22
|
-
|
22
|
+
|
23
23
|
return nil unless File.exists?(conf_file)
|
24
24
|
hash = YAML.load_file(conf_file)
|
25
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zillabyte-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zillabyte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -315,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
315
|
version: '0'
|
316
316
|
requirements: []
|
317
317
|
rubyforge_project:
|
318
|
-
rubygems_version: 2.0.
|
318
|
+
rubygems_version: 2.0.6
|
319
319
|
signing_key:
|
320
320
|
specification_version: 4
|
321
321
|
summary: The Official Zillabyte CLI Gem
|