lingutest_client 0.1.4 → 0.2.0

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: 75545303557e78cc13f1aff77d1236a60e96a64450bbe3b028109fa27c9125bb
4
- data.tar.gz: d4536b69d79b552326ab302d19cca72d4192530c7fb438997e8156ecaa9a00dc
3
+ metadata.gz: f4ce0f93ff848d314d469a21c2b2f84e016ff1c88675853a1aa6dc1b499598ed
4
+ data.tar.gz: 8eb3c66205a9c94e1bcdb908fbe6c4c7bb3c756c153e2aa70ff0a1125e19411b
5
5
  SHA512:
6
- metadata.gz: e0c0bb5293aeda8932acc6bb867af5ca4295a0d632d1addb04756de6061150fe72465f14a8356a22b9eb1655f7dd385c56ecdf126c45b7ea8ba265b965e38d45
7
- data.tar.gz: a251fb5e341b92ddc6b106053fd7cce1eaa6f9c74c03fafa5f5bf438409fbfaec1b48a74d4a4b727d4671ff266f05bcd9558897c6d60ef9e6b7368305c41e873
6
+ metadata.gz: 6f60eeea257631e2a2e1ab039d1aef51fd26d45138c60f996d3ed0b23f72950f334c529803956b6af4e7edb9899ffdc3d7da308e92ed8d81162dfad70cf779ce
7
+ data.tar.gz: bad393d707e1bc0c9b32b3c967ce579c25dfb0bcc0e0639417d01158820bf5a2f2c6d19cbd9ae26320983121b757e4a19dc02de655b9b14a5e3cfddbc6ed9ad5
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ vendor
10
11
 
11
12
  # rspec failure tracking
12
13
  .rspec_status
data/.rubocop.yml CHANGED
@@ -1,2 +1,6 @@
1
+
2
+ AllCops:
3
+ NewCops: enable
4
+
1
5
  Style/Documentation:
2
6
  Enabled: false
data/Gemfile.lock CHANGED
@@ -1,89 +1,117 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lingutest_client (0.1.4)
5
- dry-configurable (~> 0.9.0)
6
- dry-schema (~> 1.4.3)
7
- dry-struct (~> 1.2.0)
8
- dry-types (~> 1.2.2)
9
- faraday
10
- faraday_middleware
4
+ lingutest_client (0.2.0)
5
+ dry-configurable (~> 0.13.0)
6
+ dry-schema (~> 1.10.0)
7
+ dry-struct (~> 1.5.0)
8
+ dry-types (~> 1.6.0)
9
+ faraday (~> 1.10.0)
10
+ faraday_middleware (~> 1.2.0)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- ast (2.4.0)
16
- concurrent-ruby (1.1.5)
17
- diff-lcs (1.3)
18
- dry-configurable (0.9.0)
15
+ ast (2.4.2)
16
+ concurrent-ruby (1.1.10)
17
+ diff-lcs (1.5.0)
18
+ dry-configurable (0.13.0)
19
19
  concurrent-ruby (~> 1.0)
20
- dry-core (~> 0.4, >= 0.4.7)
21
- dry-container (0.7.2)
20
+ dry-core (~> 0.6)
21
+ dry-container (0.11.0)
22
22
  concurrent-ruby (~> 1.0)
23
- dry-configurable (~> 0.1, >= 0.1.3)
24
- dry-core (0.4.9)
23
+ dry-core (0.9.1)
25
24
  concurrent-ruby (~> 1.0)
26
- dry-equalizer (0.3.0)
27
- dry-inflector (0.2.0)
28
- dry-initializer (3.0.3)
29
- dry-logic (1.0.5)
25
+ zeitwerk (~> 2.6)
26
+ dry-inflector (0.3.0)
27
+ dry-initializer (3.1.1)
28
+ dry-logic (1.3.0)
30
29
  concurrent-ruby (~> 1.0)
31
- dry-core (~> 0.2)
32
- dry-equalizer (~> 0.2)
33
- dry-schema (1.4.3)
30
+ dry-core (~> 0.9, >= 0.9)
31
+ zeitwerk (~> 2.6)
32
+ dry-schema (1.10.6)
34
33
  concurrent-ruby (~> 1.0)
35
- dry-configurable (~> 0.8, >= 0.8.3)
36
- dry-core (~> 0.4)
37
- dry-equalizer (~> 0.2)
34
+ dry-configurable (~> 0.13, >= 0.13.0)
35
+ dry-core (~> 0.5, >= 0.5)
38
36
  dry-initializer (~> 3.0)
