klimt 0.4.0 → 0.5.0
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +5 -8
- data/Rakefile +1 -1
- data/lib/klimt/clients/gravity_client.rb +6 -1
- data/lib/klimt/command.rb +3 -3
- data/lib/klimt/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd0bad91424e276b9b3a0481143714289a8e5529
|
4
|
+
data.tar.gz: 8a9a4b9d485b4587eb16c0c67c67e91386441032
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4b840a1a091fe5867b3696996abb000bd08689d4150d0745336fa5311f00f90c13004b8a98d3d96a776616dff298c5a2f8ec1a6c54b2e91f21d3808c3e5f7d2
|
7
|
+
data.tar.gz: 2aad2a9793ea6e7b557910e87f71befa970b2ec4a8f31168d4f3e8353e673b198ad262813794904a1f2cf6ad6aaaade6e014810b68b92f676410aa30f5bcb4f9
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -67,7 +67,7 @@ Klimt — like the Heroku CLI client — uses [Netrc](https://github.com/heroku
|
|
67
67
|
|
68
68
|
## Klimt :sparkling_heart: JQ
|
69
69
|
|
70
|
-
[JQ](https://stedolan.github.io/jq/) is a command line
|
70
|
+
[JQ](https://stedolan.github.io/jq/) is a command line json pretty-printing and transformation tool that works great with Klimt
|
71
71
|
|
72
72
|
```sh
|
73
73
|
$ klimt list partners | jq '.[] | { id, name }'
|
@@ -82,17 +82,14 @@ $ klimt find artist andy-warhol --color
|
|
82
82
|
|
83
83
|
## Installation
|
84
84
|
|
85
|
-
|
85
|
+
Klimt is available as a RubyGem, so installation is as simple as:
|
86
86
|
|
87
87
|
```sh
|
88
|
-
|
89
|
-
$
|
90
|
-
# Set up your gravity keys
|
91
|
-
$ gem build klimt.gemspec
|
92
|
-
$ gem install klimt*.gem
|
88
|
+
# Set up your gravity keys, then…
|
89
|
+
$ gem install klimt
|
93
90
|
```
|
94
91
|
|
95
|
-
Klimt uses a Gravity `ClientApplication`, whose id and secret you'll have to supply in your environment as `KLIMT_ID` and `KLIMT_SECRET`. (
|
92
|
+
Klimt uses a Gravity `ClientApplication`, whose id and secret you'll have to supply in your environment as `KLIMT_ID` and `KLIMT_SECRET`. (These are available in the shared 1Password vault — search for "Klimt env")
|
96
93
|
|
97
94
|
```sh
|
98
95
|
$ KLIMT_ID=<replace> KLIMT_SECRET=<replace> klimt help
|
data/Rakefile
CHANGED
@@ -18,6 +18,7 @@ module Klimt
|
|
18
18
|
def find(type:, id:)
|
19
19
|
uri = "https://#{@host}/api/v1/#{type}/#{id}"
|
20
20
|
response = Typhoeus.get(uri, headers: headers)
|
21
|
+
raise response.body unless response.success?
|
21
22
|
response.body
|
22
23
|
end
|
23
24
|
|
@@ -25,6 +26,7 @@ module Klimt
|
|
25
26
|
params = parse_params(params)
|
26
27
|
uri = "https://#{@host}/api/v1/#{type}"
|
27
28
|
response = Typhoeus.get(uri, headers: headers, params: params)
|
29
|
+
raise response.body unless response.success?
|
28
30
|
response.body
|
29
31
|
end
|
30
32
|
|
@@ -43,6 +45,7 @@ module Klimt
|
|
43
45
|
params[:indexes] = indexes unless indexes.nil?
|
44
46
|
uri = "https://#{@host}/api/v1/match"
|
45
47
|
response = Typhoeus.get(uri, headers: headers, params: params, params_encoding: :rack) # encode arrays correctly
|
48
|
+
raise response.body unless response.success?
|
46
49
|
response.body
|
47
50
|
end
|
48
51
|
|
@@ -52,6 +55,7 @@ module Klimt
|
|
52
55
|
params = parse_params(params)
|
53
56
|
uri = "https://#{@host}/api/v1/partner/#{id}/locations"
|
54
57
|
response = Typhoeus.get(uri, headers: headers, params: params)
|
58
|
+
raise response.body unless response.success?
|
55
59
|
response.body
|
56
60
|
end
|
57
61
|
|
@@ -67,6 +71,7 @@ module Klimt
|
|
67
71
|
raise ArgumentError, 'a "near=LNG,LAT" parameter is required' unless params.include? 'near'
|
68
72
|
uri = "https://#{@host}/api/v1/partners"
|
69
73
|
response = Typhoeus.get(uri, headers: headers, params: params)
|
74
|
+
raise response.body unless response.success?
|
70
75
|
response.body
|
71
76
|
end
|
72
77
|
|
@@ -110,7 +115,7 @@ module Klimt
|
|
110
115
|
}
|
111
116
|
response = Typhoeus.get "https://#{@host}/oauth2/access_token", params: params
|
112
117
|
body = JSON.parse(response.body)
|
113
|
-
quit "Login
|
118
|
+
quit "Login raiseed: #{body['error_description']}" unless response.success?
|
114
119
|
body['access_token'].tap do |new_token|
|
115
120
|
netrc = Netrc.read
|
116
121
|
netrc[@host] = email, new_token
|
data/lib/klimt/command.rb
CHANGED
@@ -9,9 +9,9 @@ module Klimt
|
|
9
9
|
include Klimt::Commands::Rendering
|
10
10
|
include ZshCompletion::Command
|
11
11
|
|
12
|
-
map %w
|
12
|
+
map %w[--version -v] => 'version'
|
13
13
|
|
14
|
-
class_option :env, desc: 'Choose environment', default: 'production', aliases: ['-e'], enum: %w
|
14
|
+
class_option :env, desc: 'Choose environment', default: 'production', aliases: ['-e'], enum: %w[production staging]
|
15
15
|
class_option :color, desc: 'Colorize output (via jq)', default: false, aliases: ['-c'], type: :boolean
|
16
16
|
|
17
17
|
desc 'find TYPE ID', 'An instance of the given TYPE, identified by ID'
|
@@ -38,7 +38,7 @@ module Klimt
|
|
38
38
|
desc 'search TERM', 'Search results for the given TERM, optionally filtered by PARAMS'
|
39
39
|
method_option :lucky, type: :boolean, desc: 'Feeling lucky? Just summarize the top hit', default: false
|
40
40
|
method_option :indexes, type: :array, desc: 'An array of indexes to search', banner: 'Profile Artist etc...',
|
41
|
-
enum: %w
|
41
|
+
enum: %w[Article Artist Artist Artwork City Fair Feature Gene PartnerShow Profile Sale Tag]
|
42
42
|
def search(term, *params)
|
43
43
|
if options[:lucky]
|
44
44
|
params << 'size=1'
|
data/lib/klimt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klimt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anandaroop Roy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- ".rubocop.yml"
|
179
179
|
- ".rubocop_todo.yml"
|
180
180
|
- ".travis.yml"
|
181
|
+
- CHANGELOG.md
|
181
182
|
- CODE_OF_CONDUCT.md
|
182
183
|
- Gemfile
|
183
184
|
- LICENSE.txt
|
@@ -217,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
218
|
version: '0'
|
218
219
|
requirements: []
|
219
220
|
rubyforge_project:
|
220
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.6.13
|
221
222
|
signing_key:
|
222
223
|
specification_version: 4
|
223
224
|
summary: CLI for the Artsy API
|