docuseal 0.1.0 → 0.1.2

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: cdbe565c37f9a94a278e42dcb4369380c467ab5f06e9cdaf0c693904869c5bc5
4
- data.tar.gz: 1986099e7e5af342564dda635432a8ba17f8ce765b4da27483fd23193b27f8c2
3
+ metadata.gz: 9fd66438a5ff8a1c6e320d4481a8d93c2103ade62303b6a9c9e5e7648efcb59c
4
+ data.tar.gz: 58ef168c6f51af33c7fee7c68caf5f443f20e7000a1d21718adda2585fe9733e
5
5
  SHA512:
6
- metadata.gz: 878910faa3dfc3b4450985c204fabfb2f930280cf24bac6dd999c52a2e282a1341fdb83e11612db81bffb1be0288366e121f7430503c4513c90479ee712f6426
7
- data.tar.gz: 202328030706802a4d898831063a2e835c3c98797e233dad29f3feffbd3c6af03579e4bafccdb6bad3a09533d490134d7ff7db735918566bd7b985a86441aa78
6
+ metadata.gz: 4bf980bedcea969ecbfd7a9878867126e4023b801127c0fcc33e9c776d0e46777d2fbc97e78254a45d422d1fb8a03fc3cd69b95700581aec57687a446aa160ab
7
+ data.tar.gz: 42638043365a9821f0bbdc8458b3691e7fde74ec7b406f9f946f87b7c5332b5c6d9ab0a4d6a27ae16ed4ad09c2b184517b0f83aee044dde9cedb79982b00f41f
@@ -0,0 +1,11 @@
1
+ {
2
+ "rubyLsp.formatter": "none", // Use standard rbfmt instead
3
+ "editor.formatOnSave": true,
4
+ "editor.codeActionsOnSave": {
5
+ "source.organizeImports": "explicit"
6
+ },
7
+ "[ruby]": {
8
+ "editor.defaultFormatter": "testdouble.vscode-standard-ruby"
9
+ },
10
+ "standardRuby.autofix": true
11
+ }
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,3 @@
1
+ ## Contributing
2
+
3
+ Bug reports and pull requests are welcome on GitHub at https://github.com/moraki-finance/docuseal. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/moraki-finance/docuseal/blob/main/CODE_OF_CONDUCT.md).
data/Gemfile CHANGED
@@ -12,7 +12,7 @@ gem "rspec", "~> 3.0"
12
12
  gem "standard", "~> 1.3"
13
13
 
14
14
  group :development, :test do
15
- gem "webmock", "~> 3.19.1"
15
+ gem "webmock", "~> 3.23.0"
16
16
  gem "byebug", "~> 11.1"
17
17
  gem "pry", "~> 0.14.2"
18
18
  gem "pry-byebug", "~> 3.10"
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docuseal (0.1.0)
4
+ docuseal (0.1.2)
5
5
  faraday (>= 1)
6
- faraday_middleware (>= 1)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
@@ -11,14 +10,16 @@ GEM
11
10
  addressable (2.8.6)
12
11
  public_suffix (>= 2.0.2, < 6.0)
13
12
  ast (2.4.2)
13
+ bigdecimal (3.1.6)
14
14
  binding_of_caller (1.0.0)
15
15
  debug_inspector (>= 0.0.1)
16
16
  byebug (11.1.3)
17
17
  coderay (1.1.3)
18
- crack (0.4.5)
18
+ crack (1.0.0)
19
+ bigdecimal
19
20
  rexml
20
21
  debug_inspector (1.2.0)
21
- diff-lcs (1.5.0)
22
+ diff-lcs (1.5.1)
22
23
  docile (1.4.0)
23
24
  faraday (1.10.3)
24
25
  faraday-em_http (~> 1.0)
@@ -43,17 +44,15 @@ GEM
43
44
  faraday-patron (1.0.0)
44
45
  faraday-rack (1.0.0)
45
46
  faraday-retry (1.0.3)
46
- faraday_middleware (1.2.0)
47
- faraday (~> 1.0)
48
47
  hashdiff (1.1.0)
49
48
  interception (0.5)
50
49
  json (2.7.1)
51
50
  language_server-protocol (3.17.0.3)
52
51
  lint_roller (1.1.0)
53
52
  method_source (1.0.0)
54
- multipart-post (2.3.0)
53
+ multipart-post (2.4.0)
55
54
  parallel (1.24.0)
56
- parser (3.2.2.4)
55
+ parser (3.3.0.5)
57
56
  ast (~> 2.4.1)
58
57
  racc
59
58
  pry (0.14.2)
@@ -62,7 +61,7 @@ GEM
62
61
  pry-byebug (3.10.1)
63
62
  byebug (~> 11.0)
64
63
  pry (>= 0.13, < 0.15)
65
- pry-rescue (1.5.2)
64
+ pry-rescue (1.6.0)
66
65
  interception (>= 0.5)
67
66
  pry (>= 0.12.0)
68
67
  pry-stack_explorer (0.6.1)
@@ -72,40 +71,40 @@ GEM
72
71
  racc (1.7.3)
