zillabyte-cli 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +9 -9
  2. data/lib/#zillabyte-cli.rb# +5 -0
  3. data/lib/zillabyte/api/{flows.rb → apps.rb} +35 -23
  4. data/lib/zillabyte/api/data.rb +12 -1
  5. data/lib/zillabyte/api/logs.rb +4 -4
  6. data/lib/zillabyte/api/queries.rb +15 -6
  7. data/lib/zillabyte/api/zillalogs.rb +1 -1
  8. data/lib/zillabyte/api.rb +40 -38
  9. data/lib/zillabyte/auth.rb +19 -11
  10. data/lib/zillabyte/cli/#logs.rb# +12 -0
  11. data/lib/zillabyte/cli/{flows.rb → apps.rb} +407 -177
  12. data/lib/zillabyte/cli/auth.rb +1 -1
  13. data/lib/zillabyte/cli/base.rb +5 -4
  14. data/lib/zillabyte/cli/config.rb +3 -2
  15. data/lib/zillabyte/cli/counters.rb +1 -1
  16. data/lib/zillabyte/cli/help.rb +1 -1
  17. data/lib/zillabyte/cli/helpers/data_schema_builder.rb +1 -1
  18. data/lib/zillabyte/cli/helpers/table_output_builder.rb +25 -0
  19. data/lib/zillabyte/cli/log_formatter.rb +4 -3
  20. data/lib/zillabyte/cli/query.rb +107 -26
  21. data/lib/zillabyte/cli/relations.rb +226 -78
  22. data/lib/zillabyte/cli/sources.rb +1 -1
  23. data/lib/zillabyte/cli/templates/js/simple_function.js +5 -0
  24. data/lib/zillabyte/cli/templates/python/#simple_function.py# +27 -0
  25. data/lib/zillabyte/cli/templates/python/simple_function.py +3 -0
  26. data/lib/zillabyte/cli/templates/ruby/{simple_function.rb → simple_app.rb} +6 -6
  27. data/lib/zillabyte/cli/templates/ruby/zillabyte.conf.yaml +1 -1
  28. data/lib/zillabyte/cli/version.rb +1 -1
  29. data/lib/zillabyte/cli/zillalogs.rb +1 -1
  30. data/lib/zillabyte/command.rb +10 -2
  31. data/lib/zillabyte/common/{progress.rb → session.rb} +1 -1
  32. data/lib/zillabyte/helpers.rb +9 -4
  33. data/lib/zillabyte-cli/version.rb +1 -1
  34. data/zillabyte-cli.gemspec +2 -0
  35. metadata +25 -7
@@ -1,4 +1,5 @@
1
1
  # require "vendor/zillabyte/okjson"
2
+ require "json"
2
3
 
3
4
  module Zillabyte
4
5
  module Helpers
@@ -14,11 +15,15 @@ module Zillabyte
14
15
  end
15
16
 
16
17
 
17
- def error(message)
18
- $stderr.puts(format_with_bang(message))
18
+ def error(message, format=nil)
19
+ if format == "json"
20
+ $stderr.puts(({"error"=>message}).to_json)
21
+ else
22
+ $stderr.puts(format_with_bang(message))
23
+ end
19
24
  exit(1)
20
25
  end
21
-
26
+
22
27
  def format_with_bang(message)
23
28
  return '' if message.to_s.strip == ""
24
29
  " ! " + message.split("\n").join("\n ! ")
@@ -46,4 +51,4 @@ module Zillabyte
46
51
  end
47
52
 
48
53
  end
49
- end
54
+ end
@@ -1,5 +1,5 @@
1
1
  module Zillabyte
2
2
  module CLI
3
- VERSION = "0.0.16"
3
+ VERSION = "0.0.17"
4
4
  end
5
5
  end
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_development_dependency "rake"
24
+ #spec.add_development_dependency "pry"
24
25
 
25
26
  spec.add_dependency "netrc", "~> 0.7.7"
26
27
  spec.add_dependency "rest-client", "~> 1.6.1"
@@ -28,6 +29,7 @@ Gem::Specification.new do |spec|
28
29
  spec.add_dependency "excon", "~> 0.31"
