yoti 1.6.3 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -224
  3. data/lib/yoti.rb +54 -1
  4. data/lib/yoti/client.rb +13 -4
  5. data/lib/yoti/configuration.rb +7 -2
  6. data/lib/yoti/data_type/age_verification.rb +1 -1
  7. data/lib/yoti/data_type/base_profile.rb +1 -1
  8. data/lib/yoti/data_type/image.rb +4 -12
  9. data/lib/yoti/data_type/image_jpeg.rb +2 -0
  10. data/lib/yoti/data_type/image_png.rb +2 -0
  11. data/lib/yoti/data_type/media.rb +19 -0
  12. data/lib/yoti/data_type/signed_time_stamp.rb +1 -1
  13. data/lib/yoti/doc_scan/client.rb +187 -0
  14. data/lib/yoti/doc_scan/constants.rb +31 -0
  15. data/lib/yoti/doc_scan/errors.rb +81 -0
  16. data/lib/yoti/doc_scan/session/create/create_session_result.rb +50 -0
  17. data/lib/yoti/doc_scan/session/create/document_filter.rb +31 -0
  18. data/lib/yoti/doc_scan/session/create/document_restrictions_filter.rb +140 -0
  19. data/lib/yoti/doc_scan/session/create/notification_config.rb +142 -0
  20. data/lib/yoti/doc_scan/session/create/orthogonal_restrictions_filter.rb +150 -0
  21. data/lib/yoti/doc_scan/session/create/requested_check.rb +39 -0
  22. data/lib/yoti/doc_scan/session/create/requested_document_authenticity_check.rb +95 -0
  23. data/lib/yoti/doc_scan/session/create/requested_face_match_check.rb +95 -0
  24. data/lib/yoti/doc_scan/session/create/requested_id_document_comparison_check.rb +53 -0
  25. data/lib/yoti/doc_scan/session/create/requested_liveness_check.rb +108 -0
  26. data/lib/yoti/doc_scan/session/create/requested_task.rb +39 -0
  27. data/lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb +116 -0
  28. data/lib/yoti/doc_scan/session/create/required_document.rb +31 -0
  29. data/lib/yoti/doc_scan/session/create/required_id_document.rb +53 -0
  30. data/lib/yoti/doc_scan/session/create/sdk_config.rb +221 -0
  31. data/lib/yoti/doc_scan/session/create/session_specification.rb +221 -0
  32. data/lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb +12 -0
  33. data/lib/yoti/doc_scan/session/retrieve/breakdown_response.rb +38 -0
  34. data/lib/yoti/doc_scan/session/retrieve/check_response.rb +63 -0
  35. data/lib/yoti/doc_scan/session/retrieve/details_response.rb +28 -0
  36. data/lib/yoti/doc_scan/session/retrieve/document_fields_response.rb +21 -0
  37. data/lib/yoti/doc_scan/session/retrieve/document_id_photo_response.rb +21 -0
  38. data/lib/yoti/doc_scan/session/retrieve/face_map_response.rb +21 -0
  39. data/lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb +12 -0
  40. data/lib/yoti/doc_scan/session/retrieve/frame_response.rb +21 -0
  41. data/lib/yoti/doc_scan/session/retrieve/generated_check_response.rb +28 -0
  42. data/lib/yoti/doc_scan/session/retrieve/generated_media.rb +28 -0
  43. data/lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb +12 -0
  44. data/lib/yoti/doc_scan/session/retrieve/get_session_result.rb +127 -0
  45. data/lib/yoti/doc_scan/session/retrieve/id_document_comparison_check_response.rb +12 -0
  46. data/lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb +57 -0
  47. data/lib/yoti/doc_scan/session/retrieve/liveness_check_response.rb +12 -0
  48. data/lib/yoti/doc_scan/session/retrieve/liveness_resource_response.rb +24 -0
  49. data/lib/yoti/doc_scan/session/retrieve/media_response.rb +38 -0
  50. data/lib/yoti/doc_scan/session/retrieve/page_response.rb +27 -0
  51. data/lib/yoti/doc_scan/session/retrieve/recommendation_response.rb +34 -0
  52. data/lib/yoti/doc_scan/session/retrieve/report_response.rb +31 -0
  53. data/lib/yoti/doc_scan/session/retrieve/resource_container.rb +50 -0
  54. data/lib/yoti/doc_scan/session/retrieve/resource_response.rb +39 -0
  55. data/lib/yoti/doc_scan/session/retrieve/task_response.rb +87 -0
  56. data/lib/yoti/doc_scan/session/retrieve/text_data_check_response.rb +12 -0
  57. data/lib/yoti/doc_scan/session/retrieve/text_extraction_task_response.rb +18 -0
  58. data/lib/yoti/doc_scan/session/retrieve/zoom_liveness_resource_response.rb +33 -0
  59. data/lib/yoti/doc_scan/support/supported_documents.rb +60 -0
  60. data/lib/yoti/dynamic_share_service/extension/thirdparty_attribute_extension.rb +62 -11
  61. data/lib/yoti/dynamic_share_service/policy/dynamic_policy.rb +84 -22
  62. data/lib/yoti/dynamic_share_service/share_url.rb +28 -33
  63. data/lib/yoti/errors.rb +15 -2
  64. data/lib/yoti/http/aml_check_request.rb +12 -6
  65. data/lib/yoti/http/payloads/aml_address.rb +4 -0
  66. data/lib/yoti/http/payloads/aml_profile.rb +7 -1
  67. data/lib/yoti/http/profile_request.rb +11 -6
  68. data/lib/yoti/http/request.rb +221 -18
  69. data/lib/yoti/http/signed_request.rb +13 -4
  70. data/lib/yoti/protobuf/main.rb +1 -1
  71. data/lib/yoti/ssl.rb +2 -2
  72. data/lib/yoti/util/anchor_processor.rb +1 -1
  73. data/lib/yoti/util/validation.rb +41 -0
  74. data/lib/yoti/version.rb +1 -1
  75. data/yoti.gemspec +19 -9
  76. metadata +60 -67
  77. data/.github/ISSUE_TEMPLATE.md +0 -17
  78. data/.gitignore +0 -39
  79. data/CONTRIBUTING.md +0 -127
  80. data/Guardfile +0 -11
  81. data/Rakefile +0 -49
  82. data/login_flow.png +0 -0
  83. data/rubocop.yml +0 -57
  84. data/yardstick.yml +0 -9
