kapellmeister 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4469ce7f200030e5215269a415737eeb448029bac1e0ea60f238ab9d68eefd6d
|
4
|
+
data.tar.gz: 4a9387ea59601ed6b2413cae95b4dd4b05690492c331a4ed2d7f18f191b04a32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3ed10ab1cf0c69d4e0a18aadb3f9b124d7b1f35040dfc67f89e96d931b1226f7aa2f81bd557998d3176912cd2a2a75ed0d9bd4b39cc18596c679b3bb14cc971
|
7
|
+
data.tar.gz: 3c3ad070259adcb1ba6ec7ac4bcc68a1faa9266bfb5ec50919bd93266698564d04849a43b2bea8afd0ce1ce13e35b30868d2fddce512617166e538cd71dbddb9
|
@@ -9,7 +9,9 @@ class <%= class_name %>::Configuration
|
|
9
9
|
def url
|
10
10
|
raise "No given host to #{self.class.name}" unless host
|
11
11
|
|
12
|
-
https =
|
12
|
+
https = true
|
13
|
+
https = ssl unless ssl.nil?
|
14
|
+
https = <%= class_name %>.ssl unless <%= class_name %>.ssl.nil?
|
13
15
|
|
14
16
|
"URI::HTTP#{https.to_b ? 'S' : ''}".constantize.build(host:, path: [path, version].join('/'))
|
15
17
|
end
|
data/lib/kapellmeister/base.rb
CHANGED
@@ -28,8 +28,8 @@ module Kapellmeister::Base
|
|
28
28
|
def self.routes_scheme_parse(path)
|
29
29
|
template = ERB.new(File.read(path)).result
|
30
30
|
YAML.safe_load(template, aliases: true, permitted_classes: [Symbol, Date, Time]).deep_symbolize_keys
|
31
|
-
rescue Errno::ENOENT
|
32
|
-
warn
|
31
|
+
rescue Errno::ENOENT
|
32
|
+
warn 'No such file or directory', path
|
33
33
|
{}
|
34
34
|
end
|
35
35
|
end
|
@@ -10,14 +10,14 @@ class Kapellmeister::Dispatcher
|
|
10
10
|
|
11
11
|
FailedResponse = Struct.new(:success?, :response, :payload)
|
12
12
|
|
13
|
-
def connection_by(method_name, path, data = {}
|
13
|
+
def connection_by(method_name, path, data = {})
|
14
14
|
additional_headers = data.delete(:headers) || {}
|
15
15
|
requests_data = data.delete(:request) || {}
|
16
16
|
|
17
|
-
generated_connection = connection(additional_headers
|
17
|
+
generated_connection = connection(additional_headers: additional_headers, requests_data: requests_data) # rubocop:disable Style/HashSyntax (for support ruby 2.4+)
|
18
18
|
|
19
19
|
process generated_connection.run_request(method_name.downcase.to_sym, path, data.to_json, additional_headers)
|
20
|
-
rescue
|
20
|
+
rescue NameError, RuntimeError
|
21
21
|
raise "Library can't process method #{method_name} yet"
|
22
22
|
rescue Faraday::ConnectionFailed, Faraday::TimeoutError => e
|
23
23
|
failed_response(details: e.message)
|
@@ -12,7 +12,7 @@ class Kapellmeister::Responder
|
|
12
12
|
def result
|
13
13
|
error = !/2\d{2}/.match?(status.to_s)
|
14
14
|
|
15
|
-
Result.new(!error, parsed_body, { status: }.merge(payload))
|
15
|
+
Result.new(!error, parsed_body, { status: status }.merge(payload)) # rubocop:disable Style/HashSyntax (for support ruby 2.4+)
|
16
16
|
rescue JSON::ParserError => e
|
17
17
|
Result.new(false, e)
|
18
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kapellmeister
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DarkWater
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-schema
|