73
72
  rainbow (3.1.1)
74
73
  rake (13.1.0)
75
- regexp_parser (2.8.3)
74
+ regexp_parser (2.9.0)
76
75
  rexml (3.2.6)
77
- rspec (3.12.0)
78
- rspec-core (~> 3.12.0)
79
- rspec-expectations (~> 3.12.0)
80
- rspec-mocks (~> 3.12.0)
81
- rspec-core (3.12.2)
82
- rspec-support (~> 3.12.0)
83
- rspec-expectations (3.12.3)
76
+ rspec (3.13.0)
77
+ rspec-core (~> 3.13.0)
78
+ rspec-expectations (~> 3.13.0)
79
+ rspec-mocks (~> 3.13.0)
80
+ rspec-core (3.13.0)
81
+ rspec-support (~> 3.13.0)
82
+ rspec-expectations (3.13.0)
84
83
  diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.12.0)
86
- rspec-mocks (3.12.6)
84
+ rspec-support (~> 3.13.0)
85
+ rspec-mocks (3.13.0)
87
86
  diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.12.0)
89
- rspec-support (3.12.1)
90
- rubocop (1.57.2)
87
+ rspec-support (~> 3.13.0)
88
+ rspec-support (3.13.0)
89
+ rubocop (1.60.2)
91
90
  json (~> 2.3)
92
91
  language_server-protocol (>= 3.17.0)
93
92
  parallel (~> 1.10)
94
- parser (>= 3.2.2.4)
93
+ parser (>= 3.3.0.2)
95
94
  rainbow (>= 2.2.2, < 4.0)
96
95
  regexp_parser (>= 1.8, < 3.0)
97
96
  rexml (>= 3.2.5, < 4.0)
98
- rubocop-ast (>= 1.28.1, < 2.0)
97
+ rubocop-ast (>= 1.30.0, < 2.0)
99
98
  ruby-progressbar (~> 1.7)
100
99
  unicode-display_width (>= 2.4.0, < 3.0)
101
100
  rubocop-ast (1.30.0)
102
101
  parser (>= 3.2.1.0)
103
- rubocop-performance (1.19.1)
104
- rubocop (>= 1.7.0, < 2.0)
105
- rubocop-ast (>= 0.4.0)
102
+ rubocop-performance (1.20.2)
103
+ rubocop (>= 1.48.1, < 2.0)
104
+ rubocop-ast (>= 1.30.0, < 2.0)
106
105
  ruby-progressbar (1.13.0)
107
106
  ruby2_keywords (0.0.5)
108
- simplecov (0.21.2)
107
+ simplecov (0.22.0)
109
108
  docile (~> 1.1)
110
109
  simplecov-html (~> 0.11)
111
110
  simplecov_json_formatter (~> 0.1)
@@ -114,25 +113,26 @@ GEM
114
113
  simplecov (~> 0.19)
115
114
  simplecov-html (0.12.3)
116
115
  simplecov_json_formatter (0.1.4)
117
- standard (1.32.0)
116
+ standard (1.34.0)
118
117
  language_server-protocol (~> 3.17.0.2)
119
118
  lint_roller (~> 1.0)
120
- rubocop (~> 1.57.2)
119
+ rubocop (~> 1.60)
121
120
  standard-custom (~> 1.0.0)
122
- standard-performance (~> 1.2)
121
+ standard-performance (~> 1.3)
123
122
  standard-custom (1.0.2)
124
123
  lint_roller (~> 1.0)
125
124
  rubocop (~> 1.50)
126
- standard-performance (1.2.1)
125
+ standard-performance (1.3.1)
127
126
  lint_roller (~> 1.1)
128
- rubocop-performance (~> 1.19.1)
127
+ rubocop-performance (~> 1.20.2)
129
128
  unicode-display_width (2.5.0)
130
- webmock (3.19.1)
129
+ webmock (3.23.0)
131
130
  addressable (>= 2.8.0)
132
131
  crack (>= 0.3.2)
133
132
  hashdiff (>= 0.4.0, < 2.0.0)
134
133
 
135
134
  PLATFORMS
135
+ ruby
136
136
  x86_64-darwin-23
137
137
 
138
138
  DEPENDENCIES
@@ -147,7 +147,7 @@ DEPENDENCIES
147
147
  simplecov
148
148
  simplecov-cobertura
149
149
  standard (~> 1.3)
150
- webmock (~> 3.19.1)
150
+ webmock (~> 3.23.0)
151
151
 
152
152
  BUNDLED WITH
153
- 2.4.22
153
+ 2.5.5
data/README.md CHANGED
@@ -1,13 +1,17 @@
1
1
  # Docuseal API Connector
2
2
 