@@ -94,7 +94,7 @@ module Yoti
94
94
  proto_multi_value = Yoti::Protobuf::Attrpubapi::MultiValue.decode(value)
95
95
  items = []
96
96
  proto_multi_value.values.each do |item|
97
- items.append value_based_on_content_type(item.data, item.content_type)
97
+ items << value_based_on_content_type(item.data, item.content_type)
98
98
  end
99
99
  MultiValue.new(items)
100
100
  end
@@ -32,7 +32,7 @@ module Yoti
32
32
  end
33
33
 
34
34
  # Extracts the public key from pem key, converts it to a DER base 64 encoded value
35
- # @return [String] base 64 encoded anthentication key
35
+ # @return [String] base 64 encoded authentication key
36
36
  def auth_key_from_pem
37
37
  public_key = private_key.public_key
38
38
  Base64.strict_encode64(public_key.to_der)
@@ -48,7 +48,7 @@ module Yoti
48
48
 
49
49
  # Uses the decrypted receipt key and the current user's iv to decode the text
50
50
  # @param key [String] base 64 decoded key
51
- # @param iv [String] base 64 decoded iv
51
+ # @param user_iv [String] base 64 decoded iv
52
52
  # @param text [String] base 64 decoded cyphered text
53
53
  # @return [String] base 64 decoded deciphered text
54
54
  def decipher(key, user_iv, text)
@@ -7,7 +7,7 @@ module Yoti
7
7
  #
8
8
  class AnchorProcessor
9
9
  #
10
- # @param [Array<Yoti::Protobuf::Attrpubapi::Anchor>]
10
+ # @param [Array<Yoti::Protobuf::Attrpubapi::Anchor>] anchors_list
11
11
  #
12
12
  def initialize(anchors_list)
13
13
  @anchors_list = anchors_list
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Yoti
2
2
  # @return [String] the gem's current version
3
- VERSION = '1.6.3'.freeze
3
+ VERSION = '1.9.0'.freeze
4
4
  end
