lingutest_client 0.2.0 → 0.2.4

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: f4ce0f93ff848d314d469a21c2b2f84e016ff1c88675853a1aa6dc1b499598ed
4
- data.tar.gz: 8eb3c66205a9c94e1bcdb908fbe6c4c7bb3c756c153e2aa70ff0a1125e19411b
3
+ metadata.gz: 8afc37ff56b1df876015bbcb79346a3399358d6543b1a960d2a9d8ba2c45ca52
4
+ data.tar.gz: f50ea200dd6df9472969d5a7ba5b6e51f752948d6156b75f24605d358910881a
5
5
  SHA512:
6
- metadata.gz: 6f60eeea257631e2a2e1ab039d1aef51fd26d45138c60f996d3ed0b23f72950f334c529803956b6af4e7edb9899ffdc3d7da308e92ed8d81162dfad70cf779ce
7
- data.tar.gz: bad393d707e1bc0c9b32b3c967ce579c25dfb0bcc0e0639417d01158820bf5a2f2c6d19cbd9ae26320983121b757e4a19dc02de655b9b14a5e3cfddbc6ed9ad5
6
+ metadata.gz: 8e0fce747d14f6efda5eacb7cede2c3bd87f678c880bcd54d12bcb5458b0098534a9603737c9eef25347d0339c3d7c32d0c6f99c4c5aa680c25d53ec526a2f89
7
+ data.tar.gz: c20938a765d78f3c0e7a84993869f8b6f4ba9166a84a628b9c7e1ad823426228bc14bcd24123f6c90a6cda69c6ec6625ed2f40cfe59241f9ed5d3d2973eb5ebd
data/.rubocop.yml CHANGED
@@ -1,3 +1,6 @@
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
1
4
 
2
5
  AllCops:
3
6
  NewCops: enable
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # CHANGELOG
2
+
3
+ ## Next release
4
+ ...
5
+
6
+ ## 0.2.3 (15 August 2023)
7
+ List candidates filters
8
+
9
+ ## 0.2.2 (16 March 2023)
10
+ Result URL
11
+
12
+ ## 0.2.1 (24 February 2023)
data/Gemfile CHANGED
@@ -5,5 +5,11 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in lingutest_client.gemspec
6
6
  gemspec
7
7
 
8
+ gem 'pry'
8
9
  gem 'rake', '~> 12.0'
9
10
  gem 'rspec', '~> 3.0'
11
+ gem 'rubocop', '~> 1.43.0'
12
+ gem 'rubocop-rake'
13
+ gem 'rubocop-rspec'
14
+ gem 'shoulda-matchers', '~> 5.0'
15
+ gem 'vcr', '~> 6.0'
data/Gemfile.lock CHANGED
@@ -1,19 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lingutest_client (0.2.0)
4
+ lingutest_client (0.2.4)
5
5
  dry-configurable (~> 0.13.0)
6
6
  dry-schema (~> 1.10.0)
7
7
  dry-struct (~> 1.5.0)
8
8
  dry-types (~> 1.6.0)
9
9
  faraday (~> 1.10.0)
10
10
  faraday_middleware (~> 1.2.0)
11
+ zeitwerk (~> 2.6.7, >= 2.6.7)
11
12
 
12
13
  GEM
13
14
  remote: https://rubygems.org/
14
15
  specs:
16
+ activesupport (7.0.4.2)
17
+ concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ i18n (>= 1.6, < 2)
19
+ minitest (>= 5.1)
20
+ tzinfo (~> 2.0)
15
21
  ast (2.4.2)
16
- concurrent-ruby (1.1.10)
22
+ coderay (1.1.3)
23
+ concurrent-ruby (1.2.0)
17
24
  diff-lcs (1.5.0)
18
25
  dry-configurable (0.13.0)
19
26
  concurrent-ruby (~> 1.0)
@@ -73,21 +80,28 @@ GEM
73
80
  faraday-retry (1.0.3)
