level_travel 0.6.0 → 0.7.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: b0844303ab184bf8b8ceaa7896691acf40a9489fe03ef48985a6e359aa492e84
4
- data.tar.gz: 2ee5a79a248d9848570897a952da85031df371bcc934df1e691d202c5000c098
3
+ metadata.gz: 9697ffaaaa107ccb7205966bc304a3eacec9eb6cc7e6831ea4d0bb61d37b2a40
4
+ data.tar.gz: 0aa7ab86d88af6bfac038754e1af580e59e0c8d797694ed2eb7ecb98bc425387
5
5
  SHA512:
6
- metadata.gz: c31fab7d9e96887687307a12e93d577b168eb41134bd18fe5655f5d43a5302ed34f1ffc167126019dbc41b754b821c82ec699cc8de1b9a999bb82769b9fc22ea
7
- data.tar.gz: 46267bd8d0b94ee6862e8ef1bef36f7e8fff56cbfe9b894b7653c999adb5aedec0c5cb9fce896a8ef15ab47ad41dca9d285dad2fc2ca328be10daf900f778502
6
+ metadata.gz: 683711500c159603a0eaee0abb7dd94e945fb263d052d1f3bf193c5a877c65cdf620ebfbcb71dc3137faaf791cb746d66b4f677347e6df2fd60984eae4fdc31f
7
+ data.tar.gz: 389bf9833ee7500f066334fb4cd749bdf12fa95512bccedcf9c750e38e859f49bbf8ff22b7f1da0a0871b365b8a7fa5fde5692f049eb9a7c962277bc3893333a
@@ -0,0 +1,14 @@
1
+ en:
2
+ level_travel:
3
+ errors:
4
+ rules:
5
+ start_date:
6
+ invalid: 'must be in the future'
7
+ stars_from:
8
+ not_in_range: "must be in range of %{range}"
9
+ stars_to:
10
+ not_in_range: "must be in range of %{range}"
11
+ kids_ages:
12
+ required: "is required"
13
+ not_in_range: "must be in range of %{range}"
14
+ not_equal_to_kids: "number of kids_ages is not equal to kids %{actual} != %{needed}"
@@ -6,7 +6,7 @@ module LevelTravel
6
6
  class ParamsContract < Dry::Validation::Contract
7
7
  config.messages.default_locale = :en
8
8
  config.messages.top_namespace = 'level_travel'
9
- config.messages.load_paths << File.expand_path('../../../config/errors.yml', __dir__).freeze
9
+ config.messages.load_paths << ::LevelTravel::Settings.error_load_path
10
10
 
11
11
  RANGES = {
12
12
  stars: (1..5).freeze,
@@ -5,7 +5,7 @@ module LevelTravel
5
5
  class ParamsContract < Dry::Validation::Contract
6
6
  config.messages.default_locale = :en
7
7
  config.messages.top_namespace = 'level_travel'
8
- config.messages.load_paths << File.expand_path('../../../config/errors.yml', __dir__).freeze
8
+ config.messages.load_paths << ::LevelTravel::Settings.error_load_path
9
9
 
10
10
  RANGES = {
11
11
  stars: (1..5).freeze,
@@ -5,6 +5,7 @@ module LevelTravel
5
5
  module_function
6
6
 
7
7
  DEFAULT_TIMEOUT = 10
8
+ DEFAULT_ERROR_LOAD_PATH = File.expand_path('../config/errors.yml', __dir__).freeze
8
9
 
9
10
  def api_token
10
11
  @api_token
@@ -14,6 +15,14 @@ module LevelTravel
14
15
  @api_token = token
15
16
  end
16
17
 
18
+ def error_load_path
19
+ @error_load_path || DEFAULT_ERROR_LOAD_PATH
20
+ end
21
+
22
+ def error_load_path=(paths)
23
+ @error_load_path = paths
24
+ end
25
+
17
26
  def timeout
18
27
  @timeout || DEFAULT_TIMEOUT
19
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LevelTravel
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: level_travel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Rodionov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-16 00:00:00.000000000 Z
11
+ date: 2020-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '10.0'
117
+ version: '13.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '10.0'
124
+ version: '13.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: reek
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 5.5.0
131
+ version: 5.6.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 5.5.0
138
+ version: 5.6.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.78.0
159
+ version: 0.80.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.78.0
166
+ version: 0.80.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubocop-rspec
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -219,6 +219,7 @@ files:
219
219
  - bin/console
220
220
  - bin/setup
221
221
  - bin/test
222
+ - lib/config/errors.yml
222
223
  - lib/level_travel.rb
223
224
  - lib/level_travel/hot_tours/get.rb
224
225
  - lib/level_travel/hot_tours/params.rb