yoti 1.6.2 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -224
- data/lib/yoti.rb +52 -1
- data/lib/yoti/activity_details.rb +1 -0
- data/lib/yoti/client.rb +13 -4
- data/lib/yoti/configuration.rb +7 -2
- data/lib/yoti/data_type/age_verification.rb +1 -1
- data/lib/yoti/data_type/base_profile.rb +1 -1
- data/lib/yoti/data_type/image.rb +4 -12
- data/lib/yoti/data_type/image_jpeg.rb +2 -0
- data/lib/yoti/data_type/image_png.rb +2 -0
- data/lib/yoti/data_type/media.rb +19 -0
- data/lib/yoti/data_type/signed_time_stamp.rb +1 -1
- data/lib/yoti/doc_scan/client.rb +187 -0
- data/lib/yoti/doc_scan/constants.rb +30 -0
- data/lib/yoti/doc_scan/errors.rb +81 -0
- data/lib/yoti/doc_scan/session/create/create_session_result.rb +50 -0
- data/lib/yoti/doc_scan/session/create/document_filter.rb +31 -0
- data/lib/yoti/doc_scan/session/create/document_restrictions_filter.rb +140 -0
- data/lib/yoti/doc_scan/session/create/notification_config.rb +142 -0
- data/lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb +150 -0
- data/lib/yoti/doc_scan/session/create/requested_check.rb +39 -0
- data/lib/yoti/doc_scan/session/create/requested_document_authenticity_check.rb +53 -0
- data/lib/yoti/doc_scan/session/create/requested_face_match_check.rb +95 -0
- data/lib/yoti/doc_scan/session/create/requested_liveness_check.rb +108 -0
- data/lib/yoti/doc_scan/session/create/requested_task.rb +39 -0
- data/lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb +116 -0
- data/lib/yoti/doc_scan/session/create/required_document.rb +31 -0
- data/lib/yoti/doc_scan/session/create/required_id_document.rb +53 -0
- data/lib/yoti/doc_scan/session/create/sdk_config.rb +221 -0
- data/lib/yoti/doc_scan/session/create/session_specification.rb +203 -0
- data/lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb +12 -0
- data/lib/yoti/doc_scan/session/retrieve/breakdown_response.rb +38 -0
- data/lib/yoti/doc_scan/session/retrieve/check_response.rb +63 -0
- data/lib/yoti/doc_scan/session/retrieve/details_response.rb +28 -0
- data/lib/yoti/doc_scan/session/retrieve/document_fields_response.rb +21 -0
- data/lib/yoti/doc_scan/session/retrieve/document_id_photo_response.rb +21 -0
- data/lib/yoti/doc_scan/session/retrieve/face_map_response.rb +21 -0
- data/lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb +12 -0
- data/lib/yoti/doc_scan/session/retrieve/frame_response.rb +21 -0
- data/lib/yoti/doc_scan/session/retrieve/generated_check_response.rb +28 -0
- data/lib/yoti/doc_scan/session/retrieve/generated_media.rb +28 -0
- data/lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb +12 -0
- data/lib/yoti/doc_scan/session/retrieve/get_session_result.rb +113 -0
- data/lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb +57 -0
- data/lib/yoti/doc_scan/session/retrieve/liveness_check_response.rb +12 -0
- data/lib/yoti/doc_scan/session/retrieve/liveness_resource_response.rb +24 -0
- data/lib/yoti/doc_scan/session/retrieve/media_response.rb +38 -0
- data/lib/yoti/doc_scan/session/retrieve/page_response.rb +27 -0
- data/lib/yoti/doc_scan/session/retrieve/recommendation_response.rb +34 -0
- data/lib/yoti/doc_scan/session/retrieve/report_response.rb +31 -0
- data/lib/yoti/doc_scan/session/retrieve/resource_container.rb +50 -0
- data/lib/yoti/doc_scan/session/retrieve/resource_response.rb +39 -0
- data/lib/yoti/doc_scan/session/retrieve/task_response.rb +87 -0
- data/lib/yoti/doc_scan/session/retrieve/text_data_check_response.rb +12 -0
- data/lib/yoti/doc_scan/session/retrieve/text_extraction_task_response.rb +18 -0
- data/lib/yoti/doc_scan/session/retrieve/zoom_liveness_resource_response.rb +33 -0
- data/lib/yoti/doc_scan/support/supported_documents.rb +60 -0
- data/lib/yoti/dynamic_share_service/extension/thirdparty_attribute_extension.rb +62 -11
- data/lib/yoti/dynamic_share_service/policy/dynamic_policy.rb +84 -22
- data/lib/yoti/dynamic_share_service/share_url.rb +28 -33
- data/lib/yoti/errors.rb +15 -2
- data/lib/yoti/http/aml_check_request.rb +12 -6
- data/lib/yoti/http/payloads/aml_address.rb +4 -0
- data/lib/yoti/http/payloads/aml_profile.rb +7 -1
- data/lib/yoti/http/profile_request.rb +11 -6
- data/lib/yoti/http/request.rb +221 -18
- data/lib/yoti/http/signed_request.rb +13 -4
- data/lib/yoti/protobuf/main.rb +1 -1
- data/lib/yoti/ssl.rb +2 -2
- data/lib/yoti/util/anchor_processor.rb +1 -1
- data/lib/yoti/util/validation.rb +41 -0
- data/lib/yoti/version.rb +1 -1
- data/yoti.gemspec +18 -9
- metadata +55 -68
- data/.gitignore +0 -39
- data/CONTRIBUTING.md +0 -127
- data/Guardfile +0 -11
- data/Rakefile +0 -49
- data/lib/yoti/sandbox.rb +0 -4
- data/lib/yoti/sandbox/anchor.rb +0 -49
- data/lib/yoti/sandbox/attribute.rb +0 -52
- data/lib/yoti/sandbox/profile.rb +0 -171
- data/lib/yoti/sandbox/sandbox_client.rb +0 -40
- data/login_flow.png +0 -0
- data/rubocop.yml +0 -57
- data/yardstick.yml +0 -9
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Yoti
|
4
|
+
class Validation
|
5
|
+
#
|
6
|
+
# @param value
|
7
|
+
# @param [String] name
|
8
|
+
#
|
9
|
+
def self.assert_not_nil(value, name)
|
10
|
+
return unless value.nil?
|
11
|
+
|
12
|
+
raise(ArgumentError, "#{name} must not be nil")
|
13
|
+
end
|
14
|
+
|
15
|
+
#
|
16
|
+
# @param [Class] type
|
17
|
+
# @param value
|
18
|
+
# @param [String] name
|
19
|
+
# @param [Boolean] nilable
|
20
|
+
#
|
21
|
+
def self.assert_is_a(type, value, name, nilable = false)
|
22
|
+
return if nilable && value.nil?
|
23
|
+
return if value.is_a?(type)
|
24
|
+
|
25
|
+
raise(ArgumentError, "#{name} must be a #{type.name}")
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# @param [Symbol] method
|
30
|
+
# @param value
|
31
|
+
# @param [String] name
|
32
|
+
#
|
33
|
+
def self.assert_respond_to(method, value, name)
|
34
|
+
assert_not_nil(value, name)
|
35
|
+
|
36
|
+
return if value.respond_to?(method)
|
37
|
+
|
38
|
+
raise(ArgumentError, "#{name} must respond to #{method}")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/yoti/version.rb
CHANGED
data/yoti.gemspec
CHANGED
@@ -5,8 +5,8 @@ require 'yoti/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'yoti'
|
7
7
|
spec.version = Yoti::VERSION
|
8
|
-
spec.authors = ['
|
9
|
-
spec.email = ['
|
8
|
+
spec.authors = ['Yoti']
|
9
|
+
spec.email = ['websdk@yoti.com']
|
10
10
|
|
11
11
|
spec.summary = 'Yoti Ruby SDK for back-end integration.'
|
12
12
|
spec.description = <<-DESC
|
@@ -18,22 +18,31 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.homepage = 'https://github.com/getyoti/yoti-ruby-sdk'
|
19
19
|
spec.license = 'MIT'
|
20
20
|
|
21
|
-
|
21
|
+
exclude_patterns = [
|
22
|
+
'^(test|spec|features|examples|docs|.github)/',
|
23
|
+
'^.gitignore$',
|
24
|
+
'^sonar-project.properties$',
|
25
|
+
'^.dependabot/config.yml$',
|
26
|
+
'^.travis.yml$',
|
27
|
+
'^CONTRIBUTING.md$',
|
28
|
+
'^Guardfile$',
|
29
|
+
'^Rakefile$',
|
30
|
+
'^yardstick.yml$',
|
31
|
+
'^rubocop.yml$'
|
32
|
+
]
|
33
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/#{exclude_patterns.join('|')}/) }
|
22
34
|
spec.require_paths = ['lib']
|
23
35
|
|
24
36
|
spec.required_ruby_version = '>= 2.4'
|
25
37
|
|
26
|
-
spec.add_dependency '
|
27
|
-
spec.add_dependency 'google-protobuf', '~> 3.7', '>= 3.7.0'
|
28
|
-
spec.add_dependency 'protobuf', '~> 3.6'
|
38
|
+
spec.add_dependency 'google-protobuf', '~> 3.7'
|
29
39
|
|
30
40
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
|
-
spec.add_development_dependency 'coveralls', '~> 0.8'
|
32
41
|
spec.add_development_dependency 'dotenv', '~> 2.2'
|
33
42
|
spec.add_development_dependency 'generator_spec', '~> 0.9'
|
34
|
-
spec.add_development_dependency 'rake', '~>
|
43
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
35
44
|
spec.add_development_dependency 'rspec', '~> 3.5'
|
36
|
-
spec.add_development_dependency 'simplecov', '~> 0.
|
45
|
+
spec.add_development_dependency 'simplecov', '~> 0.17.1'
|
37
46
|
spec.add_development_dependency 'webmock', '~> 3.3'
|
38
47
|
spec.add_development_dependency 'yard', '~> 0.9'
|
39
48
|
spec.add_development_dependency 'yardstick', '~> 0.9'
|
metadata
CHANGED
@@ -1,36 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yoti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Yoti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: activesupport
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '5.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '5.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: google-protobuf
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 3.7.0
|
34
17
|
- - "~>"
|
35
18
|
- !ruby/object:Gem::Version
|
36
19
|
version: '3.7'
|
@@ -38,26 +21,9 @@ dependencies:
|
|
38
21
|
prerelease: false
|
39
22
|
version_requirements: !ruby/object:Gem::Requirement
|
40
23
|
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 3.7.0
|
44
24
|
- - "~>"
|
45
25
|
- !ruby/object:Gem::Version
|
46
26
|
version: '3.7'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: protobuf
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '3.6'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '3.6'
|
61
27
|
- !ruby/object:Gem::Dependency
|
62
28
|
name: bundler
|
63
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,20 +38,6 @@ dependencies:
|
|
72
38
|
- - "~>"
|
73
39
|
- !ruby/object:Gem::Version
|
74
40
|
version: '2.0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: coveralls
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0.8'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0.8'
|
89
41
|
- !ruby/object:Gem::Dependency
|
90
42
|
name: dotenv
|
91
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,14 +72,14 @@ dependencies:
|
|
120
72
|
requirements:
|
121
73
|
- - "~>"
|
122
74
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
75
|
+
version: '13.0'
|
124
76
|
type: :development
|
125
77
|
prerelease: false
|
126
78
|
version_requirements: !ruby/object:Gem::Requirement
|
127
79
|
requirements:
|
128
80
|
- - "~>"
|
129
81
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
82
|
+
version: '13.0'
|
131
83
|
- !ruby/object:Gem::Dependency
|
132
84
|
name: rspec
|
133
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,14 +100,14 @@ dependencies:
|
|
148
100
|
requirements:
|
149
101
|
- - "~>"
|
150
102
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
103
|
+
version: 0.17.1
|
152
104
|
type: :development
|
153
105
|
prerelease: false
|
154
106
|
version_requirements: !ruby/object:Gem::Requirement
|
155
107
|
requirements:
|
156
108
|
- - "~>"
|
157
109
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
110
|
+
version: 0.17.1
|
159
111
|
- !ruby/object:Gem::Dependency
|
160
112
|
name: webmock
|
161
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -203,18 +155,14 @@ description: |2
|
|
203
155
|
with Yoti, so that your users can share their identity details with your
|
204
156
|
application in a secure and trusted way.
|
205
157
|
email:
|
206
|
-
-
|
158
|
+
- websdk@yoti.com
|
207
159
|
executables: []
|
208
160
|
extensions: []
|
209
161
|
extra_rdoc_files: []
|
210
162
|
files:
|
211
|
-
- ".gitignore"
|
212
|
-
- CONTRIBUTING.md
|
213
163
|
- Gemfile
|
214
|
-
- Guardfile
|
215
164
|
- LICENSE.md
|
216
165
|
- README.md
|
217
|
-
- Rakefile
|
218
166
|
- lib/generators/yoti/install/install_generator.rb
|
219
167
|
- lib/generators/yoti/install/templates/yoti.rb
|
220
168
|
- lib/yoti.rb
|
@@ -230,9 +178,55 @@ files:
|
|
230
178
|
- lib/yoti/data_type/image.rb
|
231
179
|
- lib/yoti/data_type/image_jpeg.rb
|
232
180
|
- lib/yoti/data_type/image_png.rb
|
181
|
+
- lib/yoti/data_type/media.rb
|
233
182
|
- lib/yoti/data_type/multi_value.rb
|
234
183
|
- lib/yoti/data_type/profile.rb
|
235
184
|
- lib/yoti/data_type/signed_time_stamp.rb
|
185
|
+
- lib/yoti/doc_scan/client.rb
|
186
|
+
- lib/yoti/doc_scan/constants.rb
|
187
|
+
- lib/yoti/doc_scan/errors.rb
|
188
|
+
- lib/yoti/doc_scan/session/create/create_session_result.rb
|
189
|
+
- lib/yoti/doc_scan/session/create/document_filter.rb
|
190
|
+
- lib/yoti/doc_scan/session/create/document_restrictions_filter.rb
|
191
|
+
- lib/yoti/doc_scan/session/create/notification_config.rb
|
192
|
+
- lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb
|
193
|
+
- lib/yoti/doc_scan/session/create/requested_check.rb
|
194
|
+
- lib/yoti/doc_scan/session/create/requested_document_authenticity_check.rb
|
195
|
+
- lib/yoti/doc_scan/session/create/requested_face_match_check.rb
|
196
|
+
- lib/yoti/doc_scan/session/create/requested_liveness_check.rb
|
197
|
+
- lib/yoti/doc_scan/session/create/requested_task.rb
|
198
|
+
- lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb
|
199
|
+
- lib/yoti/doc_scan/session/create/required_document.rb
|
200
|
+
- lib/yoti/doc_scan/session/create/required_id_document.rb
|
201
|
+
- lib/yoti/doc_scan/session/create/sdk_config.rb
|
202
|
+
- lib/yoti/doc_scan/session/create/session_specification.rb
|
203
|
+
- lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb
|
204
|
+
- lib/yoti/doc_scan/session/retrieve/breakdown_response.rb
|
205
|
+
- lib/yoti/doc_scan/session/retrieve/check_response.rb
|
206
|
+
- lib/yoti/doc_scan/session/retrieve/details_response.rb
|
207
|
+
- lib/yoti/doc_scan/session/retrieve/document_fields_response.rb
|
208
|
+
- lib/yoti/doc_scan/session/retrieve/document_id_photo_response.rb
|
209
|
+
- lib/yoti/doc_scan/session/retrieve/face_map_response.rb
|
210
|
+
- lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb
|
211
|
+
- lib/yoti/doc_scan/session/retrieve/frame_response.rb
|
212
|
+
- lib/yoti/doc_scan/session/retrieve/generated_check_response.rb
|
213
|
+
- lib/yoti/doc_scan/session/retrieve/generated_media.rb
|
214
|
+
- lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb
|
215
|
+
- lib/yoti/doc_scan/session/retrieve/get_session_result.rb
|
216
|
+
- lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb
|
217
|
+
- lib/yoti/doc_scan/session/retrieve/liveness_check_response.rb
|
218
|
+
- lib/yoti/doc_scan/session/retrieve/liveness_resource_response.rb
|
219
|
+
- lib/yoti/doc_scan/session/retrieve/media_response.rb
|
220
|
+
- lib/yoti/doc_scan/session/retrieve/page_response.rb
|
221
|
+
- lib/yoti/doc_scan/session/retrieve/recommendation_response.rb
|
222
|
+
- lib/yoti/doc_scan/session/retrieve/report_response.rb
|
223
|
+
- lib/yoti/doc_scan/session/retrieve/resource_container.rb
|
224
|
+
- lib/yoti/doc_scan/session/retrieve/resource_response.rb
|
225
|
+
- lib/yoti/doc_scan/session/retrieve/task_response.rb
|
226
|
+
- lib/yoti/doc_scan/session/retrieve/text_data_check_response.rb
|
227
|
+
- lib/yoti/doc_scan/session/retrieve/text_extraction_task_response.rb
|
228
|
+
- lib/yoti/doc_scan/session/retrieve/zoom_liveness_resource_response.rb
|
229
|
+
- lib/yoti/doc_scan/support/supported_documents.rb
|
236
230
|
- lib/yoti/dynamic_share_service/dynamic_scenario.rb
|
237
231
|
- lib/yoti/dynamic_share_service/extension/extension.rb
|
238
232
|
- lib/yoti/dynamic_share_service/extension/location_constraint_extension.rb
|
@@ -261,21 +255,14 @@ files:
|
|
261
255
|
- lib/yoti/protobuf/sharepubapi/ExtraData_pb.rb
|
262
256
|
- lib/yoti/protobuf/sharepubapi/IssuingAttributes_pb.rb
|
263
257
|
- lib/yoti/protobuf/sharepubapi/ThirdPartyAttribute_pb.rb
|
264
|
-
- lib/yoti/sandbox.rb
|
265
|
-
- lib/yoti/sandbox/anchor.rb
|
266
|
-
- lib/yoti/sandbox/attribute.rb
|
267
|
-
- lib/yoti/sandbox/profile.rb
|
268
|
-
- lib/yoti/sandbox/sandbox_client.rb
|
269
258
|
- lib/yoti/share/attribute_issuance_details.rb
|
270
259
|
- lib/yoti/share/extra_data.rb
|
271
260
|
- lib/yoti/ssl.rb
|
272
261
|
- lib/yoti/util/age_processor.rb
|
273
262
|
- lib/yoti/util/anchor_processor.rb
|
274
263
|
- lib/yoti/util/log.rb
|
264
|
+
- lib/yoti/util/validation.rb
|
275
265
|
- lib/yoti/version.rb
|
276
|
-
- login_flow.png
|
277
|
-
- rubocop.yml
|
278
|
-
- yardstick.yml
|
279
266
|
- yoti.gemspec
|
280
267
|
homepage: https://github.com/getyoti/yoti-ruby-sdk
|
281
268
|
licenses:
|
data/.gitignore
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/spec/examples.txt
|
9
|
-
/test/tmp/
|
10
|
-
/test/version_tmp/
|
11
|
-
/tmp/
|
12
|
-
|
13
|
-
# Used by dotenv library to load environment variables.
|
14
|
-
.env
|
15
|
-
|
16
|
-
## Documentation cache and generated files:
|
17
|
-
/.yardoc/
|
18
|
-
/_yardoc/
|
19
|
-
/doc/
|
20
|
-
/rdoc/
|
21
|
-
|
22
|
-
## Environment normalization:
|
23
|
-
/.bundle/
|
24
|
-
/vendor/bundle
|
25
|
-
/lib/bundler/man/
|
26
|
-
|
27
|
-
# for a library or gem, you might want to ignore these files since the code is
|
28
|
-
# intended to run in multiple environments; otherwise, check them in:
|
29
|
-
Gemfile.lock
|
30
|
-
.ruby-version
|
31
|
-
.ruby-gemset
|
32
|
-
|
33
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
-
.rvmrc
|
35
|
-
|
36
|
-
# Ignore Yardstick measurement files
|
37
|
-
/measurement
|
38
|
-
examples/rails/public/*.jpeg
|
39
|
-
examples/sinatra/public/*.jpeg
|
data/CONTRIBUTING.md
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake spec` to run the tests. To install this gem onto your local machine, run `bundle exec rake install`.
|
4
|
-
|
5
|
-
You can use [Guard][] to automatically run the tests every time a file in the `lib` or `spec` folder changes.
|
6
|
-
|
7
|
-
Run Guard through Bundler with:
|
8
|
-
|
9
|
-
```shell
|
10
|
-
bundle exec guard
|
11
|
-
```
|
12
|
-
|
13
|
-
[Guard]: https://github.com/guard/guard
|
14
|
-
|
15
|
-
## Dependencies
|
16
|
-
|
17
|
-
Although this gem supports Ruby 2.0.0, in order to use the latest development dependencies you have to use at least Ruby 2.2.2.
|
18
|
-
|
19
|
-
If you wish to compile `.proto` definitions to Ruby, you will need to install [Google's Protocol Buffers](http://code.google.com/p/protobuf).
|
20
|
-
|
21
|
-
### OSX
|
22
|
-
|
23
|
-
```shell
|
24
|
-
brew install protobuf
|
25
|
-
```
|
26
|
-
|
27
|
-
### Ubuntu
|
28
|
-
|
29
|
-
```shell
|
30
|
-
sudo apt-get install -y protobuf
|
31
|
-
```
|
32
|
-
|
33
|
-
This gem relies heavily on the [Ruby Protobuf][] gem. For more information on how Google Protobuf works, please see the [Wiki pages][].
|
34
|
-
|
35
|
-
Compiling the common and attribute `.proto` definitions can be done with the following commands:
|
36
|
-
|
37
|
-
```shell
|
38
|
-
cd lib/yoti/protobuf/v1
|
39
|
-
protoc -I definitions/attribute-public-api/attrpubapi_v1 --ruby_out ./attribute_public_api definitions/attribute-public-api/attrpubapi_v1/*.proto
|
40
|
-
protoc -I definitions/common-public-api/compubapi_v1/ --ruby_out ./common_public_api definitions/common-public-api/compubapi_v1/*.proto
|
41
|
-
```
|
42
|
-
|
43
|
-
These commands will overwrite the current protobuf Ruby modules, which have been modified. If the protobuf files have to be updated, a good idea would be to change them manually, or generate the files in a new location, and compare the content.
|
44
|
-
|
45
|
-
[Ruby Protobuf]: https://github.com/ruby-protobuf/protobuf/
|
46
|
-
[Wiki Pages]: https://github.com/ruby-protobuf/protobuf/wiki
|
47
|
-
|
48
|
-
## Requirements
|
49
|
-
|
50
|
-
### Code coverage
|
51
|
-
|
52
|
-
The 100% code coverage requirement must be met before submitting new code.
|
53
|
-
This can be checked by opening the generated [SimpleCov][] files:
|
54
|
-
|
55
|
-
```shell
|
56
|
-
open coverage/index.html
|
57
|
-
```
|
58
|
-
|
59
|
-
### Style guide
|
60
|
-
|
61
|
-
The Ruby style guide is configured in the [rubocop.yml](rubocop.yml) file and can be checked by running:
|
62
|
-
|
63
|
-
```shell
|
64
|
-
bundle exec rake rubocop
|
65
|
-
```
|
66
|
-
|
67
|
-
### Documentation
|
68
|
-
|
69
|
-
The documentation uses the [Yard][] format. Please ensure all new classes and methods are fully documented.
|
70
|
-
|
71
|
-
There are a few Rake tasks to handle documentation:
|
72
|
-
|
73
|
-
```shell
|
74
|
-
bundle exec rake measurement
|
75
|
-
```
|
76
|
-
|
77
|
-
Verifies the documentation with [Yardstick][] and generates the `measurement/report.txt` file, containing tips on how to improve the documentation coverage.
|
78
|
-
|
79
|
-
```shell
|
80
|
-
bundle exec rake yard
|
81
|
-
```
|
82
|
-
|
83
|
-
Generates [YARD][] documentation in the doc folder.
|
84
|
-
|
85
|
-
### Git
|
86
|
-
|
87
|
-
Commit messages should ideally start with one of the following verbs:
|
88
|
-
|
89
|
-
* Add
|
90
|
-
* Merge
|
91
|
-
* Fix
|
92
|
-
* Remove
|
93
|
-
* Improve
|
94
|
-
* Use
|
95
|
-
|
96
|
-
[SimpleCov]: https://github.com/colszowka/simplecov
|
97
|
-
[Yard]: http://yardoc.org/
|
98
|
-
[Yardstick]: https://github.com/dkubb/yardstick
|
99
|
-
|
100
|
-
## Publishing a new release
|
101
|
-
|
102
|
-
* Create a new release on [GitHub](https://github.com/getyoti/yoti-ruby-sdk/releases)
|
103
|
-
* Build the gem and push it to [RubyGems](https://rubygems.org/gems/yoti)
|
104
|
-
|
105
|
-
```shell
|
106
|
-
rake build
|
107
|
-
gem push pkg/yoti-[version].gem
|
108
|
-
```
|
109
|
-
|
110
|
-
## Submitting a pull request
|
111
|
-
|
112
|
-
1. [Fork the repository.][fork]
|
113
|
-
2. [Create a topic branch.][branch]
|
114
|
-
3. Add specs for your unimplemented feature or bug fix.
|
115
|
-
4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
|
116
|
-
5. Implement your feature or bug fix.
|
117
|
-
6. Run `bundle exec rake`. If your specs fail, return to step 5.
|
118
|
-
7. Run `open coverage/index.html`. If your changes are not completely covered
|
119
|
-
by your tests, return to step 3.
|
120
|
-
8. If Rubocop warns you about styling errors, correct them based on the guidelines and run `bundle exec rake rubocop` to make sure all offences are gone.
|
121
|
-
9. Add documentation for your feature or bug fix.
|
122
|
-
10. Commit and push your changes.
|
123
|
-
11. [Submit a pull request.][pr]
|
124
|
-
|
125
|
-
[fork]: http://help.github.com/fork-a-repo/
|
126
|
-
[branch]: http://learn.github.com/p/branching.html
|
127
|
-
[pr]: http://help.github.com/send-pull-requests/
|