74
81
  faraday_middleware (1.2.0)
75
82
  faraday (~> 1.0)
83
+ i18n (1.12.0)
84
+ concurrent-ruby (~> 1.0)
76
85
  ice_nine (0.11.2)
77
86
  json (2.6.3)
78
- multipart-post (2.2.3)
87
+ method_source (1.0.0)
88
+ minitest (5.17.0)
89
+ multipart-post (2.3.0)
79
90
  parallel (1.22.1)
80
- parser (3.2.0.0)
91
+ parser (3.2.1.0)
81
92
  ast (~> 2.4.1)
93
+ pry (0.14.2)
94
+ coderay (~> 1.1)
95
+ method_source (~> 1.0)
82
96
  rainbow (3.1.1)
83
97
  rake (12.3.3)
84
- regexp_parser (2.6.1)
98
+ regexp_parser (2.7.0)
85
99
  rexml (3.2.5)
86
100
  rspec (3.12.0)
87
101
  rspec-core (~> 3.12.0)
88
102
  rspec-expectations (~> 3.12.0)
89
103
  rspec-mocks (~> 3.12.0)
90
- rspec-core (3.12.0)
104
+ rspec-core (3.12.1)
91
105
  rspec-support (~> 3.12.0)
92
106
  rspec-expectations (3.12.2)
93
107
  diff-lcs (>= 1.2.0, < 2.0)
@@ -106,21 +120,38 @@ GEM
106
120
  rubocop-ast (>= 1.24.1, < 2.0)
107
121
  ruby-progressbar (~> 1.7)
108
122
  unicode-display_width (>= 2.4.0, < 3.0)
109
- rubocop-ast (1.24.1)
110
- parser (>= 3.1.1.0)
123
+ rubocop-ast (1.26.0)
124
+ parser (>= 3.2.1.0)
125
+ rubocop-capybara (2.17.1)
126
+ rubocop (~> 1.41)
127
+ rubocop-rake (0.6.0)
128
+ rubocop (~> 1.0)
129
+ rubocop-rspec (2.18.1)
130
+ rubocop (~> 1.33)
131
+ rubocop-capybara (~> 2.17)
111
132
  ruby-progressbar (1.11.0)
112
133
  ruby2_keywords (0.0.5)
134
+ shoulda-matchers (5.3.0)
135
+ activesupport (>= 5.2.0)
136
+ tzinfo (2.0.6)
137
+ concurrent-ruby (~> 1.0)
113
138
  unicode-display_width (2.4.2)
114
- zeitwerk (2.6.6)
139
+ vcr (6.1.0)
140
+ zeitwerk (2.6.7)
115
141
 
116
142
  PLATFORMS
117
143
  ruby
118
144
 
119
145
  DEPENDENCIES
120
146
  lingutest_client!
147
+ pry
121
148
  rake (~> 12.0)
122
149
  rspec (~> 3.0)
123
150
  rubocop (~> 1.43.0)
151
+ rubocop-rake
152
+ rubocop-rspec
153
+ shoulda-matchers (~> 5.0)
154
+ vcr (~> 6.0)
124
155
 
125
156
  BUNDLED WITH
126
- 2.2.27
157
+ 2.4.18
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LingutestClient
4
- module API
4
+ module Api
5
5
  module Operations
6
6
  module Create
7
7
  module ClassMethods
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LingutestClient
4
- module API
4
+ module Api
5
5
  module Operations
6
6
  module Delete
7
7
  module ClassMethods
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LingutestClient
4
- module API
4
+ module Api
5
5
  module Operations
6
6
  module Find
7
7
  module ClassMethods
@@ -1,16 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LingutestClient
4
- module API
4
+ module Api
5
5
  module Operations
6
6
  module List
7
+ DELEGATED_METHODS = %i[
8
+ each
9
+ empty?
10
+ find
11
+ first
12
+ last
13
+ map
14
+ reject
15
+ select
16
+ size
17
+ ].freeze
18
+
7
19
  class << self
