zillabyte-cli 0.1.3 → 0.1.4
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.
- checksums.yaml +8 -8
- data/bin/zb +18 -0
- data/lib/zillabyte-cli/version.rb +1 -1
- data/lib/zillabyte/api/queries.rb +1 -0
- data/lib/zillabyte/cli/base.rb +0 -2
- data/lib/zillabyte/cli/data.rb +42 -2
- data/lib/zillabyte/cli/flows.rb +4 -4
- data/lib/zillabyte/cli/query.rb +1 -1
- data/lib/zillabyte/runner/app_runner.rb +15 -5
- data/lib/zillabyte/runner/multilang_operation.rb +1 -1
- data/zillabyte-cli.gemspec +12 -1
- metadata +9 -17
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTIwZDM4NGVlY2I5YWQ0MjMzMGZmMDQwMjcxMDQ0YjAxMGQxOTY1Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjY4ZjE5Njk0ZmJiOGFkNDM3ODBiOTM5YTQ5OGUyNGQ2M2MxYTRhZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDljMmMxOWRkY2Q3MDk4N2YwYzc1YTRlYzViM2M4ZDgwYWMzMTdjZDgyNGRl
|
10
|
+
NzAxZDY5ZTRjYzRhNmIxODhlM2EwNDAyNTBjMDcxYWEwY2ZhMWZmZWExMzRk
|
11
|
+
NWFlN2E5MzI5OGQ0YjFkNWQ0NjRkMDg2ODE2ZjllN2M5Nzk1OGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzdhYjQ0M2NlZGNkYWEyY2RhNDVlNjU3MTFmYTEzODQyMTYyNjMyY2I2NGE0
|
14
|
+
ZTc3YWMwZjZiNzg5NjYwY2Y4ZjVmY2NmOGQzZjc1NzBlNGZlMTRhMjlhNmM3
|
15
|
+
MzY1N2E2MGZmMTJkMTlmOTAwZGQyZDVlYTZhMDk3ZjdkOWVmNDk=
|
data/bin/zb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'zillabyte' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
require_relative '../lib/zillabyte-cli'
|
17
|
+
Zillabyte::CLI.start(*ARGV)
|
18
|
+
|
@@ -69,6 +69,7 @@ class Zillabyte::API::Queries < Zillabyte::API::Base
|
|
69
69
|
res = {'status' => nil}
|
70
70
|
while(res['status'] != 'completed')
|
71
71
|
res = sql(expression, :get, options)
|
72
|
+
sleep(1) if res['status'] != 'completed'
|
72
73
|
end
|
73
74
|
res["return"]["column_aliases"] = col_aliases if col_aliases #send the column aliases back too
|
74
75
|
res["return"]
|
data/lib/zillabyte/cli/base.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
require "fileutils"
|
2
2
|
require "zillabyte/api"
|
3
3
|
require "zillabyte/command"
|
4
|
-
require "action_view"
|
5
4
|
|
6
5
|
class Zillabyte::Command::Base
|
7
6
|
include Zillabyte::Helpers
|
8
|
-
include ActionView::Helpers::DateHelper
|
9
7
|
|
10
8
|
META_COLUMNS = ["since", "confidence", "source"]
|
11
9
|
|
data/lib/zillabyte/cli/data.rb
CHANGED
@@ -24,6 +24,7 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
24
24
|
self.list
|
25
25
|
end
|
26
26
|
|
27
|
+
|
27
28
|
|
28
29
|
# data
|
29
30
|
#
|
@@ -54,7 +55,12 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
54
55
|
display "Total number of datasets: "+rows.length.to_s if type.nil?
|
55
56
|
|
56
57
|
end
|
57
|
-
|
58
|
+
alias_command "relations:list", "data:list"
|
59
|
+
alias_command "relations", "data:list"
|
60
|
+
alias_command "datasets:list", "data:list"
|
61
|
+
alias_command "datasets", "data:list"
|
62
|
+
alias_command "dataset:list", "data:list"
|
63
|
+
alias_command "dataset", "data:list"
|
58
64
|
|
59
65
|
# data:delete ID
|
60
66
|
#
|
@@ -97,6 +103,10 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
97
103
|
end
|
98
104
|
end
|
99
105
|
end
|
106
|
+
alias_command "relations:delete", "data:delete"
|
107
|
+
alias_command "relation:delete", "data:delete"
|
108
|
+
alias_command "datasets:delete", "data:delete"
|
109
|
+
alias_command "dataset:delete", "data:delete"
|
100
110
|
|
101
111
|
|
102
112
|
# data:create NAME
|
@@ -149,6 +159,11 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
149
159
|
end
|
150
160
|
|
151
161
|
end
|
162
|
+
alias_command "relations:create", "data:create"
|
163
|
+
alias_command "relation:create", "data:create"
|
164
|
+
alias_command "datasets:create", "data:create"
|
165
|
+
alias_command "dataset:create", "data:create"
|
166
|
+
|
152
167
|
|
153
168
|
|
154
169
|
# data:append ID FILE
|
@@ -194,6 +209,12 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
194
209
|
end
|
195
210
|
|
196
211
|
end
|
212
|
+
alias_command "relations:append", "data:append"
|
213
|
+
alias_command "relation:append", "data:append"
|
214
|
+
alias_command "datasets:append", "data:append"
|
215
|
+
alias_command "dataset:append", "data:append"
|
216
|
+
|
217
|
+
|
197
218
|
|
198
219
|
# data:pull ID OUTPUT
|
199
220
|
#
|
@@ -223,6 +244,17 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
223
244
|
end
|
224
245
|
|
225
246
|
end
|
247
|
+
alias_command "download", "data:pull"
|
248
|
+
alias_command "data:download", "data:pull"
|
249
|
+
alias_command "relations:pull", "data:pull"
|
250
|
+
alias_command "relation:pull", "data:pull"
|
251
|
+
alias_command "relations:download", "data:pull"
|
252
|
+
alias_command "relation:download", "data:pull"
|
253
|
+
alias_command "datasets:pull", "data:pull"
|
254
|
+
alias_command "dataset:pull", "data:pull"
|
255
|
+
alias_command "datasets:download", "data:pull"
|
256
|
+
alias_command "dataset:download", "data:pull"
|
257
|
+
|
226
258
|
|
227
259
|
# data:pull:s3 ID S3_KEY S3_SECRET S3_BUCKET s3_FILE_KEY
|
228
260
|
#
|
@@ -260,6 +292,10 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
260
292
|
end
|
261
293
|
end
|
262
294
|
alias_command "data:pull:s3", "data:pull_to_s3"
|
295
|
+
alias_command "relations:pull:s3", "data:pull_to_s3"
|
296
|
+
alias_command "relation:pull:s3", "data:pull_to_s3"
|
297
|
+
alias_command "datasets:pull:s3", "data:pull_to_s3"
|
298
|
+
alias_command "dataset:pull:s3", "data:pull_to_s3"
|
263
299
|
|
264
300
|
|
265
301
|
# data:show ID
|
@@ -364,7 +400,11 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
|
|
364
400
|
end
|
365
401
|
|
366
402
|
end
|
367
|
-
|
403
|
+
alias_command "relations:show", "data:show"
|
404
|
+
alias_command "relation:show", "data:show"
|
405
|
+
alias_command "datasets:show", "data:show"
|
406
|
+
alias_command "dataset:show", "data:show"
|
407
|
+
|
368
408
|
|
369
409
|
private
|
370
410
|
|
data/lib/zillabyte/cli/flows.rb
CHANGED
@@ -114,11 +114,11 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
|
|
114
114
|
# --mode MODE # Specify development or production mode for dependencies #HIDDEN
|
115
115
|
#
|
116
116
|
def prep()
|
117
|
-
mode,
|
117
|
+
mode, bundle_extra = case options[:mode]
|
118
118
|
when nil, "development"
|
119
119
|
[:development, ""]
|
120
120
|
when "production"
|
121
|
-
[:production, "--deployment"]
|
121
|
+
[:production, "; bundle install --deployment"]
|
122
122
|
else
|
123
123
|
error("Unsupported mode #{options[:mode].inspect()}. Zillabyte currently supports development and production.")
|
124
124
|
end
|
@@ -140,7 +140,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
|
|
140
140
|
when "ruby"
|
141
141
|
# Execute in the bundler context
|
142
142
|
full_script = File.join(dir, meta["script"])
|
143
|
-
cmd = "cd \"#{meta['home_dir']}\"; unset BUNDLE_GEMFILE; unset RUBYOPT; bundle install #{
|
143
|
+
cmd = "cd \"#{meta['home_dir']}\"; unset BUNDLE_GEMFILE; unset RUBYOPT; bundle install #{bundle_extra}"
|
144
144
|
exec(cmd)
|
145
145
|
when "python"
|
146
146
|
vDir = "#{meta['home_dir']}/vEnv"
|
@@ -248,7 +248,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
|
|
248
248
|
message = row[2].strip
|
249
249
|
color_map[name] ||= colors.shift
|
250
250
|
if time
|
251
|
-
display "#{"* #{name} - #{
|
251
|
+
display "#{"* #{name} - #{time}".colorize(color_map[name])}:" if type.nil?
|
252
252
|
else
|
253
253
|
display "#{"* #{name}".colorize(color_map[name])}:" if type.nil?
|
254
254
|
end
|
data/lib/zillabyte/cli/query.rb
CHANGED
@@ -175,13 +175,23 @@ class Zillabyte::Runner::AppRunner < Zillabyte::Command::Base
|
|
175
175
|
|
176
176
|
|
177
177
|
def cdisplay(name, message)
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
178
|
+
color = @colors[name] || :default
|
179
|
+
if message == ""
|
180
|
+
display ""
|
181
|
+
else
|
182
|
+
|
183
|
+
if message.is_a?(Array)
|
184
|
+
lines = message
|
182
185
|
else
|
183
|
-
|
186
|
+
lines = message.split("\n")
|
184
187
|
end
|
188
|
+
|
189
|
+
prefix = "#{name} - "
|
190
|
+
display "#{prefix}#{lines.first}".colorize(color)
|
191
|
+
lines[1..-1].each do |line|
|
192
|
+
display "#{' '*prefix.size}#{line}".colorize(color)
|
193
|
+
end
|
194
|
+
end
|
185
195
|
end
|
186
196
|
|
187
197
|
|
data/zillabyte-cli.gemspec
CHANGED
@@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency "excon", "~> 0.31"
|
30
30
|
spec.add_dependency "terminal-table", "~> 1.4"
|
31
31
|
spec.add_dependency "activesupport", "~> 3.2.11"
|
32
|
-
spec.add_dependency "actionpack", "~> 3.2.13"
|
33
32
|
spec.add_dependency "multi_json", "~> 1.0"
|
34
33
|
|
35
34
|
spec.add_dependency "bundler", "~> 1.3"
|
@@ -40,4 +39,16 @@ Gem::Specification.new do |spec|
|
|
40
39
|
spec.add_dependency "time_difference"
|
41
40
|
spec.add_dependency "mkfifo"
|
42
41
|
|
42
|
+
spec.post_install_message = """
|
43
|
+
Getting Started with Zillabyte
|
44
|
+
==============================
|
45
|
+
|
46
|
+
(1) Register for an auth token at http://zillabyte.com
|
47
|
+
(2) Log in by running 'zillabyte login' in the command line
|
48
|
+
(3) Build an empty app by running 'zillabyte app:init'
|
49
|
+
Or... check out our Quick Starts by visiting http://docs.zillabyte.com/
|
50
|
+
|
51
|
+
Questions, comments? Please visit us at http://docs.zillabyte.com
|
52
|
+
"""
|
53
|
+
|
43
54
|
end
|
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.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zillabyte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -94,20 +94,6 @@ 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
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: multi_json
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,10 +210,12 @@ description: The Official Zillabyte CLI Gem
|
|
224
210
|
email:
|
225
211
|
- gem@zillabyte.com
|
226
212
|
executables:
|
213
|
+
- zb
|
227
214
|
- zillabyte
|
228
215
|
extensions: []
|
229
216
|
extra_rdoc_files: []
|
230
217
|
files:
|
218
|
+
- bin/zb
|
231
219
|
- bin/zillabyte
|
232
220
|
- lib/zillabyte/api/apps.rb
|
233
221
|
- lib/zillabyte/api/base.rb
|
@@ -309,7 +297,11 @@ homepage: http://www.zillabyte.com
|
|
309
297
|
licenses:
|
310
298
|
- MIT
|
311
299
|
metadata: {}
|
312
|
-
post_install_message:
|
300
|
+
post_install_message: ! "\nGetting Started with Zillabyte\n==============================\n\n(1)
|
301
|
+
Register for an auth token at http://zillabyte.com\n(2) Log in by running 'zillabyte
|
302
|
+
login' in the command line\n(3) Build an empty app by running 'zillabyte app:init'\n
|
303
|
+
\ Or... check out our Quick Starts by visiting http://docs.zillabyte.com/\n\nQuestions,
|
304
|
+
comments? Please visit us at http://docs.zillabyte.com\n"
|
313
305
|
rdoc_options: []
|
314
306
|
require_paths:
|
315
307
|
- lib
|