@@ -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 = ['Sebastian Zaremba']
9
- spec.email = ['tech@yoti.com']
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,32 @@ Gem::Specification.new do |spec|
18
18
  spec.homepage = 'https://github.com/getyoti/yoti-ruby-sdk'
19
19
  spec.license = 'MIT'
20
20
 
21
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|examples)/|^sonar-project.properties$|^.dependabot/config.yml$|^.travis.yml$}) }
21
+ exclude_patterns = [
22
+ '^(test|spec|features|examples|docs|.github)/',
23
+ '^.gitignore$',
24
+ '^.pre-commit-config.yaml$',
25
+ '^sonar-project.properties$',
26
+ '^.dependabot/config.yml$',
27
+ '^.travis.yml$',
28
+ '^CONTRIBUTING.md$',
29
+ '^Guardfile$',
30
+ '^Rakefile$',
31
+ '^yardstick.yml$',
32
+ '^rubocop.yml$'
33
+ ]
34
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/#{exclude_patterns.join('|')}/) }
22
35
  spec.require_paths = ['lib']
23
36
 
24
37
  spec.required_ruby_version = '>= 2.4'
25
38
 
26
- spec.add_dependency 'activesupport', '~> 5.0' # Pin activesupport library to 5.x for Ruby 2.4 support
27
- spec.add_dependency 'google-protobuf', '~> 3.7', '>= 3.7.0'
28
- spec.add_dependency 'protobuf', '~> 3.6'
39
+ spec.add_dependency 'google-protobuf', '~> 3.7'
29
40
 
30
41
  spec.add_development_dependency 'bundler', '~> 2.0'
31
- spec.add_development_dependency 'coveralls', '~> 0.8'
32
42
  spec.add_development_dependency 'dotenv', '~> 2.2'
33
43
  spec.add_development_dependency 'generator_spec', '~> 0.9'
34
- spec.add_development_dependency 'rake', '~> 12.0'
44
+ spec.add_development_dependency 'rake', '~> 13.0'
35
45
  spec.add_development_dependency 'rspec', '~> 3.5'
36
- spec.add_development_dependency 'simplecov', '~> 0.13'
46
+ spec.add_development_dependency 'simplecov', '~> 0.17.1'
37
47
  spec.add_development_dependency 'webmock', '~> 3.3'
38
48
  spec.add_development_dependency 'yard', '~> 0.9'
39
49
  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.6.3
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
- - Sebastian Zaremba
8
- autorequire:
7
+ - Yoti
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-06 00:00:00.000000000 Z
11
+ date: 2020-09-21 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: '12.0'
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: '12.0'
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: '0.13'
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: '0.13'
110
+ version: 0.17.1
159
111
  - !ruby/object:Gem::Dependency
160
112
  name: webmock
161
113
  requirement: !ruby/object:Gem::Requirement
@@ -203,19 +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
- - tech@yoti.com
158
+ - websdk@yoti.com
207
159
  executables: []
208
160
  extensions: []
209
161
  extra_rdoc_files: []
210
162
  files:
211
- - ".github/ISSUE_TEMPLATE.md"
212
- - ".gitignore"
213
- - CONTRIBUTING.md
214
163
  - Gemfile
215
- - Guardfile
216
164
  - LICENSE.md
217
165
  - README.md
218
- - Rakefile
219
166
  - lib/generators/yoti/install/install_generator.rb
220
167
  - lib/generators/yoti/install/templates/yoti.rb
221
168
  - lib/yoti.rb
@@ -231,9 +178,57 @@ files:
231
178
  - lib/yoti/data_type/image.rb
232
179
  - lib/yoti/data_type/image_jpeg.rb
233
180
  - lib/yoti/data_type/image_png.rb
181
+ - lib/yoti/data_type/media.rb
234
182
  - lib/yoti/data_type/multi_value.rb
235
183
  - lib/yoti/data_type/profile.rb
