geordi 12.0.0 → 12.0.1

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
  SHA256:
3
- metadata.gz: '04677830ab820667757b670bc6702114582031396fbd7e7600e038bcdab4dd47'
4
- data.tar.gz: 05cf15e451eb7104f415b5fc06f440088a5f57f9f5835427570d80f4ddf166ce
3
+ metadata.gz: fc23c0e80257e2e7aaf7fc1a5072b2f43ff1f4c256c02da05e1c2147344d4221
4
+ data.tar.gz: 589328ecc0caa7b2215de91a390b1b4fa9180ca53dba33a39427cf557602886a
5
5
  SHA512:
6
- metadata.gz: fdf93074bfa1f08952717dd7e4d0097975e14049fdf9a62a57bfeb969e950fd7d803e45964ef7b5037402c280d788558dd1d195c380524e6267ee56739265c2d
7
- data.tar.gz: 3990f5698b00ff8ecca6e4c31e92bdae56a036810fc19b25bbad4ea40bba17523ec0e6831d68871b21a21b88af21f84b3b6600af073a29a17f2455796c56cf05
6
+ metadata.gz: 4666832d3b69baf2d7fb61ead61cda680ad42bb037585cbc960186a883a32a026fe779c5525d4a7d06dc872de092eb6afaa8da9796d3a42bbb4885b15eaf7b66
7
+ data.tar.gz: d13e207305efbde114b771a0866013d6eb248ba3e42b1924accc556a55cf0999046881c4637666f85e127f602f24321b2b3fe91a4a41ea45e5e2b496c7c48620
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (12.0.0)
4
+ geordi (12.0.1)
5
5
  thor (~> 1)
6
6
 
7
7
  GEM
@@ -158,7 +158,7 @@ module Geordi
158
158
  https = Net::HTTP.new(uri.host, uri.port)
159
159
  https.use_ssl = true
160
160
 
161
- query = [{ query: attributes.split.join(' '), variables: variables }].to_json
161
+ query = { query: attributes.split.join(' '), variables: variables }.to_json
162
162
 
163
163
  request = Net::HTTP::Post.new(uri.path)
164
164
  request.body = query
@@ -167,13 +167,20 @@ module Geordi
167
167
  request['Authorization'] = settings.linear_api_key
168
168
 
169
169
  response = https.request(request)
170
- print clear_loading_message
170
+ parsed_response = JSON.parse(response.body)
171
171
 
172
- parsed_response = JSON.parse(response.body)[0]
173
172
  if parsed_response.key?('errors')
174
- raise parsed_response.dig('errors')
173
+ errors = parsed_response['errors'].map do |error|
174
+ msg = error.delete('message')
175
+ "#{msg} #{error.inspect}"
176
+ end
177
+ Interaction.fail <<~MSG.strip
178
+ API request failed:
179
+ #{errors.join("\n")}
180
+ MSG
175
181
  else
176
- parsed_response['data']
182
+ print clear_loading_message
183
+ parsed_response.dig('data')
177
184
  end
178
185
  end
179
186
 
@@ -110,7 +110,12 @@ module Geordi
110
110
  def save_global_settings
111
111
  global_path = GLOBAL_SETTINGS_FILE_NAME
112
112
  global_directory = File.dirname(global_path)
113
- FileUtils.mkdir_p(global_directory) unless File.directory? global_directory
113
+
114
+ unless File.directory?(global_directory)
115
+ require 'fileutils'
116
+ FileUtils.mkdir_p(global_directory)
117
+ end
118
+
114
119
  File.open(global_path, 'w') do |file|
115
120
  file.write @global_settings.to_yaml
116
121
  end
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '12.0.0'.freeze
2
+ VERSION = '12.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0
4
+ version: 12.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
11
  date: 2025-02-25 00:00:00.000000000 Z
@@ -107,6 +108,7 @@ metadata:
107
108
  bug_tracker_uri: https://github.com/makandra/geordi/issues
108
109
  changelog_uri: https://github.com/makandra/geordi/blob/master/CHANGELOG.md
109
110
  rubygems_mfa_required: 'true'
111
+ post_install_message:
110
112
  rdoc_options: []
111
113
  require_paths:
112
114
  - lib
@@ -121,7 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
123
  - !ruby/object:Gem::Version
122
124
  version: '0'
123
125
  requirements: []
124
- rubygems_version: 3.6.2
126
+ rubygems_version: 3.1.6
127
+ signing_key:
125
128
  specification_version: 4
126
129
  summary: Collection of command line tools we use in our daily work with Ruby, Rails
127
130
  and Linux at makandra.