dry_validation_parser 0.1.2 → 0.1.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: 55534e4e0a5aba7408ed7e145abe48d5017becd36313f95ad8948af219cdfe24
4
- data.tar.gz: 0572b97dfee11dbc4a6c0862517867abfaec77b3c5526e57b6ebf221ac47f583
3
+ metadata.gz: 3f26fc4ef76b2db622187a6828bbee303a39bc2877d8d3b1f1005cf69a93efa2
4
+ data.tar.gz: 5a6a30ac70fdd3065313442c055ceafa3de7fedf3677c2ee6301967c539a0ba7
5
5
  SHA512:
6
- metadata.gz: 19f6543ce37c88b956f5c6bfe6dfba9f8a4298b04f5a3ddc4f3a31207f53389b63bf564564e7e0d0d45adabc5e52b4f96b377712c5b2db6f9ea04871302650d6
7
- data.tar.gz: 8ec8152ebc5579bbf37ba768269286fa41b283931b21693893c770ef1ffc7b4e675c3d0132e94f872e6f13ce9139b8a7a0ec2f20d08bea383fb3a19a171eec94
6
+ metadata.gz: 2325960029165a39c80d061845ee8820f3b5542433b35884763855dc9f4f45462c0178fa12b8e6b635bd20e459dc2e10518c914ca9b1e8a64d18c02e0cd381cd
7
+ data.tar.gz: 016a50094f19f0db48106b2bc7e60e2829871276c20c781453bae490a7abcdd6b02838b808e00cec8b4ffb51c12c95ef9fbeead3b39e20048e5783ef16e55d37
@@ -106,7 +106,18 @@ module DryValidationParser
106
106
  keys[key][:enum] += [nil] if opts.fetch(:nullable, false)
107
107
  elsif PREDICATE_TO_TYPE[name]
108
108
  keys[key][:type] = PREDICATE_TO_TYPE[name]
109
+ else
110
+ description = predicate_description(name.to_s, rest[0][1].to_s)
111
+ if keys[key][:description].to_s.empty?
112
+ keys[key][:description] = description unless description.to_s.empty?
113
+ else
114
+ keys[key][:description] += ", #{description}" unless description.to_s.empty?
115
+ end
109
116
  end
110
117
  end
118
+
119
+ def predicate_description(name, value)
120
+ "#{name}: #{value}"
121
+ end
111
122
  end
112
123
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DryValidationParser
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
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_relative "dry_validation_parser/railtie" if defined?(Rails)
6
5
 
7
6
  module DryValidationParser
8
7
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry_validation_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jane-Terziev
@@ -55,7 +55,6 @@ files:
55
55
  - README.md
56
56
  - Rakefile
57
57
  - lib/dry_validation_parser.rb
58
- - lib/dry_validation_parser/railtie.rb
59
58
  - lib/dry_validation_parser/types.rb
60
59
  - lib/dry_validation_parser/validation_schema_parser.rb
61
60
  - lib/dry_validation_parser/version.rb
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "dry_validation_parser"
4
- require "rails"
5
-
6
- module DryValidationParser
7
- class Railtie < Rails::Railtie
8
- railtie_name :dry_validation_parser
9
- end
10
- end