8
- def module(list_type)
20
+ def module(list_type, params_schema = nil) # rubocop:disable Metrics/MethodLength
9
21
  Module.new do
10
22
  class_methods_module = Module.new
11
- class_methods_module.define_method :list do
12
- list_type.new(Client.get(resource_url).body)
23
+
24
+ class_methods_module.define_method :list do |**options|
25
+ params = options.dup
26
+ if params_schema
27
+ result = params_schema.call(options)
28
+ raise ArgumentError, result.errors if result.failure?
29
+
30
+ params = result.to_h
31
+ end
32
+ list_type.new(Client.get(resource_url, **params).body)
13
33
  end
34
+
14
35
  define_singleton_method :included do |base|
15
36
  base.extend class_methods_module
16
37
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LingutestClient
4
- module API
4
+ module Api
5
5
  module Operations
6
6
  module Update
7
7
  module ClassMethods
@@ -3,7 +3,7 @@
3
3
  require 'ostruct'
4
4
 
5
5
  module LingutestClient
6
- module API
6
+ module Api
7
7
  module Resource
8
8
  module ClassMethods
9
9
  def resource_url
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'forwardable'
4
- require 'dry-struct'
5
- require 'dry-schema'
6
-
7
3
  module LingutestClient
8
4
  class Base < Dry::Struct
9
5
  extend Forwardable
@@ -1,36 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'uri/mailto'
4
-
5
3
  module LingutestClient
6
4
  class Candidate < Base
7
5
  CreateSchema = Dry::Schema.Params do
8
6
  required(:fname).filled(:string)
9
7
  required(:lname).filled(:string)
10
- required(:email).filled(:string, format?: URI::MailTo::EMAIL_REGEXP)
8
+ required(:email).filled(Types::Email)
11
9
  optional(:locale).filled(:string)
12
10
  optional(:mobile).filled(:string)
13
11
  optional(:gender).filled(Types::Gender)
14
- optional(:ssn).filled(:string, format?: /\A(\d{10,11}|\d{5,6}|^$)\z/i)
12
+ optional(:ssn).filled(Types::Ssn)
15
13
  end
16
14
  UpdateSchema = Dry::Schema.Params do
17
15
  optional(:fname).filled(:string)
18
16
  optional(:lname).filled(:string)
19
- optional(:email).filled(:string, format?: URI::MailTo::EMAIL_REGEXP)
17
+ optional(:email).filled(Types::Email)
20
18
  optional(:locale).filled(:string)
21
19
  optional(:mobile).filled(:string)
22
20
  optional(:gender).filled(Types::Gender)
23
- optional(:ssn).filled(:string, format?: /\A(\d{10,11}|\d{5,6}|^$)\z/i)
21
+ optional(:ssn).filled(Types::Ssn)
22
+ end
23
+
24
+ FilterSchema = Dry::Schema.Params do
25
+ optional(:page)
26
+ optional(:per_page)
27
+ optional(:email_eq).filled(Types::Email)
28
+ optional(:fname_eq).filled(:string)
29
+ optional(:lname_eq).filled(:string)
24
30
  end
25
31
 
26
32
  OBJECT_NAME = :candidate
27
33
 
28
- include API::Resource
29
- include API::Operations::List.module(CandidateList)
30
- include API::Operations::Create
31
- include API::Operations::Find
32
- include API::Operations::Delete
33
- include API::Operations::Update
34
+ include Api::Resource
35
+ include Api::Operations::List.module(CandidateList, FilterSchema)
36
+ include Api::Operations::Create
37
+ include Api::Operations::Find
38
+ include Api::Operations::Delete
39
+ include Api::Operations::Update
34
40
 
35
41
  attribute :id, Types::Coercible::Integer.default(0)
36
42
  attribute :email, Types::Coercible::String.default('')
@@ -39,7 +45,6 @@ module LingutestClient
39
45
  attribute :mobile, Types::Coercible::String.default('')
