glia-errors 0.11.6 → 0.11.9

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: 18b0771e4477d3bad79df4926e73e03178e12838a40d254ac24738ca208147d0
4
- data.tar.gz: 8497c21a809704770feb7ee1c1bf687269a699b9419a49879a2abdab5fcf1396
3
+ metadata.gz: c6b6fd12bc363fc02141616b3a4b4990ba176e7f93c1295ee91b3d22c16a5cd2
4
+ data.tar.gz: 27ba41bf2ef41afc16287eb499a88a92cd260536063fa6ca8d588db4077a87de
5
5
  SHA512:
6
- metadata.gz: a1ba73e500036b0b18f240841d3c7fe33267e259954c0b12a61c08d3d511a770e3afa1b0644d972e302b1834a91f98654b3cdf178af11b474df564134de66114
7
- data.tar.gz: 88f2d9b04a99d2d48e2faca49cdb830e75704133d1165c696534fe919713833e41577c7945e22d169fb3711b0bfdbffe4b5af725793fab0de34f77dd526a1bda
6
+ metadata.gz: a4ded59fd8088231026d3763ca9152294ccbb1ace364b88c5bf2f279d5f31024955116b5b3f733ca020ea56d8d1bd797478d57e9740def00cc2ecb14b815096b
7
+ data.tar.gz: ce5dc9d176e3c1abd5a31c51a7845d11fba29cf449296a75d2c0e8fb0acd77fb5b0aa74d803f17d10ab67b447c29b158e046cae0738bb47138669c3dfe9a85cd
data/.rubocop.yml CHANGED
@@ -14,3 +14,6 @@ Metrics/ModuleLength:
14
14
  Metrics/BlockLength:
15
15
  Exclude:
16
16
  - 'spec/**/*'
17
+
18
+ Gemspec/RequireMFA:
19
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.2
1
+ ruby-3.1
data/Appraisals CHANGED
@@ -1,9 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'dry_validation_v0' do
4
- gem 'dry-validation', '~> 0.13.0'
3
+ ruby_major_version = RUBY_VERSION.split('.').first.to_i
4
+
5
+ if ruby_major_version < 3
6
+ appraise 'dry_validation_v0' do
7
+ gem 'dry-core', '~> 0.5.0'
8
+ gem 'dry-validation', '~> 0.13.0'
9
+ end
5
10
  end
6
11
 
7
12
  appraise 'dry_validation_v1' do
8
- gem 'dry-validation', '~> 1.6.0'
13
+ gem 'dry-validation', '~> 1.7'
9
14
  end
data/Gemfile CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ gemspec
6
+
5
7
  gem 'prettier', '~> 0.22'
6
8
  gem 'rake', '~> 13.0'
7
9
  gem 'rspec', '~> 3.10'
@@ -13,3 +15,5 @@ gem 'super_diff'
13
15
  group :test do
14
16
  gem 'appraisal'
15
17
  end
18
+
19
+ gem 'dry-validation', '~> 1.8'
data/Gemfile.lock CHANGED
@@ -1,3 +1,8 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ glia-errors (0.11.9)
5
+
1
6
  GEM
2
7
  remote: https://rubygems.org/
3
8
  specs:
@@ -5,19 +10,53 @@ GEM
5
10
  bundler
6
11
  rake
7
12
  thor (>= 0.14.0)
8
- ast (2.4.1)
9
- attr_extras (6.2.4)
10
- diff-lcs (1.4.4)
11
- parallel (1.20.1)
12
- parser (2.7.2.0)
13
+ ast (2.4.2)
14
+ attr_extras (6.2.5)
15
+ concurrent-ruby (1.1.10)
16
+ diff-lcs (1.5.0)
17
+ dry-configurable (0.14.0)
18
+ concurrent-ruby (~> 1.0)
19
+ dry-core (~> 0.6)
20
+ dry-container (0.9.0)
21
+ concurrent-ruby (~> 1.0)
22
+ dry-configurable (~> 0.13, >= 0.13.0)
23
+ dry-core (0.7.1)
24
+ concurrent-ruby (~> 1.0)
25
+ dry-inflector (0.2.1)
26
+ dry-initializer (3.1.1)
27
+ dry-logic (1.2.0)
28
+ concurrent-ruby (~> 1.0)
29
+ dry-core (~> 0.5, >= 0.5)
30
+ dry-schema (1.9.1)
31
+ concurrent-ruby (~> 1.0)
32
+ dry-configurable (~> 0.13, >= 0.13.0)
33
+ dry-core (~> 0.5, >= 0.5)
34
+ dry-initializer (~> 3.0)
35
+ dry-logic (~> 1.0)
36
+ dry-types (~> 1.5)
37
+ dry-types (1.5.1)
38
+ concurrent-ruby (~> 1.0)
39
+ dry-container (~> 0.3)
40
+ dry-core (~> 0.5, >= 0.5)
41
+ dry-inflector (~> 0.1, >= 0.1.2)
42
+ dry-logic (~> 1.0, >= 1.0.2)
43
+ dry-validation (1.8.0)
44
+ concurrent-ruby (~> 1.0)
45
+ dry-container (~> 0.7, >= 0.7.1)
46
+ dry-core (~> 0.5, >= 0.5)
47
+ dry-initializer (~> 3.0)
48
+ dry-schema (~> 1.9, >= 1.9.1)
49
+ optimist (3.0.1)
50
+ parallel (1.22.1)
51
+ parser (3.1.1.0)
13
52
  ast (~> 2.4.1)
