zillabyte-cli 0.9.46 → 0.9.47

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
- NzcxYzBiOTMxYTBjOThhOTliNzFhNzFlMGMwZDM1YjY1ZWIzMDk4Nw==
5
- data.tar.gz: !binary |-
6
- YjAwODliYjIzNTAxODE4N2IwNGIzNjcwYjFhOWY5NTMwYTBjZGU3OA==
2
+ SHA1:
3
+ metadata.gz: f3e5ed5b7dfcfaf6082d0ba5f83c36b460f0e23c
4
+ data.tar.gz: faed3eb7b7658308b1e0d62ac857f92a53b554ec
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YTU4OTg0Yjc1MGE1NWZlZTI5YTg2OTA3Y2E3OGEzZjdkZWM1ODIyODkwMGFl
10
- ZjY1NjEwZjBkZWM1MzFlZmMxNjVmYzcxNGYyMjlhNTdkYzIwZjk1NjM2MWUz
11
- MjE4MjE2ZDRhMTcwMzg0Nzk1OTdmMTk0NjBjNDJjNzY1OTI4YzE=
12
- data.tar.gz: !binary |-
13
- YWE2OGFjYmM3YWYxNGE4MWU3NjY3MzUyYWU4MmY2ZmRhYzViMzVmMjI0ZDg0
14
- ZmM1ODA1ZjE4YzM0NGJkOGMxMjg2NGFiOGMwZjcwYTc4MTU4ZjE4ZWM0YTRk
15
- YzBkNmMzZDBiMmQ2MzU5MDM4YzUxNDhhZjg0MTNjYzEwYjFiZTg=
6
+ metadata.gz: 56b105ec6a95a1c32a40c8b9f83bc0d60ca87c97e159ba54bf1557e6049b53c17de81ee714963185adf6636163478b6284a341f9a0925c24f7df940229bece33
7
+ data.tar.gz: e18a998b677fd9c834370c11bdceed4bef0dd161db526a4b5921d5f83a7d980b615c7e77dc48786bfaeb3d02d0a564c093398199bff834016b4a3e16baf50ef8
@@ -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"
@@ -1,5 +1,5 @@
1
1
  module Zillabyte
2
2
  module CLI
3
- VERSION = "0.9.46"
3
+ VERSION = "0.9.47"
4
4
  end
5
5
  end
@@ -40,6 +40,15 @@ class Zillabyte::Auth
40
40
  # get_credentials[1]
41
41
  # end
42
42
 
43
+ def api_key_or_nil
44
+ credentials = read_credentials
45
+ if credentials.nil?
46
+ return nil
47
+ else
48
+ return credentials[1]
49
+ end
50
+ end
51
+
43
52
  def api_key
44
53
  get_credentials[1]
45
54
  end
@@ -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
@@ -5,7 +5,7 @@ require("zillabyte/cli/base")
5
5
  class Zillabyte::Command::Download < Zillabyte::Command::Base
6
6
 
7
7
  MIN_LOCAL_JAR_VERSION = "0.0.3"
8
- LATEST_JAR_VERSION = "0.9.46"
8
+ LATEST_JAR_VERSION = "0.9.47"
9
9
  MIN_JAVA_VERSION = "1.7.0"
10
10
 
11
11
  # --local # HIDDEN
@@ -775,6 +775,8 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
775
775
  # Check that multilang version is atleast 0.1.0
776
776
  version = meta["multilang_version"] || "0.0.0"
777
777
  language = meta["language"]
778
+ require('zillabyte/auth')
779
+ auth_token = Zillabyte::Auth.api_key_or_nil
778
780
  if !version_okay?(version, Zillabyte::CLI::VERSION)
779
781
  display "The version of zillabyte used in your flow is outdated."
780
782
  display "Please upgrade your zillabyte CLI using 'bundle update zillabyte; gem cleanup zillabyte'."
@@ -803,6 +805,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
803
805
  end
804
806
  cmd += " --rpc.args #{Shellwords.escape(component_args.to_json)}" if component_args
805
807
  cmd += " --output.prefix #{output_prefix}" if output_prefix
808
+ cmd += " --auth.token #{auth_token}" if auth_token
806
809
 
807
810
  match_str = "[f#{meta["name"]}]"
808
811
  display "Begin local execution..."