39
- dry-logic (~> 1.0)
40
- dry-types (~> 1.2)
41
- dry-struct (1.2.0)
42
- dry-core (~> 0.4, >= 0.4.3)
43
- dry-equalizer (~> 0.3)
44
- dry-types (~> 1.0)
37
+ dry-logic (~> 1.2)
38
+ dry-types (~> 1.5)
39
+ dry-struct (1.5.2)
40
+ dry-core (~> 0.9, >= 0.9)
41
+ dry-types (~> 1.6)
45
42
  ice_nine (~> 0.11)
46
- dry-types (1.2.2)
43
+ zeitwerk (~> 2.6)
44
+ dry-types (1.6.1)
47
45
  concurrent-ruby (~> 1.0)
48
46
  dry-container (~> 0.3)
49
- dry-core (~> 0.4, >= 0.4.4)
50
- dry-equalizer (~> 0.3)
47
+ dry-core (~> 0.9, >= 0.9)
51
48
  dry-inflector (~> 0.1, >= 0.1.2)
52
- dry-logic (~> 1.0, >= 1.0.2)
53
- faraday (0.17.3)
54
- multipart-post (>= 1.2, < 3)
55
- faraday_middleware (0.14.0)
56
- faraday (>= 0.7.4, < 1.0)
49
+ dry-logic (~> 1.3, >= 1.3)
50
+ zeitwerk (~> 2.6)
51
+ faraday (1.10.3)
52
+ faraday-em_http (~> 1.0)
53
+ faraday-em_synchrony (~> 1.0)
54
+ faraday-excon (~> 1.1)
55
+ faraday-httpclient (~> 1.0)
56
+ faraday-multipart (~> 1.0)
57
+ faraday-net_http (~> 1.0)
58
+ faraday-net_http_persistent (~> 1.0)
59
+ faraday-patron (~> 1.0)
60
+ faraday-rack (~> 1.0)
61
+ faraday-retry (~> 1.0)
62
+ ruby2_keywords (>= 0.0.4)
63
+ faraday-em_http (1.0.0)
64
+ faraday-em_synchrony (1.0.0)
65
+ faraday-excon (1.1.0)
66
+ faraday-httpclient (1.0.1)
67
+ faraday-multipart (1.0.4)
68
+ multipart-post (~> 2)
69
+ faraday-net_http (1.0.1)
70
+ faraday-net_http_persistent (1.2.0)
71
+ faraday-patron (1.0.0)
72
+ faraday-rack (1.0.0)
73
+ faraday-retry (1.0.3)
74
+ faraday_middleware (1.2.0)
75
+ faraday (~> 1.0)
57
76
  ice_nine (0.11.2)
58
- jaro_winkler (1.5.4)
59
- multipart-post (2.1.1)
60
- parallel (1.19.1)
61
- parser (2.7.0.2)
62
- ast (~> 2.4.0)
63
- rainbow (3.0.0)
77
+ json (2.6.3)
78
+ multipart-post (2.2.3)
79
+ parallel (1.22.1)
80
+ parser (3.2.0.0)
81
+ ast (~> 2.4.1)
82
+ rainbow (3.1.1)
64
83
  rake (12.3.3)
65
- rspec (3.9.0)
66
- rspec-core (~> 3.9.0)
67
- rspec-expectations (~> 3.9.0)
68
- rspec-mocks (~> 3.9.0)
69
- rspec-core (3.9.1)
70
- rspec-support (~> 3.9.1)
71
- rspec-expectations (3.9.0)
84
+ regexp_parser (2.6.1)
85
+ rexml (3.2.5)
86
+ rspec (3.12.0)
87
+ rspec-core (~> 3.12.0)
88
+ rspec-expectations (~> 3.12.0)
89
+ rspec-mocks (~> 3.12.0)
90
+ rspec-core (3.12.0)
91
+ rspec-support (~> 3.12.0)
92
+ rspec-expectations (3.12.2)
72
93
  diff-lcs (>= 1.2.0, < 2.0)
73
- rspec-support (~> 3.9.0)
74
- rspec-mocks (3.9.1)
94
+ rspec-support (~> 3.12.0)
95
+ rspec-mocks (3.12.3)
75
96
  diff-lcs (>= 1.2.0, < 2.0)
76
- rspec-support (~> 3.9.0)
77
- rspec-support (3.9.2)
78
- rubocop (0.79.0)
79
- jaro_winkler (~> 1.5.1)
97
+ rspec-support (~> 3.12.0)
98
+ rspec-support (3.12.0)
99
+ rubocop (1.43.0)
100
+ json (~> 2.3)
80
101
  parallel (~> 1.10)
81
- parser (>= 2.7.0.1)
102
+ parser (>= 3.2.0.0)
82
103
  rainbow (>= 2.2.2, < 4.0)
