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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf88f548e7806cd204cdad0f709d4fcba34cf197
4
- data.tar.gz: 462adaad08830d3752279b11790f99ddeaec983d
3
+ metadata.gz: dd0bad91424e276b9b3a0481143714289a8e5529
4
+ data.tar.gz: 8a9a4b9d485b4587eb16c0c67c67e91386441032
5
5
  SHA512:
6
- metadata.gz: 52962eeb267cf8c8247ccd64ee2d8a9c218437eae74b1ae470a77555b85199031bfe2d849add0b656c3c98b3d2c8017834bb5e042e8387f185fef144f64dda3f
7
- data.tar.gz: dd4f66ba0bb5dd9e345178927c6c266f71efe8cdef85d069d3d58809ed45c6616903431bd4b4187999bd6b4f7b3d117db0727daae4a1e46e33b3cc9c1506cb1b
6
+ metadata.gz: b4b840a1a091fe5867b3696996abb000bd08689d4150d0745336fa5311f00f90c13004b8a98d3d96a776616dff298c5a2f8ec1a6c54b2e91f21d3808c3e5f7d2
7
+ data.tar.gz: 2aad2a9793ea6e7b557910e87f71befa970b2ec4a8f31168d4f3e8353e673b198ad262813794904a1f2cf6ad6aaaade6e014810b68b92f676410aa30f5bcb4f9
@@ -0,0 +1,3 @@
1
+ # 0.5.0
2
+
3
+ - Added more verbose failure from upstream error
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 JSON pretty-printing and transformation tool that works great with Klimt
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
- Since it's not distributed via RubyGems, you'll fetch and build it yourself which is as simple as:
85
+ Klimt is available as a RubyGem, so installation is as simple as:
86
86
 
87
87
  ```sh
88
- $ git clone https://github.com/anandaroop/klimt.git
89
- $ cd klimt
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`. (Available in 1Password)
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
@@ -8,4 +8,4 @@ RuboCop::RakeTask.new(:rubocop) do |t|
8
8
  t.options = ['--display-cop-names']
9
9
  end
10
10
 
11
- task default: [:rubocop, :spec]
11
+ task default: %i[rubocop spec]
@@ -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 failed: #{body['error_description']}" unless response.success?
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
@@ -9,9 +9,9 @@ module Klimt
9
9
  include Klimt::Commands::Rendering
10
10
  include ZshCompletion::Command
11
11
 
12
- map %w(--version -v) => 'version'
12
+ map %w[--version -v] => 'version'
13
13
 
14
- class_option :env, desc: 'Choose environment', default: 'production', aliases: ['-e'], enum: %w(production staging)
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(Article Artist Artist Artwork City Fair Feature Gene PartnerShow Profile Sale Tag)
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'
@@ -1,3 +1,3 @@
1
1
  module Klimt
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
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.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-02-11 00:00:00.000000000 Z
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.5.1
221
+ rubygems_version: 2.6.13
221
222
  signing_key:
222
223
  specification_version: 4
223
224
  summary: CLI for the Artsy API