3
+ <a href="https://codecov.io/github/moraki-finance/docuseal" >
4
+ <img src="https://codecov.io/github/moraki-finance/docuseal/graph/badge.svg?token=SKTT14JJGV"/>
5
+ </a>
6
+
7
+ [![Tests](https://github.com/moraki-finance/docuseal/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/moraki-finance/docuseal/actions/workflows/main.yml)
8
+
3
9
  A lightweight API connector for docuseal. Docuseal API docs: https://www.docuseal.co/docs/api
4
10
 
5
11
  :warning: The extracted API objects don't do input parameters validations. It's a simple faraday wrapper that allows you to send as many inputs as you want. The docuseal API might fail when passing a wrong set of parameters.
6
12
 
7
13
  ## Installation
8
14
 
9
- TODO: Replace `docuseal` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
15
  Install the gem and add to the application's Gemfile by executing:
12
16
 
13
17
  $ bundle add docuseal
@@ -86,7 +90,7 @@ Reference: https://www.docuseal.co/docs/api#create-submissions-from-emails
86
90
 
87
91
  ```rb
88
92
  submission = Docuseal::Submission.create(
89
- from: :emails
93
+ from: :emails,
90
94
  template_id: 1000001,
91
95
  emails: 'hi@docuseal.co, example@docuseal.co'
92
96
  )
@@ -171,7 +175,7 @@ template = Docuseal::Template.create(
171
175
  )
172
176
  ```
173
177
 
174
- #### Create From PDf
178
+ #### Create From PDF
175
179
 
176
180
  Reference: https://www.docuseal.co/docs/api#create-a-template-from-existing-pdf
177
181
 
@@ -230,25 +234,17 @@ template = Docuseal::Template.archive(1)
230
234
 
231
235
  ## Development
232
236
 
233
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
234
-
235
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
236
-
237
- You can test any of the endpoints lively if using the following bash command:
237
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment:
238
238
 
239
239
  ```bash
240
- DOCUSEAL_API_KEY={YOUR API KEY} DOCUSEAL_BASE_URI={YOUR BASE URI} bin/console
240
+ $ DOCUSEAL_API_KEY={YOUR API KEY} DOCUSEAL_BASE_URI={YOUR BASE URI} bin/console
241
241
  ```
242
242
 
243
- Then do
244
-
245
- ```bash
246
- irb(main):002> Docuseal::Template.list
247
- ```
243
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
248
244
 
249
245
  ## Contributing
250
246
 
251
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/docuseal. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/docuseal/blob/main/CODE_OF_CONDUCT.md).
247
+ Bug reports and pull requests are welcome on GitHub at https://github.com/moraki-finance/docuseal. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/moraki-finance/docuseal/blob/main/CODE_OF_CONDUCT.md).
252
248
 
253
249
  ## License
254
250
 
@@ -18,7 +18,7 @@ module Docuseal
18
18
  CONFIG_KEYS.each do |key|
19
19
  # Set instance variables like api_type & access_token. Fall back to global config
20
20
  # if not present.
21
- instance_variable_set("@#{key}", Docuseal.configuration.send(key))
21
+ instance_variable_set(:"@#{key}", Docuseal.configuration.send(key))
22
22
  end
23
23
  end
24
24
  end
data/lib/docuseal/http.rb CHANGED
@@ -37,16 +37,12 @@ module Docuseal
37
37
  private
38
38
 
39
39
  def conn
40
- connection = Faraday.new do |f|
40
+ Faraday.new do |f|
41
41
  f.options[:timeout] = request_timeout
42
42
  f.request :json
43
43
  f.response :json
44
44
  f.response :raise_error
45
45
  end
46
-
47
- @faraday_middleware&.call(connection)
48
-
49
- connection
50
46
  end
51
47
 
52
48
  def uri(path:, query: {})
@@ -66,16 +66,18 @@ module Docuseal
66
66
 
67
67
  attrs.each do |key, value|
68
68
  if self.class.skip_coertion_for.include?(key.to_sym)
69
- instance_variable_set("@#{key}", value)
69
+ instance_variable_set(:"@#{key}", value)
70
70
  else
71
71
  coerced_value = if value.is_a?(Hash)
72
72
  Docuseal::Model.new(value)
73
73
  elsif value.is_a?(Array)
74
- value.map { |v| Docuseal::Model.new(v) }
74
+ value.map do |v|
75
+ v.is_a?(Hash) ? Docuseal::Model.new(v) : v
76
+ end
75
77
  else
76
78
  value
77
79
  end
78
- instance_variable_set("@#{key}", coerced_value)
80
+ instance_variable_set(:"@#{key}", coerced_value)
79
81
  end
80
82
  end
81
83
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Docuseal
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docuseal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Mochetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-22 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
- - !ruby/object:Gem::Dependency
28
- name: faraday_middleware
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '1'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '1'
41
27
  description: A lightway, simple and non-official docuseal API connector.
42
28
  email:
43
29
  - martin.mochetti@gmail.com
@@ -48,8 +34,10 @@ files:
48
34
  - ".rspec"
49
35
  - ".ruby-version"
50
36
  - ".standard.yml"
37
+ - ".vscode/settings.json"
51
38
  - CHANGELOG.md
52
39
  - CODE_OF_CONDUCT.md
40
+ - CONTRIBUTING.md
53
41
  - Gemfile
54
42
  - Gemfile.lock
55
43
  - LICENSE.txt