zillabyte-cli 0.9.6 → 0.9.7

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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTk1OGRiMDFjYmZkNTBiNTE0YjI5MGVmZjEzZTQ0MzVlNjMzMGM4Mw==
5
- data.tar.gz: !binary |-
6
- ZWJmODIwODA3MzAwNWJiN2JkY2U0ODAyMDI5OTI5ZjU4ZGI4MmZkMA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MzE4ZjNhMmU0YjVjM2EyNWE5ZWM4ODJmY2I4ZDA1YWQ1Zjk5OTY3NTkzNmMw
10
- NDk0NjI1MmIxYjg4YjhiY2M1ZWYwNjcxNDU5ZTExMmJlMTk5MDRhNGQwMmVi
11
- YTdmNDdhYjRiZmE2ZTI0ZDEzMDBiMzJlMTI4MDg4NTJjMGVhYjU=
12
- data.tar.gz: !binary |-
13
- YTQ0MDdmYTAyOTYwZmJjM2E5ZDFjYzc3OGI1MzNkNDMzMDkyZTlmM2EzMjMx
14
- NmQ2NzNjNmQ5NWU1YzJkZmViYTkyZjU1MTcyMTZmYzlhMmNlZDM5MTU1MTA2
15
- YjU0ZjVmZDA3NTNiMzY3NjAzZTI5YTg0NzdjMWQ1YTM2ZTU3NmY=
2
+ SHA1:
3
+ metadata.gz: ecc6f0386c996c8abb9e98134eb079ecaab042f3
4
+ data.tar.gz: 396dca4273f2e3497a6e3ed33392e5e89569dffc
5
+ SHA512:
6
+ metadata.gz: 6aaeb947d5589b824cf6b62fd8816fcf11e765f9fc7867a823d1189884ac2d4365aa0004f75fd799a03a88abe346ca2cf4a854104dab5858a2b132e278857b42
7
+ data.tar.gz: 15bddb92cbcb9ffc5457e0ff4ce6e2a2f7bec77f5c3f3b45d74b08bac81127d8166b8b89b2f83e33fd37c3ff851bb31d00ae14f7977b9796d13c926c85024d54
@@ -0,0 +1,5 @@
1
+ require "zillabyte-cli/version"
2
+ require "zillabyte/api"
3
+ require "zillabyte/cli"
4
+ require "zillabyte/common"
5
+ require "zillabyte/queries"
@@ -0,0 +1,12 @@
1
+ require "zillabyte/cli/base"
2
+
3
+ # manage custom logs
4
+ #
5
+ class Zillabyte::Command::Logs < Zillabyte::Command::Base
6
+
7
+
8
+
9
+
10
+
11
+
12
+ end
@@ -0,0 +1,43 @@
1
+ require "zillabyte/cli/base"
2
+ require 'readline'
3
+ # REPL console for zillabyte commands
4
+ #
5
+ class Zillabyte::Command::Repl < Zillabyte::Command::Base
6
+
7
+ # repl
8
+ #
9
+ # start a console session for zillabyte
10
+ # --quiet # HIDDEN
11
+ # --history HISTORY# HIDDEN hack to allow history for readline
12
+ def index
13
+ if !options[:quiet]
14
+ v = `zillabyte version`
15
+ display "\n#{v}Type q,exit or Ctrl+D to quit\n\n"
16
+ end
17
+ server = `echo $ZILLABYTE_API_HOST` || ""
18
+ prompt = ""
19
+ if server && server.chomp.length > 0
20
+ prompt = "#{server.chomp} "
21
+ end
22
+ prompt += "zillabyte $ "
23
+ if options[:history]
24
+ #p options[:history]
25
+ history = JSON.parse(options[:history])
26
+ history.last(50).each do |his|
27
+ # TODO: Handle single quotes ??
28
+ Readline::HISTORY << his
29
+ end
30
+ end
31
+ # TODO: Add tab completion for basic commands, app/relation names etc.
32
+ while cmd = Readline.readline(prompt, true)
33
+ if cmd && cmd.length > 0
34
+ if cmd.downcase == "exit" || cmd.downcase == "q"
35
+ display "" # TODO Make Ctrl+D print a newline too
36
+ return
37
+ else
38
+ exec "zillabyte #{cmd}; zillabyte repl --quiet --history '#{Readline::HISTORY.to_a.to_json}'"
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -151,6 +151,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
151
151
  #
152
152
  def prep()
153
153
  require("zillabyte/cli/config")
154
+ require("shellwords")
154
155
 
155
156
  type = options[:output_type]