14
- patience_diff (1.1.0)
15
- trollop (~> 1.16)
53
+ patience_diff (1.2.0)
54
+ optimist (~> 3.0)
16
55
  prettier (0.22.0)
17
- rainbow (3.0.0)
56
+ rainbow (3.1.1)
18
57
  rake (13.0.1)
19
- regexp_parser (2.0.0)
20
- rexml (3.2.4)
58
+ regexp_parser (2.2.1)
59
+ rexml (3.2.5)
21
60
  rspec (3.10.0)
22
61
  rspec-core (~> 3.10.0)
23
62
  rspec-expectations (~> 3.10.0)
@@ -31,30 +70,28 @@ GEM
31
70
  diff-lcs (>= 1.2.0, < 2.0)
32
71
  rspec-support (~> 3.10.0)
33
72
  rspec-support (3.10.0)
34
- rubocop (1.5.2)
73
+ rubocop (1.26.1)
35
74
  parallel (~> 1.10)
36
- parser (>= 2.7.1.5)
75
+ parser (>= 3.1.0.0)
37
76
  rainbow (>= 2.2.2, < 4.0)
38
77
  regexp_parser (>= 1.8, < 3.0)
39
78
  rexml
40
- rubocop-ast (>= 1.2.0, < 2.0)
79
+ rubocop-ast (>= 1.16.0, < 2.0)
41
80
  ruby-progressbar (~> 1.7)
42
- unicode-display_width (>= 1.4.0, < 2.0)
43
- rubocop-ast (1.3.0)
44
- parser (>= 2.7.1.5)
81
+ unicode-display_width (>= 1.4.0, < 3.0)
82
+ rubocop-ast (1.16.0)
83
+ parser (>= 3.1.1.0)
45
84
  rubocop-rake (0.5.1)
46
85
  rubocop
47
- rubocop-rspec (2.0.1)
48
- rubocop (~> 1.0)
49
- rubocop-ast (>= 1.1.0)
50
- ruby-progressbar (1.10.1)
51
- super_diff (0.5.2)
86
+ rubocop-rspec (2.9.0)
87
+ rubocop (~> 1.19)
88
+ ruby-progressbar (1.11.0)
89
+ super_diff (0.8.0)
52
90
  attr_extras (>= 6.2.4)
53
91
  diff-lcs
54
92
  patience_diff
55
93
  thor (1.0.1)
56
- trollop (1.16.2)
57
- unicode-display_width (1.7.0)
94
+ unicode-display_width (2.1.0)
58
95
 
59
96
  PLATFORMS
60
97
  ruby
@@ -62,6 +99,8 @@ PLATFORMS
62
99
 
63
100
  DEPENDENCIES
64
101
  appraisal
102
+ dry-validation (~> 1.8)
103
+ glia-errors!
65
104
  prettier (~> 0.22)
66
105
  rake (~> 13.0)
67
106
  rspec (~> 3.10)
@@ -71,4 +110,4 @@ DEPENDENCIES
71
110
  super_diff
72
111
 
73
112
  BUNDLED WITH
74
- 2.2.4
113
+ 2.3.9
data/README.md CHANGED
@@ -33,7 +33,7 @@ glia_error = Glia::Errors::ResourceNotFoundError.new(resource: :engagement)
33
33
 
34
34
  Currently 2 `dry-validation` versions are supported:
35
35
  * `v0` up to `0.13`
36
- * `v1` up to `1.6`
36
+ * `v1` up to `1.8`
37
37
 