@@ -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
+ )
@@ -239,9 +239,10 @@ module Zillabyte
239
239
  default_path = encrypted
240
240
  end
241
241
 
242
- if Netrc.read(Netrc.default_path)["api.zillabyte.com"]
243
- options[:user_id] = Netrc.read(Netrc.default_path)["api.zillabyte.com"][1]
244
- options[:email] = Netrc.read(Netrc.default_path)["api.zillabyte.com"][0]
242
+ nrc = Netrc.read(Netrc.default_path)
243
+ if nrc["api.zillabyte.com"]
244
+ options[:user_id] = nrc["api.zillabyte.com"][1]
245
+ options[:email] = nrc["api.zillabyte.com"][0]
245
246
  end
246
247
  end
247
248
 
metadata CHANGED
@@ -1,139 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zillabyte-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.46
4
+ version: 0.9.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - zillabyte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2014-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
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
@@ -151,6 +151,7 @@ files:
151
151
  - bin/zb
152
152
  - bin/zbd
153
153
  - bin/zillabyte
154
+ - lib/#zillabyte-cli.rb#
154
155
  - lib/zillabyte-cli.rb
155
156
  - lib/zillabyte-cli/version.rb
156
157
  - lib/zillabyte/api.rb
@@ -168,6 +169,8 @@ files:
168
169
  - lib/zillabyte/api/zillalogs.rb
169
170
  - lib/zillabyte/auth.rb
170
171
  - lib/zillabyte/cli.rb
172
+ - lib/zillabyte/cli/#logs.rb#
173
+ - lib/zillabyte/cli/#repl.rb#
171
174
  - lib/zillabyte/cli/apps.rb
172
175
  - lib/zillabyte/cli/auth.rb
173
176
  - lib/zillabyte/cli/base.rb
@@ -205,6 +208,7 @@ files:
205
208
  - lib/zillabyte/cli/templates/components/ruby/Gemfile
206
209
  - lib/zillabyte/cli/templates/components/ruby/component.rb.erb
207
210
  - lib/zillabyte/cli/templates/components/ruby/zillabyte.conf.yaml
211
+ - lib/zillabyte/cli/templates/python/#simple_function.py#
208
212
  - lib/zillabyte/cli/untitled.md
209
213
  - lib/zillabyte/cli/version.rb
210
214
  - lib/zillabyte/cli/zillalogs.rb
@@ -221,27 +225,33 @@ homepage: http://www.zillabyte.com
221
225
  licenses:
222
226
  - MIT
223
227
  metadata: {}
224
- post_install_message: ! "\nGetting Started with Zillabyte\n==============================\n\n(1)
225
- Register for an auth token at http://zillabyte.com\n(2) Log in by running 'zillabyte
226
- login' in the command line\n(3) Build an empty app by running 'zillabyte apps:init'\n
227
- \ Or... check out our Quick Starts by visiting http://docs.zillabyte.com/\n\nQuestions,
228
- comments? Please visit us at http://docs.zillabyte.com\n"
228
+ post_install_message: |2
229
+
230
+ Getting Started with Zillabyte
231
+ ==============================
232
+
233
+ (1) Register for an auth token at http://zillabyte.com
234
+ (2) Log in by running 'zillabyte login' in the command line
235
+ (3) Build an empty app by running 'zillabyte apps:init'
236
+ Or... check out our Quick Starts by visiting http://docs.zillabyte.com/
237
+
238
+ Questions, comments? Please visit us at http://docs.zillabyte.com
229
239
  rdoc_options: []
230
240
  require_paths:
231
241
  - lib
232
242
  required_ruby_version: !ruby/object:Gem::Requirement
233
243
  requirements:
234
- - - ! '>='
244
+ - - ">="
235
245
  - !ruby/object:Gem::Version
236
246
  version: '0'
237
247
  required_rubygems_version: !ruby/object:Gem::Requirement
238
248
  requirements:
239
- - - ! '>='
249
+ - - ">="
240
250
  - !ruby/object:Gem::Version
241
251
  version: '0'
242
252
  requirements: []
243
253
  rubyforge_project:
244
- rubygems_version: 2.4.2
254
+ rubygems_version: 2.2.2
245
255
  signing_key:
246
256
  specification_version: 4
247
257
  summary: The Official Zillabyte CLI Gem