156
157
  dir = options[:dir] || shift_argument
@@ -184,10 +185,11 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
184
185
  sleep(1) while File.exists?(lock_file)
185
186
  else
186
187
  begin
187
- cmd = "touch #{lock_file}; virtualenv --clear --system-site-packages #{vDir}; PYTHONPATH=~/zb1/multilang/python/Zillabyte #{vDir}/bin/pip install -r #{meta['home_dir']}/requirements.txt"
188
+ # TODO: won't the ~/zb1/ break in LXC and users' machines?
189
+ cmd = "touch #{Shellwords.escape(lock_file)}; virtualenv --clear --system-site-packages #{Shellwords.escape(vDir)}; PYTHONPATH=$PYTHONPATH:~/zb1/multilang/python/Zillabyte #{Shellwords.escape(vDir)}/bin/pip install -r #{Shellwords.escape(File.join(meta['home_dir'], "requirements.txt"))}"
188
190
  system cmd, :out => :out
189
191
  ensure
190
- File.delete(lock_file)
192
+ File.delete(lock_file) if File.exists?(lock_file)
191
193
  end
192
194
  end
193
195
 
@@ -0,0 +1,27 @@
1
+ import zillabyte
2
+
3
+ def prep(controller):
4
+ return
5
+
6
+ # This is the heart of your algorithm. It's processed on every
7
+ # web page. This algorithm is run in parallel on possibly hundreds
8
+ # of machines.
9
+ def execute(controller, tup):
10
+ if("hello world" in tup.values["html"]):
11
+ controller.emit("has_hello_world",{"url":tup.values["url"]})
12
+ return
13
+
14
+ zillabyte.simple_function(\
15
+ # This directive instructs zillabyte to give your function every
16
+ # web page in our known universe. Your function will have access
17
+ # to two fields: URL and HTML
18
+ matches = "select * from web_pa", \
19
+
20
+ # This directive tells Zillabyte what kind of data your function
21
+ # produces. In this case, we're saying we will emit a tuple that
22
+ # is one-column wide and contains the field 'URL'
23
+ emits = [["has_hello_world", [{"url":"string"}]]], \
24
+
25
+ prepare = prep, \
26
+ execute = execute\
27
+ )
@@ -1,5 +1,5 @@
1
1
  module Zillabyte
2
2
  module CLI
3
- VERSION = "0.9.6"
3
+ VERSION = "0.9.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zillabyte-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - zillabyte
@@ -14,126 +14,126 @@ dependencies:
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: netrc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.7.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.7.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rest-client
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.6.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.6.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: excon
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.31'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.31'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: terminal-table
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.4'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: activesupport
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 3.2.11
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.2.11
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: multi_json
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: colorize
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0.6'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0.6'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: indentation
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0.1'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.1'
139
139
  description: The Official Zillabyte CLI Gem
@@ -145,9 +145,16 @@ executables:
145
145
  extensions: []
146
146
  extra_rdoc_files: []
147
147
  files:
148
+ - Gemfile
149
+ - LICENSE
150
+ - README.md
148
151
  - bin/zb
149
152
  - bin/zbd
150
153
  - bin/zillabyte
154
+ - lib/#zillabyte-cli.rb#
155
+ - lib/zillabyte-cli.rb
156
+ - lib/zillabyte-cli/version.rb
157
+ - lib/zillabyte/api.rb
151
158
  - lib/zillabyte/api/apps.rb
152
159
  - lib/zillabyte/api/base.rb
153
160
  - lib/zillabyte/api/components.rb
@@ -160,8 +167,10 @@ files:
160
167
  - lib/zillabyte/api/settings.rb
161
168
  - lib/zillabyte/api/sources.rb
162
169
  - lib/zillabyte/api/zillalogs.rb
163
- - lib/zillabyte/api.rb
164
170
  - lib/zillabyte/auth.rb
171
+ - lib/zillabyte/cli.rb
172
+ - lib/zillabyte/cli/#logs.rb#
173
+ - lib/zillabyte/cli/#repl.rb#
165
174
  - lib/zillabyte/cli/apps.rb
166
175
  - lib/zillabyte/cli/auth.rb
167
176
  - lib/zillabyte/cli/base.rb
@@ -185,67 +194,68 @@ files:
185
194
  - lib/zillabyte/cli/templates/apps/python/app.py
186
195
  - lib/zillabyte/cli/templates/apps/python/requirements.txt
187
196
  - lib/zillabyte/cli/templates/apps/python/zillabyte.conf.yaml