38
38
  ```ruby
39
39
  schema = Dry::Validation.Schema do
data/Rakefile CHANGED
@@ -25,12 +25,21 @@ task :install_test_deps do
25
25
  sh 'bundle exec appraisal install'
26
26
  end
27
27
 
28
- task test: %i[test_dry_validation_v1]
28
+ ruby_major_version = RUBY_VERSION.split('.').first.to_i
29
+
30
+ # dry-validation 0.x won't load in Ruby 3
31
+ if ruby_major_version < 3
32
+ task test: %i[test_dry_validation_v1 test_dry_validation_v0]
33
+ else
34
+ task test: :test_dry_validation_v1
35
+ end
29
36
 
30
37
  task test_dry_validation_v1: :install_test_deps do
31
38
  sh 'bundle exec appraisal dry_validation_v1 rspec'
32
39
  end
33
40
 
34
- task test_dry_validation_v0: :install_test_deps do
35
- sh 'bundle exec appraisal dry_validation_v0 rspec --tag dry_validation_v0'
41
+ if ruby_major_version < 3
42
+ task test_dry_validation_v0: :install_test_deps do
43
+ sh 'bundle exec appraisal dry_validation_v0 rspec --tag dry_validation_v0'
44
+ end
36
45
  end
@@ -10,7 +10,10 @@ gem "rubocop-rake", "~> 0.5"
10
10
  gem "rubocop-rspec", "~> 2.0"
11
11
  gem "super_diff"
12
12
  gem "dry-validation", "~> 0.13.0"
13
+ gem "dry-core", "~> 0.5.0"
13
14
 
14
15
  group :test do
15
16
  gem "appraisal"
16
17
  end
18
+
19
+ gemspec path: "../"
@@ -9,8 +9,10 @@ gem "rubocop", "~> 1.5"
9
9
  gem "rubocop-rake", "~> 0.5"
10
10
  gem "rubocop-rspec", "~> 2.0"
11
11
  gem "super_diff"
12
- gem "dry-validation", "~> 1.6.0"
12
+ gem "dry-validation", "~> 1.7"
13
13
 
14
14
  group :test do
15
15
  gem "appraisal"
16
16
  end
17
+
18
+ gemspec path: "../"
data/glia-errors.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'glia-errors'
8
- spec.version = '0.11.6'
8
+ spec.version = '0.11.9'
9
9
  spec.authors = ['Glia TechMovers']
10
10
  spec.email = ['techmovers@glia.com']
11
11
 
@@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.required_ruby_version = '~> 2.5'
22
+ spec.required_ruby_version = '>= 2.5', '< 4.0'
23
23
  end
@@ -57,6 +57,7 @@ module Glia
57
57
  TIME = 'time'
58
58
  UUID = 'uuid'
59
59
  URL = 'url'
60
+ REGULAR_EXPRESSION = 'regular_expression'
60
61
  end
61
62
 
62
63
  def initialize(field:, format: nil, message: nil)
@@ -87,6 +88,8 @@ module Glia
87
88
  'UUID'
88
89
  when Formats::URL
89
90
  'URL'
91
+ when Formats::REGULAR_EXPRESSION
92
+ 'regular expression'
90
93
  else
91
94
  raise 'Unexpected InvalidFormatError format'
92
95
  end
data/lib/glia/errors.rb CHANGED
@@ -13,7 +13,7 @@ module Glia
13
13
  dry_validation_version = Gem.loaded_specs['dry-validation'].version
14
14
  if dry_validation_version < Gem::Version.new('1.0')
15
15
  Mapper.from_dry_validation_result(result.output, result.errors, custom_error_map)
16
- elsif dry_validation_version <= Gem::Version.new('1.6')
16
+ elsif dry_validation_version <= Gem::Version.new('1.8')
17
17
  Mapper.from_dry_validation_result(result.to_h, result.errors.to_h, custom_error_map)
18
18
  else
19
19
  raise 'Unsupported dry-validation version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glia-errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.6
4
+ version: 0.11.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glia TechMovers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-20 00:00:00.000000000 Z
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email:
@@ -49,16 +49,19 @@ require_paths:
49
49
  - lib
50
50
  required_ruby_version: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.5'
55
+ - - "<"
56
+ - !ruby/object:Gem::Version
57
+ version: '4.0'
55
58
  required_rubygems_version: !ruby/object:Gem::Requirement
56
59
  requirements:
57
60
  - - ">="
58
61
  - !ruby/object:Gem::Version
59
62
  version: '0'
60
63
  requirements: []
61
- rubygems_version: 3.1.4
64
+ rubygems_version: 3.3.7
62
65
  signing_key:
63
66
  specification_version: 4
64
67
  summary: Glia REST API errors