gazer 0.2.30 → 0.2.31

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: e1d752a6c9ab6c912a7ccabaafe45141f3e70e75
4
- data.tar.gz: 6907072bde4d5f3150cea70615acb8ae693b3178
3
+ metadata.gz: 5a9e83bd6f2cc7b63023de94547564ef698039d1
4
+ data.tar.gz: ede1fad9d9d6aae55f7cefa41920a5369707b993
5
5
  SHA512:
6
- metadata.gz: bd7d987e4e78960c739a0b63e10eb16642392e5f4b1baecf3964e755521f2686b186a0951da02be95dd66e722526663132168d7ab1eebc1117da6718a28ca14e
7
- data.tar.gz: d087140b4ae80317e54289e31d09b89ba859675b18422e51ed28e4d1cc14f0bf90b419fd36d00c3ee253de03fe13b399f9e97250cd95823ee7cbb017209ab7a9
6
+ metadata.gz: 5454a2edf446a6d4be52994420b58b2ab164d3e9317dcf52461c0fedef9c1c282096fa70bb349ee7ea60e92b8cc8876ea3f5dbedebcf4f16a5833c66befffefc
7
+ data.tar.gz: a58baf3edd1795bbce10cc8529da8faf54c89fa6791b9b45b4a8e96922d0a09c61e14bff848a80b716ea2f25150c49d70a38a8b7d300d02743a5e283419567c9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gazer (0.2.30)
4
+ gazer (0.2.31)
5
5
  looker-sdk (~> 0.0.6)
6
6
  netrc (~> 0.11.0)
7
7
  pastel (~> 0.7.2)
@@ -82,9 +82,9 @@ module Gzr
82
82
  @v3_1_available ||= false
83
83
  end
84
84
 
85
- def build_connection_hash()
85
+ def build_connection_hash(api_version='3.0')
86
86
  conn_hash = Hash.new
87
- conn_hash[:api_endpoint] = "http#{@options[:ssl] ? "s" : ""}://#{@options[:host]}:#{@options[:port]}/"
87
+ conn_hash[:api_endpoint] = "http#{@options[:ssl] ? "s" : ""}://#{@options[:host]}:#{@options[:port]}/api/#{api_version}"
88
88
  if @options[:http_proxy]
89
89
  conn_hash[:connection_options] ||= {}
90
90
  conn_hash[:connection_options][:proxy] = {
@@ -137,10 +137,14 @@ module Gzr
137
137
  sawyer_options = {
138
138
  :links_parser => Sawyer::LinkParsers::Simple.new,
139
139
  :serializer => LookerSDK::Client::Serializer.new(JSON),
140
- :faraday => conn_hash[:faraday] || Faraday.new(conn_hash[:connection_options])
140
+ :faraday => Faraday.new(conn_hash[:connection_options])
141
141
  }
142
142
 
143
- agent = Sawyer::Agent.new(conn_hash[:api_endpoint], conn_hash) do |http|
143
+ endpoint = conn_hash[:api_endpoint]
144
+ endpoint_uri = URI.parse(endpoint)
145
+ root = endpoint.slice(0..-endpoint_uri.path.length)
146
+
147
+ agent = Sawyer::Agent.new(root, sawyer_options) do |http|
144
148
  http.headers[:accept] = 'application/json'
145
149
  http.headers[:user_agent] = conn_hash[:user_agent]
146
150
  end
@@ -154,7 +158,7 @@ module Gzr
154
158
  rescue Faraday::ConnectionFailed => cf
155
159
  raise Gzr::CLI::Error, "Connection Failed.\nDid you specify the --no-ssl option for an ssl secured server?"
156
160
  rescue LookerSDK::NotFound => nf
157
- say_warning "endpoint #{conn_hash[:api_endpoint]}/versions was not found"
161
+ say_warning "endpoint #{root}/versions was not found"
158
162
  end
159
163
  versions.each do |v|
160
164
  @v3_1_available = true if v.version == "3.1"
@@ -166,8 +170,7 @@ module Gzr
166
170
  raise Gzr::CLI::Error, "Operation requires API v3.1, but user specified a different version" if (api_version == "3.1") && @options[:api_version] && !("3.1" == @options[:api_version])
167
171
  raise Gzr::CLI::Error, "Operation requires API v3.1, which is not available from this host" if (api_version == "3.1") && !v3_1_available?
168
172
 
169
- conn_hash = build_connection_hash()
170
- conn_hash[:api_endpoint] = "#{conn_hash[:api_endpoint]}api/#{@options[:api_version] || current_version.version}"
173
+ conn_hash = build_connection_hash(@options[:api_version] || current_version.version)
171
174
  @secret = nil
172
175
 
173
176
  say_ok("connecting to #{conn_hash.map { |k,v| "#{k}=>#{(k == :client_secret) ? '*********' : v}" }}") if @options[:debug]
@@ -20,5 +20,5 @@
20
20
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  module Gzr
23
- VERSION = "0.2.30"
23
+ VERSION = "0.2.31"
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.30
4
+ version: 0.2.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike DeAngelo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-11 00:00:00.000000000 Z
11
+ date: 2019-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-reader