188
- - lib/zillabyte/cli/templates/apps/ruby/app.rb.erb
189
197
  - lib/zillabyte/cli/templates/apps/ruby/Gemfile
190
198
  - lib/zillabyte/cli/templates/apps/ruby/README.md
199
+ - lib/zillabyte/cli/templates/apps/ruby/app.rb.erb
191
200
  - lib/zillabyte/cli/templates/apps/ruby/zillabyte.conf.yaml
192
201
  - lib/zillabyte/cli/templates/components/js/simple_function.js
193
202
  - lib/zillabyte/cli/templates/components/js/zillabyte.conf.yaml
194
203
  - lib/zillabyte/cli/templates/components/python/component.py
195
204
  - lib/zillabyte/cli/templates/components/python/requirements.txt
196
205
  - lib/zillabyte/cli/templates/components/python/zillabyte.conf.yaml
197
- - lib/zillabyte/cli/templates/components/ruby/component.rb.erb
198
206
  - lib/zillabyte/cli/templates/components/ruby/Gemfile
207
+ - lib/zillabyte/cli/templates/components/ruby/component.rb.erb
199
208
  - lib/zillabyte/cli/templates/components/ruby/zillabyte.conf.yaml
209
+ - lib/zillabyte/cli/templates/python/#simple_function.py#
200
210
  - lib/zillabyte/cli/untitled.md
201
211
  - lib/zillabyte/cli/version.rb
202
212
  - lib/zillabyte/cli/zillalogs.rb
203
- - lib/zillabyte/cli.rb
204
213
  - lib/zillabyte/command.rb
214
+ - lib/zillabyte/common.rb
205
215
  - lib/zillabyte/common/log_fetcher.rb
206
216
  - lib/zillabyte/common/session.rb
207
217
  - lib/zillabyte/common/tar.rb
208
- - lib/zillabyte/common.rb
209
218
  - lib/zillabyte/helpers.rb
219
+ - lib/zillabyte/runner.rb
210
220
  - lib/zillabyte/runner/app_runner.rb
211
221
  - lib/zillabyte/runner/component_operation.rb
212
222
  - lib/zillabyte/runner/component_runner.rb
213
223
  - lib/zillabyte/runner/multilang_operation.rb
214
224
  - lib/zillabyte/runner/operation.rb
215
- - lib/zillabyte/runner.rb
216
- - lib/zillabyte-cli/version.rb
217
- - lib/zillabyte-cli.rb
218
- - LICENSE
219
- - README.md
225
+ - zillabyte-cli.gemspec
220
226
  - zillabyte_emails.csv
221
227
  - zillaconf.json
222
- - Gemfile
223
- - zillabyte-cli.gemspec
224
228
  homepage: http://www.zillabyte.com
225
229
  licenses:
226
230
  - MIT
227
231
  metadata: {}
228
- post_install_message: ! "\nGetting Started with Zillabyte\n==============================\n\n(1)
229
- Register for an auth token at http://zillabyte.com\n(2) Log in by running 'zillabyte
230
- login' in the command line\n(3) Build an empty app by running 'zillabyte apps:init'\n
231
- \ Or... check out our Quick Starts by visiting http://docs.zillabyte.com/\n\nQuestions,
232
- comments? Please visit us at http://docs.zillabyte.com\n"
232
+ post_install_message: |2
233
+
234
+ Getting Started with Zillabyte
235
+ ==============================
236
+
237
+ (1) Register for an auth token at http://zillabyte.com
238
+ (2) Log in by running 'zillabyte login' in the command line
239
+ (3) Build an empty app by running 'zillabyte apps:init'
240
+ Or... check out our Quick Starts by visiting http://docs.zillabyte.com/
241
+
242
+ Questions, comments? Please visit us at http://docs.zillabyte.com
233
243
  rdoc_options: []
234
244
  require_paths:
235
245
  - lib
236
246
  required_ruby_version: !ruby/object:Gem::Requirement
237
247
  requirements:
238
- - - ! '>='
248
+ - - ">="
239
249
  - !ruby/object:Gem::Version
240
250
  version: '0'
241
251
  required_rubygems_version: !ruby/object:Gem::Requirement
242
252
  requirements:
243
- - - ! '>='
253
+ - - ">="
244
254
  - !ruby/object:Gem::Version
245
255
  version: '0'
246
256
  requirements: []
247
257
  rubyforge_project:
248
- rubygems_version: 2.0.7
258
+ rubygems_version: 2.2.2
249
259
  signing_key:
250
260
  specification_version: 4
251
261
  summary: The Official Zillabyte CLI Gem