esignatur 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -1
- data/{.hound → .hound.yml} +1 -0
- data/.rubocop.yml +3 -3
- data/Gemfile.lock +19 -25
- data/esignatur.gemspec +2 -1
- data/lib/esignatur/api.rb +18 -9
- data/lib/esignatur/client.rb +2 -6
- data/lib/esignatur/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a6949dca95e7db555ce0ef6a51305250ae96b6915d4d22816c6cd4f39fb04f2
|
4
|
+
data.tar.gz: 40e103f6364ef082093550b9022c07931a4ab779198e971d40f2e8a1d5a9bda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd2676c1c5fe06d34609d14e6c5d6cca6ae66c9e822859d1e7378aa8b8f89db7e5248c870e5524957a6f8b5098886ee7e751d2a10a334f3546bb2a0e7cd4efa9
|
7
|
+
data.tar.gz: b10cdbacbdc0cb0f9acd78edf07e5b8dec4b2b786039a9ad2679e81d1bc362d3a87153199ae8225efc4ec065fbbf3d44f0b6b9ef3b758934bb47b1abcc4b4656
|
data/.github/workflows/ruby.yml
CHANGED
@@ -3,6 +3,7 @@ on: [push, pull_request]
|
|
3
3
|
jobs:
|
4
4
|
specs:
|
5
5
|
strategy:
|
6
|
+
fail-fast: false
|
6
7
|
matrix:
|
7
8
|
ruby-version: ['3.0', '3.2', '3.3']
|
8
9
|
|
@@ -10,7 +11,7 @@ jobs:
|
|
10
11
|
env:
|
11
12
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
12
13
|
steps:
|
13
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v3
|
14
15
|
- uses: ruby/setup-ruby@v1
|
15
16
|
with:
|
16
17
|
ruby-version: ${{ matrix.ruby-version }}
|
data/{.hound → .hound.yml}
RENAMED
data/.rubocop.yml
CHANGED
@@ -3,7 +3,7 @@ require: rubocop-rspec
|
|
3
3
|
RSpec/NestedGroups:
|
4
4
|
Enabled: false
|
5
5
|
|
6
|
-
|
6
|
+
Layout/LineLength:
|
7
7
|
Enabled: true
|
8
8
|
Max: 120
|
9
9
|
|
@@ -18,7 +18,7 @@ Lint/AmbiguousBlockAssociation:
|
|
18
18
|
Exclude:
|
19
19
|
- spec/**/*.rb
|
20
20
|
|
21
|
-
Naming/
|
21
|
+
Naming/MethodParameterName:
|
22
22
|
AllowedNames:
|
23
23
|
- 'to'
|
24
24
|
- 'at'
|
@@ -28,7 +28,7 @@ Naming/UncommunicativeMethodParamName:
|
|
28
28
|
- 'as'
|
29
29
|
|
30
30
|
AllCops:
|
31
|
-
TargetRubyVersion: 3.
|
31
|
+
TargetRubyVersion: 3.0
|
32
32
|
Exclude:
|
33
33
|
- bin/*
|
34
34
|
- esignatur.gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
esignatur (2.
|
4
|
+
esignatur (2.1.0)
|
5
5
|
activesupport (>= 4.0)
|
6
6
|
faraday (>= 0.10)
|
7
7
|
json (>= 2.6.2)
|
@@ -46,14 +46,13 @@ GEM
|
|
46
46
|
i18n (1.14.1)
|
47
47
|
concurrent-ruby (~> 1.0)
|
48
48
|
json (2.7.1)
|
49
|
-
language_server-protocol (3.17.0.3)
|
50
49
|
method_source (1.0.0)
|
51
50
|
minitest (5.21.2)
|
52
51
|
mutex_m (0.2.0)
|
53
52
|
net-http (0.4.1)
|
54
53
|
uri
|
55
54
|
parallel (1.24.0)
|
56
|
-
parser (3.3.0
|
55
|
+
parser (3.3.1.0)
|
57
56
|
ast (~> 2.4.1)
|
58
57
|
racc
|
59
58
|
pry (0.14.2)
|
@@ -63,11 +62,12 @@ GEM
|
|
63
62
|
byebug (~> 11.0)
|
64
63
|
pry (>= 0.13, < 0.15)
|
65
64
|
public_suffix (5.0.4)
|
66
|
-
racc (1.
|
65
|
+
racc (1.8.0)
|
67
66
|
rainbow (3.1.1)
|
68
67
|
rake (13.1.0)
|
69
|
-
regexp_parser (2.9.
|
70
|
-
rexml (3.2.
|
68
|
+
regexp_parser (2.9.2)
|
69
|
+
rexml (3.2.8)
|
70
|
+
strscan (>= 3.0.9)
|
71
71
|
rspec (3.12.0)
|
72
72
|
rspec-core (~> 3.12.0)
|
73
73
|
rspec-expectations (~> 3.12.0)
|
@@ -81,27 +81,20 @@ GEM
|
|
81
81
|
diff-lcs (>= 1.2.0, < 2.0)
|
82
82
|
rspec-support (~> 3.12.0)
|
83
83
|
rspec-support (3.12.1)
|
84
|
-
rubocop (1.
|
85
|
-
json (~> 2.3)
|
86
|
-
language_server-protocol (>= 3.17.0)
|
84
|
+
rubocop (1.5.2)
|
87
85
|
parallel (~> 1.10)
|
88
|
-
parser (>=
|
86
|
+
parser (>= 2.7.1.5)
|
89
87
|
rainbow (>= 2.2.2, < 4.0)
|
90
88
|
regexp_parser (>= 1.8, < 3.0)
|
91
|
-
rexml
|
92
|
-
rubocop-ast (>= 1.
|
89
|
+
rexml
|
90
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
93
91
|
ruby-progressbar (~> 1.7)
|
94
|
-
unicode-display_width (>=
|
95
|
-
rubocop-ast (1.
|
96
|
-
parser (>= 3.
|
97
|
-
rubocop-
|
98
|
-
rubocop (~> 1.
|
99
|
-
|
100
|
-
rubocop (~> 1.41)
|
101
|
-
rubocop-rspec (2.26.1)
|
102
|
-
rubocop (~> 1.40)
|
103
|
-
rubocop-capybara (~> 2.17)
|
104
|
-
rubocop-factory_bot (~> 2.22)
|
92
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
93
|
+
rubocop-ast (1.31.3)
|
94
|
+
parser (>= 3.3.1.0)
|
95
|
+
rubocop-rspec (2.4.0)
|
96
|
+
rubocop (~> 1.0)
|
97
|
+
rubocop-ast (>= 1.1.0)
|
105
98
|
ruby-progressbar (1.13.0)
|
106
99
|
ruby2_keywords (0.0.5)
|
107
100
|
simplecov (0.21.2)
|
@@ -110,9 +103,10 @@ GEM
|
|
110
103
|
simplecov_json_formatter (~> 0.1)
|
111
104
|
simplecov-html (0.12.3)
|
112
105
|
simplecov_json_formatter (0.1.4)
|
106
|
+
strscan (3.1.0)
|
113
107
|
tzinfo (2.0.6)
|
114
108
|
concurrent-ruby (~> 1.0)
|
115
|
-
unicode-display_width (
|
109
|
+
unicode-display_width (1.8.0)
|
116
110
|
uri (0.13.0)
|
117
111
|
webmock (3.19.1)
|
118
112
|
addressable (>= 2.8.0)
|
@@ -129,7 +123,7 @@ DEPENDENCIES
|
|
129
123
|
pry-byebug
|
130
124
|
rake (>= 10.0)
|
131
125
|
rspec (>= 3.0)
|
132
|
-
rubocop (
|
126
|
+
rubocop (= 1.5.2)
|
133
127
|
rubocop-rspec (>= 1.27)
|
134
128
|
simplecov (>= 0.16.1)
|
135
129
|
webmock (>= 3.4)
|
data/esignatur.gemspec
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require "esignatur/version"
|
5
|
+
require "yaml"
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
8
|
spec.name = "esignatur"
|
@@ -39,7 +40,7 @@ Gem::Specification.new do |spec|
|
|
39
40
|
spec.add_development_dependency "bundler", ">= 1.16"
|
40
41
|
spec.add_development_dependency "rake", ">= 10.0"
|
41
42
|
spec.add_development_dependency "rspec", ">= 3.0"
|
42
|
-
spec.add_development_dependency "rubocop", '
|
43
|
+
spec.add_development_dependency "rubocop", YAML.load_file('.hound.yml')['rubocop']['version']
|
43
44
|
spec.add_development_dependency "rubocop-rspec", '>= 1.27'
|
44
45
|
spec.add_development_dependency "webmock", '>= 3.4'
|
45
46
|
spec.add_development_dependency "codecov", '>= 0.2.0'
|
data/lib/esignatur/api.rb
CHANGED
@@ -12,33 +12,42 @@ module Esignatur
|
|
12
12
|
|
13
13
|
attr_reader :creator_id
|
14
14
|
|
15
|
-
def initialize(api_key:, creator_id:, base_url: DEFAULT_BASE_URL)
|
15
|
+
def initialize(api_key:, creator_id:, base_url: DEFAULT_BASE_URL, timeout: nil)
|
16
16
|
@api_key = api_key.to_s
|
17
17
|
@base_url = base_url
|
18
18
|
@creator_id = creator_id
|
19
|
+
@default_timeout = timeout
|
19
20
|
end
|
20
21
|
|
21
|
-
def post(relative_url, data:, headers: {})
|
22
|
-
make_request(:post, relative_url, data: data, extra_headers: headers)
|
22
|
+
def post(relative_url, data:, headers: {}, timeout: nil)
|
23
|
+
make_request(:post, relative_url, data: data, extra_headers: headers, timeout: timeout)
|
23
24
|
end
|
24
25
|
|
25
|
-
def get(relative_url, headers: {})
|
26
|
-
make_request(:get, relative_url, extra_headers: headers)
|
26
|
+
def get(relative_url, headers: {}, timeout: nil)
|
27
|
+
make_request(:get, relative_url, extra_headers: headers, timeout: timeout)
|
27
28
|
end
|
28
29
|
|
29
30
|
private
|
30
31
|
|
31
|
-
attr_reader :base_url, :api_key
|
32
|
+
attr_reader :base_url, :api_key, :default_timeout
|
32
33
|
|
33
|
-
def make_request(http_method, relative_url, extra_headers: {}, data: nil)
|
34
|
+
def make_request(http_method, relative_url, extra_headers: {}, data: nil, timeout: nil)
|
34
35
|
url = URI.join(base_url, relative_url).to_s
|
35
|
-
|
36
36
|
headers = default_headers.merge(extra_headers)
|
37
|
-
|
37
|
+
|
38
|
+
raw_response = connection(timeout: timeout).public_send(http_method, url, data&.to_json, headers)
|
38
39
|
request = RequestInfo.new(http_method, url, headers)
|
39
40
|
Esignatur::Api::Response.new(raw_response, request: request)
|
40
41
|
end
|
41
42
|
|
43
|
+
def connection(timeout: nil)
|
44
|
+
request_timeout = timeout || default_timeout
|
45
|
+
|
46
|
+
Faraday.new do |conn|
|
47
|
+
conn.options.timeout = request_timeout if request_timeout
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
42
51
|
def default_headers
|
43
52
|
{
|
44
53
|
'X-eSignatur-Id' => api_key,
|
data/lib/esignatur/client.rb
CHANGED
@@ -4,12 +4,8 @@ module Esignatur
|
|
4
4
|
class Client
|
5
5
|
DEFAULT_BASE_URL = 'https://api.esignatur.dk'
|
6
6
|
|
7
|
-
def initialize(
|
8
|
-
@api = Esignatur::Api.new(
|
9
|
-
api_key: api_key,
|
10
|
-
base_url: base_url,
|
11
|
-
creator_id: creator_id
|
12
|
-
)
|
7
|
+
def initialize(**options)
|
8
|
+
@api = Esignatur::Api.new(**options)
|
13
9
|
end
|
14
10
|
|
15
11
|
def orders
|
data/lib/esignatur/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esignatur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Povilas Jurcys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -112,16 +112,16 @@ dependencies:
|
|
112
112
|
name: rubocop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 1.5.2
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 1.5.2
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rubocop-rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,7 +201,7 @@ extra_rdoc_files: []
|
|
201
201
|
files:
|
202
202
|
- ".github/workflows/ruby.yml"
|
203
203
|
- ".gitignore"
|
204
|
-
- ".hound"
|
204
|
+
- ".hound.yml"
|
205
205
|
- ".rspec"
|
206
206
|
- ".rubocop.yml"
|
207
207
|
- ".ruby-version"
|