gazer 0.2.30 → 0.2.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gzr/modules/session.rb +10 -7
- data/lib/gzr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a9e83bd6f2cc7b63023de94547564ef698039d1
|
4
|
+
data.tar.gz: ede1fad9d9d6aae55f7cefa41920a5369707b993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5454a2edf446a6d4be52994420b58b2ab164d3e9317dcf52461c0fedef9c1c282096fa70bb349ee7ea60e92b8cc8876ea3f5dbedebcf4f16a5833c66befffefc
|
7
|
+
data.tar.gz: a58baf3edd1795bbce10cc8529da8faf54c89fa6791b9b45b4a8e96922d0a09c61e14bff848a80b716ea2f25150c49d70a38a8b7d300d02743a5e283419567c9
|
data/Gemfile.lock
CHANGED
data/lib/gzr/modules/session.rb
CHANGED
@@ -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 =>
|
140
|
+
:faraday => Faraday.new(conn_hash[:connection_options])
|
141
141
|
}
|
142
142
|
|
143
|
-
|
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 #{
|
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]
|
data/lib/gzr/version.rb
CHANGED
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.
|
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
|
+
date: 2019-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-reader
|