29
30
  spec.add_dependency "terminal-table", "~> 1.4"
30
31
  spec.add_dependency "activesupport", "~> 3.2.11"
32
+ spec.add_dependency "actionpack", "~> 3.2.13"
31
33
  spec.add_dependency "multi_json", "~> 1.0"
32
34
  spec.add_dependency "mini_portile", "~> 0.5.0"
33
35
 
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.16
4
+ version: 0.0.17
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-01 00:00:00.000000000 Z
11
+ date: 2014-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.2.11
97
+ - !ruby/object:Gem::Dependency
98
+ name: actionpack
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 3.2.13
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 3.2.13
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: multi_json
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -229,9 +243,10 @@ extensions: []
229
243
  extra_rdoc_files: []
230
244
  files:
231
245
  - bin/zillabyte
246
+ - lib/#zillabyte-cli.rb#
247
+ - lib/zillabyte/api/apps.rb
232
248
  - lib/zillabyte/api/base.rb
233
249
  - lib/zillabyte/api/data.rb
234
- - lib/zillabyte/api/flows.rb
235
250
  - lib/zillabyte/api/locks.rb
236
251
  - lib/zillabyte/api/logs.rb
237
252
  - lib/zillabyte/api/metrics.rb
@@ -242,13 +257,15 @@ files:
242
257
  - lib/zillabyte/api/zillalogs.rb
243
258
  - lib/zillabyte/api.rb
244
259
  - lib/zillabyte/auth.rb
260
+ - lib/zillabyte/cli/#logs.rb#
261
+ - lib/zillabyte/cli/apps.rb
245
262
  - lib/zillabyte/cli/auth.rb
246
263
  - lib/zillabyte/cli/base.rb
247
264
  - lib/zillabyte/cli/config.rb
248
265
  - lib/zillabyte/cli/counters.rb
249
- - lib/zillabyte/cli/flows.rb
250
266
  - lib/zillabyte/cli/help.rb
251
267
  - lib/zillabyte/cli/helpers/data_schema_builder.rb
268
+ - lib/zillabyte/cli/helpers/table_output_builder.rb
252
269
  - lib/zillabyte/cli/host.rb
253
270
  - lib/zillabyte/cli/log_formatter.rb
254
271
  - lib/zillabyte/cli/query.rb
@@ -256,17 +273,18 @@ files:
256
273
  - lib/zillabyte/cli/sources.rb
257
274
  - lib/zillabyte/cli/templates/js/simple_function.js
258
275
  - lib/zillabyte/cli/templates/js/zillabyte.conf.yaml
276
+ - lib/zillabyte/cli/templates/python/#simple_function.py#
259
277
  - lib/zillabyte/cli/templates/python/requirements.txt
260
278
  - lib/zillabyte/cli/templates/python/simple_function.py
261
279
  - lib/zillabyte/cli/templates/python/zillabyte.conf.yaml
262
280
  - lib/zillabyte/cli/templates/ruby/Gemfile
263
- - lib/zillabyte/cli/templates/ruby/simple_function.rb
281
+ - lib/zillabyte/cli/templates/ruby/simple_app.rb
264
282
  - lib/zillabyte/cli/templates/ruby/zillabyte.conf.yaml
265
283
  - lib/zillabyte/cli/version.rb
266
284
  - lib/zillabyte/cli/zillalogs.rb
267
285
  - lib/zillabyte/cli.rb
268
286
  - lib/zillabyte/command.rb
269
- - lib/zillabyte/common/progress.rb
287
+ - lib/zillabyte/common/session.rb
270
288
  - lib/zillabyte/common/tar.rb
271
289
  - lib/zillabyte/common.rb
272
290
  - lib/zillabyte/helpers.rb
@@ -299,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
317
  version: '0'
300
318
  requirements: []
301
319
  rubyforge_project:
302
- rubygems_version: 2.0.7
320
+ rubygems_version: 2.1.10
303
321
  signing_key:
304
322
  specification_version: 4
305
323
  summary: The Official Zillabyte CLI Gem