40
46
  attribute :locale, Types::Coercible::String.default('')
41
47
  attribute :ssn, Types::Coercible::String.default('')
42
- attribute :gender,
43
- Types::String.optional.enum('unknown', 'male', 'female')
48
+ attribute :gender, Types::Gender
44
49
  end
45
50
  end
@@ -3,7 +3,7 @@
3
3
  module LingutestClient
4
4
  class CandidateList < Base
5
5
  include Enumerable
6
- delegate %i[each size last] => :candidates
6
+ delegate ::LingutestClient::Api::Operations::List::DELEGATED_METHODS => :candidates
7
7
 
8
8
  attribute :candidates, Types::Array.of(Candidate)
9
9
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module LingutestClient
4
+ class Client
5
+ include Connection
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'forwardable'
3
+ require 'faraday'
4
4
 
5
5
  module LingutestClient
6
6
  module Connection
@@ -4,12 +4,13 @@ module LingutestClient
4
4
  class Exam < Base
5
5
  OBJECT_NAME = :exam
6
6
 
7
- include API::Resource
8
- include API::Operations::List.module(ExamList)
7
+ include Api::Resource
8
+ include Api::Operations::List.module(ExamList)
9
9
 
10
10
  attribute :id, Types::Coercible::Integer.optional.default(0)
11
11
  attribute :name, Types::Coercible::String.optional.default('')
12
12
  attribute :description, Types::Coercible::String.optional.default('')
13
+ attribute :price, Types::Coercible::Decimal.optional.default(0)
13
14
  attribute :updated_at, Types::DateTime.optional.default(nil)
14
15
  end
15
16
  end
@@ -3,7 +3,7 @@
3
3
  module LingutestClient
4
4
  class ExamList < Base
5
5
  include Enumerable
6
- delegate %i[each size last] => :exams
6
+ delegate ::LingutestClient::Api::Operations::List::DELEGATED_METHODS => :exams
7
7
 
8
8
  attribute :exams, Types::Array.of(Exam)
9
9
  end
@@ -2,35 +2,62 @@
2
2
 
3
3
  module LingutestClient
4
4
  class Examination < Base
5
+ OBJECT_NAME = :examination
6
+
7
+ STATUSES = %w[
8
+ pending
9
+ in_progress
10
+ completed
11
+ pending_review
12
+ reviewed
13
+ ].freeze
14
+
5
15
  CreateSchema = Dry::Schema.Params do
6
16
  required(:exam_id).filled(Types::Coercible::Integer)
7
17
  required(:candidate_id).filled(Types::Coercible::Integer)
8
18
  required(:expires_at).filled(Types::DateTime)