236
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_id_document_comparison_check.rb
197
+ - lib/yoti/doc_scan/session/create/requested_liveness_check.rb
198
+ - lib/yoti/doc_scan/session/create/requested_task.rb
199
+ - lib/yoti/doc_scan/session/create/requested_text_extraction_task.rb
200
+ - lib/yoti/doc_scan/session/create/required_document.rb
201
+ - lib/yoti/doc_scan/session/create/required_id_document.rb
202
+ - lib/yoti/doc_scan/session/create/sdk_config.rb
203
+ - lib/yoti/doc_scan/session/create/session_specification.rb
204
+ - lib/yoti/doc_scan/session/retrieve/authenticity_check_response.rb
205
+ - lib/yoti/doc_scan/session/retrieve/breakdown_response.rb
206
+ - lib/yoti/doc_scan/session/retrieve/check_response.rb
207
+ - lib/yoti/doc_scan/session/retrieve/details_response.rb
208
+ - lib/yoti/doc_scan/session/retrieve/document_fields_response.rb
209
+ - lib/yoti/doc_scan/session/retrieve/document_id_photo_response.rb
210
+ - lib/yoti/doc_scan/session/retrieve/face_map_response.rb
211
+ - lib/yoti/doc_scan/session/retrieve/face_match_check_response.rb
212
+ - lib/yoti/doc_scan/session/retrieve/frame_response.rb
213
+ - lib/yoti/doc_scan/session/retrieve/generated_check_response.rb
214
+ - lib/yoti/doc_scan/session/retrieve/generated_media.rb
215
+ - lib/yoti/doc_scan/session/retrieve/generated_text_data_check_response.rb
216
+ - lib/yoti/doc_scan/session/retrieve/get_session_result.rb
217
+ - lib/yoti/doc_scan/session/retrieve/id_document_comparison_check_response.rb
218
+ - lib/yoti/doc_scan/session/retrieve/id_document_resource_response.rb
219
+ - lib/yoti/doc_scan/session/retrieve/liveness_check_response.rb
220
+ - lib/yoti/doc_scan/session/retrieve/liveness_resource_response.rb
221
+ - lib/yoti/doc_scan/session/retrieve/media_response.rb
222
+ - lib/yoti/doc_scan/session/retrieve/page_response.rb
223
+ - lib/yoti/doc_scan/session/retrieve/recommendation_response.rb
224
+ - lib/yoti/doc_scan/session/retrieve/report_response.rb
225
+ - lib/yoti/doc_scan/session/retrieve/resource_container.rb
226
+ - lib/yoti/doc_scan/session/retrieve/resource_response.rb
227
+ - lib/yoti/doc_scan/session/retrieve/task_response.rb
228
+ - lib/yoti/doc_scan/session/retrieve/text_data_check_response.rb
229
+ - lib/yoti/doc_scan/session/retrieve/text_extraction_task_response.rb
230
+ - lib/yoti/doc_scan/session/retrieve/zoom_liveness_resource_response.rb
231
+ - lib/yoti/doc_scan/support/supported_documents.rb
237
232
  - lib/yoti/dynamic_share_service/dynamic_scenario.rb
238
233
  - lib/yoti/dynamic_share_service/extension/extension.rb
239
234
  - lib/yoti/dynamic_share_service/extension/location_constraint_extension.rb
@@ -268,16 +263,14 @@ files:
268
263
  - lib/yoti/util/age_processor.rb
269
264
  - lib/yoti/util/anchor_processor.rb
270
265
  - lib/yoti/util/log.rb
266
+ - lib/yoti/util/validation.rb
271
267
  - lib/yoti/version.rb
272
- - login_flow.png
273
- - rubocop.yml
274
- - yardstick.yml
275
268
  - yoti.gemspec
276
269
  homepage: https://github.com/getyoti/yoti-ruby-sdk
277
270
  licenses:
278
271
  - MIT
279
272
  metadata: {}
280
- post_install_message:
273
+ post_install_message:
281
274
  rdoc_options: []
282
275
  require_paths:
283
276
  - lib
@@ -293,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
286
  version: '0'
294
287
  requirements: []
295
288
  rubygems_version: 3.0.6
296
- signing_key:
289
+ signing_key:
297
290
  specification_version: 4
298
291
  summary: Yoti Ruby SDK for back-end integration.
299
292
  test_files: []
@@ -1,17 +0,0 @@
1
- ---
2
- name: Custom issue template
3
- about: " There's a better way to get help!"
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- #
11
- # Wait ✋
12
- #
13
- # There's a better way to get help!
14
- #
15
- # Send your questions or issues to sdksupport@yoti.com
16
- #
17
- #
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
@@ -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/