104
+ regexp_parser (>= 1.8, < 3.0)
105
+ rexml (>= 3.2.5, < 4.0)
106
+ rubocop-ast (>= 1.24.1, < 2.0)
83
107
  ruby-progressbar (~> 1.7)
84
- unicode-display_width (>= 1.4.0, < 1.7)
85
- ruby-progressbar (1.10.1)
86
- unicode-display_width (1.6.1)
108
+ unicode-display_width (>= 2.4.0, < 3.0)
109
+ rubocop-ast (1.24.1)
110
+ parser (>= 3.1.1.0)
111
+ ruby-progressbar (1.11.0)
112
+ ruby2_keywords (0.0.5)
113
+ unicode-display_width (2.4.2)
114
+ zeitwerk (2.6.6)
87
115
 
88
116
  PLATFORMS
89
117
  ruby
@@ -92,7 +120,7 @@ DEPENDENCIES
92
120
  lingutest_client!
93
121
  rake (~> 12.0)
94
122
  rspec (~> 3.0)
95
- rubocop (~> 0.79.0)
123
+ rubocop (~> 1.43.0)
96
124
 
97
125
  BUNDLED WITH
98
- 1.17.3
126
+ 2.2.27
data/README.md CHANGED
@@ -1,24 +1,45 @@
1
1
  # LingutestClient
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lingutest_client`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This library will allow you to communicate with Lingu Test API. You can create examinations for client, and receive examination results. You need API token from Lingu Test to use this gem. Check [documentation](https://test.lingu.com/documentation) for API calls.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
5
 
7
6
  ## Installation
8
7
 
9
8
  Add this line to your application's Gemfile:
10
9
 
11
10
  ```ruby