9
- optional(:redirect_url).filled(:string, format?: %r{\Ahttps?://.+\z}i)
19
+ optional(:redirect_url).filled(Types::Url)
20
+
21
+ optional(:team_id).filled(Types::Coercible::String)
22
+ optional(:team_group_id).filled(Types::Coercible::String)
23
+ optional(:student_id).filled(Types::Coercible::String)
10
24
  end
11
25
 
12
- OBJECT_NAME = :examination
26
+ FilterSchema = Dry::Schema.Params do
27
+ config.validate_keys = true
28
+ optional(:page).filled(Types::Coercible::Integer)
29
+ optional(:per_page).filled(Types::Coercible::Integer)
30
+
31
+ optional(:team_id_eq).filled(Types::Coercible::String)
32
+ optional(:team_group_id_eq).filled(Types::Coercible::String)
33
+ optional(:student_id_eq).filled(Types::Coercible::String)
13
34
 
14
- include API::Resource
15
- include API::Operations::List.module(ExaminationList)
16
- include API::Operations::Create
17
- include API::Operations::Find
35
+ optional(:price_gteq).filled(Types::Coercible::Integer)
36
+ optional(:created_at_gteq).filled(Types::DateTime)
37
+ optional(:created_at_lteq).filled(Types::DateTime)
38
+ end
39
+
40
+ include Api::Resource
41
+ include Api::Operations::List.module(ExaminationList, FilterSchema)
42
+ include Api::Operations::Create
43
+ include Api::Operations::Find
18
44
 
19
45
  attribute :id, Types::Integer.optional
20
46
  attribute :exam, Exam.optional.default(nil)
21
47
  attribute :candidate, Candidate.optional.default(nil)
22
48
  attribute :total_score, Types::Integer.optional.default(0)
49
+ attribute :max_score, Types::Integer.optional.default(0)
50
+ attribute :tasks_limit, Types::Integer.optional.default(0)
23
51
  attribute :total_time_spent, Types::Integer.optional.default(0)
24
52
  attribute :code, Types::String.optional.default('')
25
53
  attribute :redirect_url, Types::String.optional
54
+ attribute :price, Types::Coercible::Decimal.optional.default(0)
55
+
56
+ attribute :team_id, Types::String.optional.default(nil)
57
+ attribute :team_group_id, Types::String.optional.default(nil)
58
+ attribute :student_id, Types::String.optional.default(nil)
26
59
 
27
- attribute :status, Types::Integer.optional.default(0).enum(
28
- 0 => 'pending',
29
- 1 => 'in_progress',
30
- 2 => 'completed',
31
- 3 => 'pending_review',
32
- 4 => 'reviewed'
33
- )
60
+ attribute :status, Types::String.optional.enum(*STATUSES)
34
61
 
35
62
  attribute :expires_at, Types::Time.optional.default(nil)
36
63
  attribute :created_at, Types::Time.optional.default(nil)
@@ -39,5 +66,15 @@ module LingutestClient
39
66
  def url
40
67
  URI.join(LingutestClient.config.api_base.to_s, "/#{code}").to_s
41
68
  end
69
+
70
+ def result_url
71
+ URI.join(LingutestClient.config.api_base.to_s, "/examinations/#{code}").to_s
72
+ end
73
+
74
+ STATUSES.each do |status|
75
+ define_method "#{status}?" do
76
+ self.status == status
77
+ end
78
+ end
42
79
  end
43
80
  end
@@ -3,8 +3,15 @@
3
3
  module LingutestClient
4
4
  class ExaminationList < Base
5
5
  include Enumerable
6
- delegate %i[each size last] => :examinations
6
+ delegate ::LingutestClient::Api::Operations::List::DELEGATED_METHODS => :examinations
7
7
 
8
8
  attribute :examinations, Types::Array.of(Examination)
9
+
10
+ attribute :limit_value, Types::Coercible::Integer
11
+ attribute :current_page, Types::Coercible::Integer
12
+ attribute :total_pages, Types::Coercible::Integer
13
+ attribute :total_count, Types::Coercible::Integer
14
+ attribute :per_page, Types::Coercible::Integer
15
+ attribute :page, Types::Coercible::Integer
9
16
  end
10
17
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'dry-types'
4
+ require 'uri/mailto'
4
5
 
5
6
  module LingutestClient
6
7
  module Types
@@ -9,5 +10,8 @@ module LingutestClient
9
10
  DateTime = Strict::Date | JSON::Date | Strict::Time
10
11
  Time = Strict::Time | Types::JSON::Time
11
12
  Gender = Types::String.enum('unknown', 'male', 'female')
13
+ Email = Types::String.constrained(format: URI::MailTo::EMAIL_REGEXP)
14
+ Ssn = Types::String.constrained(format: /\A(\d{10,11}|\d{5,6}|^$)\z/i)
15
+ Url = Types::String.constrained(format: %r{\Ahttps?://.+\z}i)
12
16
  end
13
17
  end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module LingutestClient
4
+ class ValidationError < StandardError
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LingutestClient
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.4'
5
5
  end
@@ -1,26 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  $LOAD_PATH.unshift File.dirname(__FILE__)
4
+ require 'dry-configurable'
5
+ require 'dry-schema'
6
+ require 'dry-struct'
7
+ require 'dry-types'
8
+ require 'forwardable'
9
+ require 'zeitwerk'
4
10
 
5
- module LingutestClient
6
- autoload :API, 'lingutest_client/api'
7
- autoload :Base, 'lingutest_client/base'
8
- autoload :Candidate, 'lingutest_client/candidate'
9
- autoload :Configuration, 'lingutest_client/configuration'
10
- autoload :Connection, 'lingutest_client/connection'
11
- autoload :CandidateList, 'lingutest_client/candidate_list'
12
- autoload :Exam, 'lingutest_client/exam'
13
- autoload :ExamList, 'lingutest_client/exam_list'
14
- autoload :Examination, 'lingutest_client/examination'
15
- autoload :ExaminationList, 'lingutest_client/examination_list'
16
- autoload :Types, 'lingutest_client/types'
17
- autoload :VERSION, 'lingutest_client/version'
11
+ Zeitwerk::Loader.for_gem.setup
18
12
 
19
- include Configuration
13
+ module LingutestClient
14
+ extend Dry::Configurable
20
15
 
21
- class ValidationError < StandardError; end
16
+ setting :api_base,
17
+ default: 'https://test.lingu.com/api/v1/',
18
+ constructor: proc { |value| URI.parse(value) },
19
+ reader: true
22
20
 
23
- class Client
24
- include LingutestClient::Connection
25
- end
21
+ setting :api_key,
22
+ constructor: proc { |value| value.to_s },
23
+ reader: true
26
24
  end
@@ -8,17 +8,17 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['Anatolii Didukh']
9
9
  spec.email = ['railsme7@gmail.com']
10
10
 
11
- spec.summary = 'Write a short summary, because RubyGems requires one.'
12
- spec.description = 'Write a longer description or delete this line.'
13
- # spec.homepage = "Put your gem's website or public repo URL here."
11
+ spec.summary = 'lingutest client'
12
+ spec.description = 'test.lingu.com API ruby client'
13
+ spec.homepage = 'https://github.com/AdeptLMS/lingutest_client'
14
14
  spec.required_ruby_version = Gem::Requirement.new('>= 2.7.6')
15
15
 
16
16
  spec.metadata['rubygems_mfa_required'] = 'true'
17
17
  # spec.metadata['allowed_push_host'] = "Set to 'http://mygemserver.com'"
18
18
 
19
- # spec.metadata["homepage_uri"] = spec.homepage
20
- # spec.metadata["source_code_uri"] = "Put your gem's public repo URL here."
21
- # spec.metadata["changelog_uri"] = "Put your gem's CHANGELOG.md URL here."
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = 'https://github.com/AdeptLMS/lingutest_client'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/AdeptLMS/lingutest_client/blob/master/CHANGELOG.md'
22
22
 
23
23
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
24
  `git ls-files -z`
@@ -28,12 +28,12 @@ Gem::Specification.new do |spec|
28
28
  spec.bindir = 'exe'
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ['lib']
31
+
31
32
  spec.add_dependency 'dry-configurable', '~> 0.13.0'
32
33
  spec.add_dependency 'dry-schema', '~> 1.10.0'
33
34
  spec.add_dependency 'dry-struct', '~> 1.5.0'
34
35
  spec.add_dependency 'dry-types', '~> 1.6.0'
35
-
36
36
  spec.add_dependency 'faraday', '~> 1.10.0'
37
37
  spec.add_dependency 'faraday_middleware', '~> 1.2.0'
38
- spec.add_development_dependency 'rubocop', '~> 1.43.0'
38
+ spec.add_dependency 'zeitwerk', '~> 2.6.7', '>= 2.6.7'
39
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.2.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatolii Didukh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-20 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -95,20 +95,26 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.2.0
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop
98
+ name: zeitwerk
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.43.0
104
- type: :development
103
+ version: 2.6.7
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 2.6.7
107
+ type: :runtime
105
108
  prerelease: false
106
109
  version_requirements: !ruby/object:Gem::Requirement
107
110
  requirements:
108
111
  - - "~>"
109
112
  - !ruby/object:Gem::Version
110
- version: 1.43.0
111
- description: Write a longer description or delete this line.
113
+ version: 2.6.7
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 2.6.7
117
+ description: test.lingu.com API ruby client
112
118
  email:
113
119
  - railsme7@gmail.com
114
120
  executables: []
@@ -119,6 +125,7 @@ files:
119
125
  - ".rspec"
120
126
  - ".rubocop.yml"
121
127
  - ".travis.yml"
128
+ - CHANGELOG.md
122
129
  - CODE_OF_CONDUCT.md
123
130
  - Gemfile
124
131
  - Gemfile.lock
@@ -127,8 +134,6 @@ files:
127
134
  - bin/console
128
135
  - bin/setup
129
136
  - lib/lingutest_client.rb
130
- - lib/lingutest_client/api.rb
131
- - lib/lingutest_client/api/operations.rb
132
137
  - lib/lingutest_client/api/operations/create.rb
133
138
  - lib/lingutest_client/api/operations/delete.rb
134
139
  - lib/lingutest_client/api/operations/find.rb
@@ -138,19 +143,23 @@ files:
138
143
  - lib/lingutest_client/base.rb
139
144
  - lib/lingutest_client/candidate.rb
140
145
  - lib/lingutest_client/candidate_list.rb
141
- - lib/lingutest_client/configuration.rb
146
+ - lib/lingutest_client/client.rb
142
147
  - lib/lingutest_client/connection.rb
143
148
  - lib/lingutest_client/exam.rb
144
149
  - lib/lingutest_client/exam_list.rb
145
150
  - lib/lingutest_client/examination.rb
146
151
  - lib/lingutest_client/examination_list.rb
147
152
  - lib/lingutest_client/types.rb
153
+ - lib/lingutest_client/validation_error.rb
148
154
  - lib/lingutest_client/version.rb
149
155
  - lingutest_client.gemspec
150
- homepage:
156
+ homepage: https://github.com/AdeptLMS/lingutest_client
151
157
  licenses: []
152
158
  metadata:
153
159
  rubygems_mfa_required: 'true'
160
+ homepage_uri: https://github.com/AdeptLMS/lingutest_client
161
+ source_code_uri: https://github.com/AdeptLMS/lingutest_client
162
+ changelog_uri: https://github.com/AdeptLMS/lingutest_client/blob/master/CHANGELOG.md
154
163
  post_install_message:
155
164
  rdoc_options: []
156
165
  require_paths:
@@ -166,8 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
175
  - !ruby/object:Gem::Version
167
176
  version: '0'
168
177
  requirements: []
169
- rubygems_version: 3.3.26
178
+ rubygems_version: 3.4.18
170
179
  signing_key:
171
180
  specification_version: 4
172
- summary: Write a short summary, because RubyGems requires one.
181
+ summary: lingutest client
173
182
  test_files: []
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module LingutestClient
4
- module API
5
- module Operations
6
- autoload :Create, 'lingutest_client/api/operations/create'
7
- autoload :Delete, 'lingutest_client/api/operations/delete'
8
- autoload :Find, 'lingutest_client/api/operations/find'
9
- autoload :List, 'lingutest_client/api/operations/list'
10
- autoload :Update, 'lingutest_client/api/operations/update'
11
- end
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module LingutestClient
4
- module API
5
- autoload :Resource, 'lingutest_client/api/resource'
6
- autoload :Operations, 'lingutest_client/api/operations'
7
- end
8
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'dry-configurable'
4
-
5
- module LingutestClient
6
- module Configuration
7
- def self.included(base)
8
- base.extend Dry::Configurable
9
- base.class_eval do
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
18
- end
19
- end
20
- end
21
- end