kapellmeister 0.9.9.rc3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +4 -4
- data/kapellmeister.gemspec +1 -0
- data/lib/kapellmeister/dispatcher.rb +6 -3
- data/lib/kapellmeister/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb7b158329d4dfbb447e55ad06cc9ec60c133fbb20f3fa8de4974e5f807c32af
|
4
|
+
data.tar.gz: 8e0a71af6badbb6f41327893c18a8eee1fcff3e0638b2823be50233bd30ef756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d79f2670f5e910f6288b5e891e7cba1901cb975307f58f01410a8a611d8e73215c073db52add6d566fe8142bdc88190ad16b816cde61bfd2f7ae7f5c92e2978
|
7
|
+
data.tar.gz: 11b6fdd130aac37875a597db56df1064ecb94ed61393325c807f1ac4a7868c68939fdfed2fd28caefd3f1c04bbbee4714dc2d6cd917b0986ea2e76f8b8836d86
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
## Использование
|
5
5
|
|
6
6
|
Добавьте kapellmeister в свой Gemfile:
|
7
|
-
На данный момент последняя версия 0.
|
7
|
+
На данный момент последняя версия 0.10.0 (Проект находится в стадии тестирования работоспособности, beta-test)
|
8
8
|
```ruby
|
9
|
-
gem 'kapellmeister', '~> 0.
|
9
|
+
gem 'kapellmeister', '~> 0.10.0'
|
10
10
|
```
|
11
11
|
|
12
12
|
### Добавьте новую конфигурацию для стороннего API:
|
@@ -137,9 +137,9 @@ This template-service allows you to define http requests to a third party throug
|
|
137
137
|
## Usage
|
138
138
|
|
139
139
|
Add kapellmeister to your Gemfile:
|
140
|
-
At the moment, the latest version is 0.
|
140
|
+
At the moment, the latest version is 0.10.0 (The project is in the stage of performance testing, beta-test)
|
141
141
|
```ruby
|
142
|
-
gem 'kapellmeister', '~> 0.
|
142
|
+
gem 'kapellmeister', '~> 0.10.0'
|
143
143
|
```
|
144
144
|
|
145
145
|
### Add a new configuration for the third-party API:
|
data/kapellmeister.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.add_dependency 'faraday', '~> 2.10'
|
30
30
|
gem.add_dependency 'faraday-cookie_jar', '~> 0.0.7'
|
31
31
|
gem.add_dependency 'faraday-follow_redirects', '~> 0.3.0'
|
32
|
+
gem.add_dependency 'faraday-multipart', '~> 1.0.0'
|
32
33
|
gem.add_dependency 'faraday-typhoeus', '~> 1.1.0'
|
33
34
|
|
34
35
|
gem.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'faraday/follow_redirects'
|
2
|
+
require 'faraday/typhoeus'
|
3
|
+
require 'faraday/multipart'
|
2
4
|
require_relative 'requests_extension'
|
3
5
|
|
4
6
|
class Kapellmeister::Dispatcher
|
@@ -40,6 +42,7 @@ class Kapellmeister::Dispatcher
|
|
40
42
|
additional_headers = data.delete(:headers) || {}
|
41
43
|
requests_data = data.delete(:request) || {}
|
42
44
|
data_json = data.blank? ? '' : data.to_json
|
45
|
+
additional_headers['Content-Length'] = requests_data.merge(data).to_s.bytesize
|
43
46
|
|
44
47
|
generated_connection = connection(additional_headers: additional_headers, requests_data: requests_data) # rubocop:disable Style/HashSyntax (for support ruby 2.4+)
|
45
48
|
|
@@ -53,9 +56,9 @@ class Kapellmeister::Dispatcher
|
|
53
56
|
end
|
54
57
|
|
55
58
|
def connection(additional_headers:, requests_data:)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
+
request = requests_generate(**requests_data)
|
60
|
+
headers = headers_generate(**additional_headers)
|
61
|
+
@connection ||= ::Faraday.new(url: configuration.url, headers: headers, request: request) do |faraday| # rubocop:disable Style/HashSyntax (for support ruby 2.4+)
|
59
62
|
faraday.request :json, content_type: 'application/json; charset=utf-8'
|
60
63
|
faraday.request :multipart
|
61
64
|
faraday.response :logger, logger
|
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.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DarkWater
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-schema
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.3.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday-multipart
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.0.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: faraday-typhoeus
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,9 +231,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
231
|
version: 2.4.2
|
218
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
233
|
requirements:
|
220
|
-
- - "
|
234
|
+
- - ">="
|
221
235
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
236
|
+
version: '0'
|
223
237
|
requirements: []
|
224
238
|
rubygems_version: 3.3.7
|
225
239
|
signing_key:
|