12
- gem 'lingutest_client', github: 'AdeptLMS/lingutest_client', branch: :master
11
+ gem 'lingutest_client'
13
12
  ```
14
13
 
15
14
  And then execute:
16
15
 
17
16
  $ bundle install
18
17
 
18
+ ## Configuration
19
+
20
+ ```ruby
21
+ # config/initializers/lingutest_client.rb
22
+
23
+ LingutestClient.configure do |config|
24
+ config.api_base = 'https://test.lingu.com/api/v1/'
25
+ config.api_key = 'yourLinguTestApiKey'
26
+ end
27
+ ```
28
+
19
29
  ## Usage
20
30
 
21
- TODO: Write usage instructions here
31
+ ```ruby
32
+ LingutestClient::Exam.list
33
+
34
+ LingutestClient::Candidate.list
35
+ LingutestClient::Candidate.find(id)
36
+ LingutestClient::Candidate.create(fname:, lname:, email:, ssn:, gender:, mobile:)
37
+ LingutestClient::Candidate.update(fname:, lname:, email:, ssn:, gender:, mobile:)
38
+
39
+ LingutestClient::Examination.list
40
+ LingutestClient::Examination.find(id)
41
+ LingutestClient::Examination.create(candidate_id:, exam_id:, expires_at:)
42
+ ```
22
43
 
23
44
  ## Development
24
45
 
@@ -5,7 +5,7 @@ module LingutestClient
5
5
  module Operations
6
6
  module Create
7
7
  module ClassMethods
8
- def create(**params) # rubocop:disable Metrics/AbcSize
8
+ def create(**params)
9
9
  schema = const_get(:CreateSchema).call(params)
10
10
  unless schema.success?
11
11
  raise ValidationError,
@@ -5,7 +5,7 @@ module LingutestClient
5
5
  module Operations
6
6
  module Update
7
7
  module ClassMethods
8
- def update(id, **params) # rubocop:disable Metrics/AbcSize
8
+ def update(id, **params)
9
9
  schema = const_get(:UpdateSchema).call(params)
10
10
  unless schema.success?
11
11
  raise ValidationError,
@@ -11,7 +11,7 @@ module LingutestClient
11
11
  optional(:locale).filled(:string)
12
12
  optional(:mobile).filled(:string)
13
13
  optional(:gender).filled(Types::Gender)
14
- optional(:ssn).filled(:string, format?: /\A([\d]{10,11}|[\d]{5,6}|^$)\z/i)
14
+ optional(:ssn).filled(:string, format?: /\A(\d{10,11}|\d{5,6}|^$)\z/i)
15
15
  end
16
16
  UpdateSchema = Dry::Schema.Params do
17
17
  optional(:fname).filled(:string)
@@ -20,7 +20,7 @@ module LingutestClient
20
20
  optional(:locale).filled(:string)
21
21
  optional(:mobile).filled(:string)
22
22
  optional(:gender).filled(Types::Gender)
23
- optional(:ssn).filled(:string, format?: /\A([\d]{10,11}|[\d]{5,6}|^$)\z/i)
23
+ optional(:ssn).filled(:string, format?: /\A(\d{10,11}|\d{5,6}|^$)\z/i)
24
24
  end
25
25
 
26
26
  OBJECT_NAME = :candidate
@@ -7,12 +7,14 @@ module LingutestClient
7
7
  def self.included(base)
8
8
  base.extend Dry::Configurable
9
9
  base.class_eval do
10
- setting(:api_base,
11
- 'https://test.lingu.com/api/v1/',
12
- reader: true) do |value|
13
- URI.parse(value)
14
- end
15
- setting(:api_key, reader: true, &:to_s)
10
+ setting :api_base,
11
+ default: 'https://test.lingu.com/api/v1/',
12
+ constructor: proc { |value| URI.parse(value) },
13
+ reader: true
14
+
15
+ setting :api_key,
16
+ constructor: proc { |value| value.to_s },
17
+ reader: true
16
18
  end
17
19
  end
18
20
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module LingutestClient
2
- VERSION = '0.1.4'
4
+ VERSION = '0.2.0'
3
5
  end
@@ -11,8 +11,9 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Write a short summary, because RubyGems requires one.'
12
12
  spec.description = 'Write a longer description or delete this line.'
13
13
  # spec.homepage = "Put your gem's website or public repo URL here."
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7.6')
15
15
 
16
+ spec.metadata['rubygems_mfa_required'] = 'true'
16
17
  # spec.metadata['allowed_push_host'] = "Set to 'http://mygemserver.com'"
17
18
 
18
19
  # spec.metadata["homepage_uri"] = spec.homepage
@@ -27,12 +28,12 @@ Gem::Specification.new do |spec|
27
28
  spec.bindir = 'exe'
28
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
30
  spec.require_paths = ['lib']
30
- spec.add_dependency 'dry-configurable', '~> 0.9.0'
31
- spec.add_dependency 'dry-schema', '~> 1.4.3'
32
- spec.add_dependency 'dry-struct', '~> 1.2.0'
33
- spec.add_dependency 'dry-types', '~> 1.2.2'
31
+ spec.add_dependency 'dry-configurable', '~> 0.13.0'
32
+ spec.add_dependency 'dry-schema', '~> 1.10.0'
33
+ spec.add_dependency 'dry-struct', '~> 1.5.0'
34
+ spec.add_dependency 'dry-types', '~> 1.6.0'
34
35
 
35
- spec.add_dependency 'faraday'
36
- spec.add_dependency 'faraday_middleware'
37
- spec.add_development_dependency 'rubocop', '~> 0.79.0'
36
+ spec.add_dependency 'faraday', '~> 1.10.0'
37
+ spec.add_dependency 'faraday_middleware', '~> 1.2.0'
38
+ spec.add_development_dependency 'rubocop', '~> 1.43.0'
38
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lingutest_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatolii Didukh
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-05 00:00:00.000000000 Z
11
+ date: 2023-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.0
19
+ version: 0.13.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.0
26
+ version: 0.13.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dry-schema
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.4.3
33
+ version: 1.10.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.4.3
40
+ version: 1.10.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-struct
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.2.0
47
+ version: 1.5.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.2.0
54
+ version: 1.5.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: dry-types
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2.2
61
+ version: 1.6.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.2.2
68
+ version: 1.6.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: faraday
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 1.10.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 1.10.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: faraday_middleware
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 1.2.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 1.2.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.79.0
103
+ version: 1.43.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.79.0
110
+ version: 1.43.0
111
111
  description: Write a longer description or delete this line.
112
112
  email:
113
113
  - railsme7@gmail.com
@@ -147,10 +147,11 @@ files:
147
147
  - lib/lingutest_client/types.rb
148
148
  - lib/lingutest_client/version.rb
149
149
  - lingutest_client.gemspec
150
- homepage:
150
+ homepage:
151
151
  licenses: []
152
- metadata: {}
153
- post_install_message:
152
+ metadata:
153
+ rubygems_mfa_required: 'true'
154
+ post_install_message:
154
155
  rdoc_options: []
155
156
  require_paths:
156
157
  - lib
@@ -158,15 +159,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
159
  requirements:
159
160
  - - ">="
160
161
  - !ruby/object:Gem::Version
161
- version: 2.3.0
162
+ version: 2.7.6
162
163
  required_rubygems_version: !ruby/object:Gem::Requirement
163
164
  requirements:
164
165
  - - ">="
165
166
  - !ruby/object:Gem::Version
166
167
  version: '0'
167
168
  requirements: []
168
- rubygems_version: 3.1.2
169
- signing_key:
169
+ rubygems_version: 3.3.26
170
+ signing_key:
170
171
  specification_version: 4
171
172
  summary: Write a short summary, because RubyGems requires one.
172
173
  test_files: []