glia-errors 0.11.7 → 0.11.10

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: d71a904099bb9ddc69b22b6f8781ec5f73d30f15db34a117f92b0dde9700b2e3
4
- data.tar.gz: 58dab077b61ebf6143d38afdcc3a8468a3ccdfe57586a099bf26633482d93526
3
+ metadata.gz: 182a479821307d1d9b7fd5b1ba47ee4bbeb5cb8c69c6e58963d387b8b383b92b
4
+ data.tar.gz: 988265708f5ed2a46d14a05c39ec2b526f27ef540959f5d234a749cb7290c8b5
5
5
  SHA512:
6
- metadata.gz: 5a8c8fc492018dbc59f262b3068c7e81b42a88b477e67698f52c8b70e35543ca73fa4281d721cecabaeda2084f7749157a33ce3e24ce97d28fa887dc0c210779
7
- data.tar.gz: 72ce9907b06c59e05d5920a18bf00920dfca7ef49145509f949adf3bed8190a303896e7901b31dca542d64bd36efeefd041dcc8c00bb86a5cf1bc5ed91e3cbf9
6
+ metadata.gz: c83b5503cd6904ac367f1afbebcdf9e45a380bdaacb28d0ff10a414ef68cffd2d7ea8dbf227b1577427108c5ced9a636c5cf4fe71500adbfe20a2981e5fccf5b
7
+ data.tar.gz: 594b6ab2e41d8219cfe587db80e5c04684b780f7c9eb74dcc90289c84ccd2ecfcf49a942ba74ce64d042b5039895a7c9831397682933131284496d030c281e33
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,10 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'dry_validation_v0' do
4
- gem 'dry-core', '~> 0.5.0'
5
- 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
6
10
  end
7
11
 
8
12
  appraise 'dry_validation_v1' do
9
- gem 'dry-validation', '~> 1.7.0'
13
+ gem 'dry-validation', '~> 1.8'
10
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.10)
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.7`
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 test_dry_validation_v0]
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
@@ -9,9 +9,11 @@ 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-core", "~> 0.5.0"
13
12
  gem "dry-validation", "~> 0.13.0"
13
+ gem "dry-core", "~> 0.5.0"
14
14
 
15
15
  group :test do
16
16
  gem "appraisal"
17
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.7.0"
12
+ gem "dry-validation", "~> 1.8"
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.7'
8
+ spec.version = '0.11.10'
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.7')
16
+ elsif dry_validation_version <= Gem::Version.new('2.0')
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.7
4
+ version: 0.11.10
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-02-08 00:00:00.000000000 Z
11
+ date: 2022-06-10 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