ugc 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -13
- data/README.md +9 -1
- data/bin/ugc +11 -19
- data/lib/ugc/application.rb +18 -0
- data/lib/ugc/commands/get.rb +11 -31
- data/lib/ugc/commands/logout.rb +11 -0
- data/lib/ugc/commands/post.rb +1 -1
- data/lib/ugc/commands/put.rb +1 -1
- data/lib/ugc/settings.rb +5 -1
- data/lib/ugc/version.rb +1 -1
- data/ugc.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9a75ddbf60a89991dce453c03827a89cc8c916d
|
4
|
+
data.tar.gz: 37a1d8f2d3d85b3adf06137d8e9de2b560f91b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b352d3105048c654a02254b1e4d2ebfc50efba79622e5d5851856f5a0fb382015b175d768625f4d7724bfc89729c3521c66c1533b49722b972b7053b3dbce742
|
7
|
+
data.tar.gz: f8c377a1ccfa73459a9b3c7a1e24f9b463e32a1f15e8754cbc3b1baaee07d7264dde727ee6a8d2a67d49a80751a354e350a9ab823b55c2494d88e18edad82fa0
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ugc (0.9.
|
4
|
+
ugc (0.9.8)
|
5
5
|
command_line_reporter
|
6
|
-
gli
|
6
|
+
gli (>= 2.6)
|
7
7
|
highline
|
8
8
|
usergrid_iron (>= 0.9.1)
|
9
9
|
|
@@ -20,28 +20,30 @@ GEM
|
|
20
20
|
colored (1.2)
|
21
21
|
command_line_reporter (3.2.1)
|
22
22
|
colored (>= 1.2)
|
23
|
-
cucumber (1.3.
|
23
|
+
cucumber (1.3.8)
|
24
24
|
builder (>= 2.1.2)
|
25
25
|
diff-lcs (>= 1.1.3)
|
26
|
-
gherkin (~> 2.12.
|
27
|
-
multi_json (
|
26
|
+
gherkin (~> 2.12.1)
|
27
|
+
multi_json (>= 1.7.5, < 2.0)
|
28
|
+
multi_test (>= 0.0.2)
|
28
29
|
diff-lcs (1.2.4)
|
29
|
-
ffi (1.
|
30
|
-
gherkin (2.12.
|
30
|
+
ffi (1.9.0)
|
31
|
+
gherkin (2.12.1)
|
31
32
|
multi_json (~> 1.3)
|
32
|
-
gli (2.
|
33
|
+
gli (2.8.0)
|
33
34
|
highline (1.6.19)
|
34
35
|
json (1.8.0)
|
35
|
-
mime-types (1.
|
36
|
-
multi_json (1.
|
37
|
-
|
36
|
+
mime-types (1.25)
|
37
|
+
multi_json (1.8.0)
|
38
|
+
multi_test (0.0.2)
|
39
|
+
rake (10.1.0)
|
38
40
|
rdoc (4.0.1)
|
39
41
|
json (~> 1.4)
|
40
42
|
rest-client (1.6.7)
|
41
43
|
mime-types (>= 1.16)
|
42
|
-
rspec-expectations (2.
|
44
|
+
rspec-expectations (2.14.3)
|
43
45
|
diff-lcs (>= 1.1.3, < 2.0)
|
44
|
-
usergrid_iron (0.9.
|
46
|
+
usergrid_iron (0.9.2)
|
45
47
|
multi_json
|
46
48
|
rest-client
|
47
49
|
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@ ugc enables convenient terminal access to Apigee's App Services (aka Usergrid).
|
|
21
21
|
|
22
22
|
$ gem install ugc
|
23
23
|
|
24
|
-
Note: Requires Ruby 1.9.3+ or Ruby 2.0
|
24
|
+
Note: Requires Ruby 1.9.3+ or Ruby 2.0+. If you have issues, check your version:
|
25
25
|
|
26
26
|
$ ruby -v
|
27
27
|
|
@@ -178,6 +178,14 @@ If you specify column names in your query, you will be unable to reference the r
|
|
178
178
|
|
179
179
|
## Release notes
|
180
180
|
|
181
|
+
### 0.9.8
|
182
|
+
* New features
|
183
|
+
1. logout (remove access_token)
|
184
|
+
2. no longer force log in - as it's not always necessary
|
185
|
+
3. get (ls) command now defaults to list collections when no arguments
|
186
|
+
* Bug fixes
|
187
|
+
1. updated to work with latest gli (> 2.6)
|
188
|
+
|
181
189
|
### 0.9.7
|
182
190
|
* Bug Fixes
|
183
191
|
1. allow headers to vary during paging
|
data/bin/ugc
CHANGED
@@ -34,8 +34,6 @@ flag [:s,:settings]
|
|
34
34
|
commands_from '../lib/ugc/helpers'
|
35
35
|
commands_from '../lib/ugc/commands'
|
36
36
|
|
37
|
-
pre_login = [:info, :target, :profile]
|
38
|
-
|
39
37
|
pre do |global_options,command,options,args|
|
40
38
|
if global_options[:verbose]
|
41
39
|
RestClient.log=Logger.new(STDOUT)
|
@@ -44,24 +42,15 @@ pre do |global_options,command,options,args|
|
|
44
42
|
end
|
45
43
|
|
46
44
|
$settings = Ugc::Settings.new global_options
|
47
|
-
if
|
48
|
-
|
49
|
-
elsif command.name == :login
|
45
|
+
if not $settings.configured?
|
46
|
+
raise "not configured"
|
47
|
+
elsif command.name == :login
|
50
48
|
true
|
51
49
|
else
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
true
|
57
|
-
else
|
58
|
-
if $settings.configured?
|
59
|
-
puts "not logged in"
|
60
|
-
else
|
61
|
-
puts "not configured"
|
62
|
-
end
|
63
|
-
false
|
64
|
-
end
|
50
|
+
$application = Ugc::Application.new
|
51
|
+
$management = Ugc::Management.new
|
52
|
+
$context = global_options[:management] ? $management : $application
|
53
|
+
true
|
65
54
|
end
|
66
55
|
end
|
67
56
|
|
@@ -73,7 +62,10 @@ on_error do |e|
|
|
73
62
|
# return false to skip default error handling
|
74
63
|
if e.is_a? RestClient::Exception
|
75
64
|
begin
|
76
|
-
puts e.response.data['error_description']
|
65
|
+
puts "#{e.http_code} error: #{e.response.data['error_description']}"
|
66
|
+
if e.http_code == 401 and not $settings.logged_in?
|
67
|
+
puts "(Hint: You may need to log in.)"
|
68
|
+
end
|
77
69
|
rescue MultiJson::DecodeError
|
78
70
|
puts e.response
|
79
71
|
end
|
data/lib/ugc/application.rb
CHANGED
@@ -30,5 +30,23 @@ module Ugc
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
def list_collections
|
34
|
+
app = $application.entity
|
35
|
+
collections = app['metadata']['collections']
|
36
|
+
table border: $settings.table_border? do
|
37
|
+
row header: true do
|
38
|
+
collections.first[1].each_key do |k|
|
39
|
+
column k
|
40
|
+
end
|
41
|
+
end
|
42
|
+
collections.each_value do |coll|
|
43
|
+
row do
|
44
|
+
coll.each_value do |v|
|
45
|
+
column v
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
33
51
|
end
|
34
52
|
end
|
data/lib/ugc/commands/get.rb
CHANGED
@@ -2,44 +2,24 @@ desc 'retrieve and display a collection or entity'
|
|
2
2
|
|
3
3
|
command :get,:show,:ls,:list do |c|
|
4
4
|
|
5
|
-
c.desc '
|
6
|
-
c.command [:
|
5
|
+
c.desc '[path]'
|
6
|
+
c.command [:path] do |c2|
|
7
7
|
|
8
8
|
c2.action do |global_options,options,args|
|
9
|
-
help_now! unless args[0]
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
c.desc 'collections'
|
21
|
-
c.command [:collections] do |c2|
|
22
|
-
|
23
|
-
c2.action do |global_options,options,args|
|
24
|
-
app = $application.entity
|
25
|
-
collections = app['metadata']['collections']
|
26
|
-
table border: $settings.table_border? do
|
27
|
-
row header: true do
|
28
|
-
collections.first[1].each_key do |k|
|
29
|
-
column k
|
30
|
-
end
|
31
|
-
end
|
32
|
-
collections.each_value do |coll|
|
33
|
-
row do
|
34
|
-
coll.each_value do |v|
|
35
|
-
column v
|
36
|
-
end
|
37
|
-
end
|
10
|
+
if args[0] && args[0] != 'collections' && args[0] != '/'
|
11
|
+
resource = $context[args[0]]
|
12
|
+
if $settings.show_curl?
|
13
|
+
puts_curl(:get, resource)
|
14
|
+
else
|
15
|
+
format_response resource.get
|
38
16
|
end
|
17
|
+
else
|
18
|
+
$application.list_collections
|
39
19
|
end
|
40
20
|
end
|
41
21
|
end
|
42
22
|
|
43
|
-
c.default_command :
|
23
|
+
c.default_command :path
|
44
24
|
|
45
25
|
end
|
data/lib/ugc/commands/post.rb
CHANGED
data/lib/ugc/commands/put.rb
CHANGED
data/lib/ugc/settings.rb
CHANGED
data/lib/ugc/version.rb
CHANGED
data/ugc.gemspec
CHANGED
@@ -18,7 +18,7 @@ spec = Gem::Specification.new do |s|
|
|
18
18
|
s.add_development_dependency('rake')
|
19
19
|
s.add_development_dependency('rdoc')
|
20
20
|
s.add_development_dependency('aruba')
|
21
|
-
s.add_runtime_dependency('gli')
|
21
|
+
s.add_runtime_dependency('gli', '>= 2.6')
|
22
22
|
s.add_runtime_dependency('usergrid_iron','>= 0.9.1')
|
23
23
|
s.add_runtime_dependency('highline')
|
24
24
|
s.add_runtime_dependency('command_line_reporter')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ugc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Ganyo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '2.6'
|
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
|
-
version: '
|
68
|
+
version: '2.6'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: usergrid_iron
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/ugc/commands/delete.rb
|
134
134
|
- lib/ugc/commands/get.rb
|
135
135
|
- lib/ugc/commands/login.rb
|
136
|
+
- lib/ugc/commands/logout.rb
|
136
137
|
- lib/ugc/commands/post.rb
|
137
138
|
- lib/ugc/commands/profile.rb
|
138
139
|
- lib/ugc/commands/put.rb
|