dry_validation_parser 0.1.7 → 0.1.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: 3777412afd0ab74607ad2b0394fabb2837a686a95ccd85f393944be9d1929d25
4
- data.tar.gz: 293b9b8bc0b1e37328f3b941ecfc4e7ccf192e3920d504f50d0b9fa1ec630a26
3
+ metadata.gz: 75ce2204864c68abf5a09d7f1f0144ee2ea56582392b2970464a03492b32b965
4
+ data.tar.gz: 01f076dfc9c73452d77fd1d729daa29ed467135037c5c4043c03b4227d8c4971
5
5
  SHA512:
6
- metadata.gz: 01fcad7a5b06a6dab8b1486dc1969314938c7dae8af7f51408c5d5f7f09aab1b4364c3a0015e1a9dfd1468ebbbebd53443bfa6374d87a6ffd23a3e6e9ad0965f
7
- data.tar.gz: 3bfd883d74430f57d04471fd6fd058b5f3511de29379176cd5d185ff94904691a152493600e3697d03b046ca902ffe8f932d744ff37fe0172d6b7fa05343fa9a
6
+ metadata.gz: 9b1ab40c6a3b6bf2fae2df3af5013133213a6126f47a24ff54b3903f64f9ccfb38425957418ddfa0e96713fa909c0702037776022c43f718f6a44da1f7cbf288
7
+ data.tar.gz: ea4e75f373e8a4080d278dd49d78e49bdc5260c94be58539d3bc696c79110f3b4cd111fa60d84aa486e617458a17ad0403154fe51d1f3aa8cb53ea679aa7aed8
data/.rubocop.yml CHANGED
@@ -2,6 +2,7 @@ AllCops:
2
2
  TargetRubyVersion: 2.6
3
3
  Exclude:
4
4
  - 'spec/**/*.rb'
5
+ - 'vendor/bundle/**/*'
5
6
 
6
7
  Style/StringLiterals:
7
8
  Enabled: true
@@ -26,6 +27,14 @@ Metrics/AbcSize:
26
27
  Metrics/BlockLength:
27
28
  Max: 40
28
29
 
29
- Style/ClassVars:
30
- Enabled: false
30
+ Metrics/ClassLength:
31
+ Max: 200
32
+
33
+ Metrics/PerceivedComplexity:
34
+ Max: 15
31
35
 
36
+ Metrics/CyclomaticComplexity:
37
+ Max: 15
38
+
39
+ Style/ClassVars:
40
+ Enabled: false
@@ -7,7 +7,7 @@ module DryValidationParser
7
7
  bool?: "boolean",
8
8
  date?: "date",
9
9
  date_time?: "datetime",
10
- decimal?: "float",
10
+ decimal?: "decimal",
11
11
  float?: "float",
12
12
  hash?: "hash",
13
13
  int?: "integer",
@@ -17,13 +17,13 @@ module DryValidationParser
17
17
  }.freeze
18
18
 
19
19
  DESCRIPTION_MAPPING = {
20
- eql?: "Must be equal to %{value}",
21
- max_size?: "Maximum size: %{value}",
22
- min_size?: "Minimum size: %{value}",
23
- gteq?: "Greater than or equal to %{value}",
24
- gt?: "Greater than %{value}",
25
- lt?: "Lower than %{value}",
26
- lteq?: "Lower than or equal to %{value}",
20
+ eql?: "Must be equal to %<value>s",
21
+ max_size?: "Maximum size: %<value>s",
22
+ min_size?: "Minimum size: %<value>s",
23
+ gteq?: "Greater than or equal to %<value>s",
24
+ gt?: "Greater than %<value>s",
25
+ lt?: "Lower than %<value>s",
26
+ lteq?: "Lower than or equal to %<value>s"
27
27
  }.freeze
28
28
 
29
29
  # @api private
@@ -127,12 +127,8 @@ module DryValidationParser
127
127
  end
128
128
 
129
129
  def predicate_description(name, value)
130
- if ::I18n.locale_available?(::I18n.locale)
131
- ::I18n.t("contract.descriptions.#{name}", value: value, default: '')
132
- else
133
- description = DESCRIPTION_MAPPING[name]
134
- description ? description % { value: value } : ""
135
- end
130
+ description = DESCRIPTION_MAPPING[name]
131
+ description ? format(description, value: value) : ""
136
132
  end
137
133
  end
138
134
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DryValidationParser
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.9"
5
5
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  require_relative "dry_validation_parser/version"
4
4
  require_relative "dry_validation_parser/validation_schema_parser"
5
- require 'i18n'
6
5
 
7
6
  module DryValidationParser
8
7
  class Error < StandardError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry_validation_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jane-Terziev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-12 00:00:00.000000000 Z
11
+ date: 2024-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types