sinatra-param-validator 0.8.0 → 0.9.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: e29508460ddab60a223a9a68607cf1463c71b4bec8b4aa8fc74596d25174a296
4
- data.tar.gz: 2e25b479bfe8de0cde6eae7ccc2bb060ea66dee9d547120d5daca616d1c87f42
3
+ metadata.gz: f17b821ad13e5656480453ed3067bc2cb724cfc51dc71b89673ebbd29bf06cff
4
+ data.tar.gz: b4a333cc414c4fdb0ba9ba9cbc5da317037bbc0a08879f8f120c70996ce41073
5
5
  SHA512:
6
- metadata.gz: b373671727a80340866970d2f1ef3b327735d622bcccad5bd27fcdf622351790cf017d0f516280ed741956ab1c0d249c6d546bad3b2a07f08c5943ca324f0437
7
- data.tar.gz: 57c9eeb497333f36fb2eb2167edf4bd47df88139bcd29e6201402893c325ec3bb4888254278a7ab46a2f6d185079a5e7173478ba510f3b621af47b39fb68fe7e
6
+ metadata.gz: fd06efb152939cecc5ea1169426c4cded4177ad2a71b678a217899e246c4def5826457339b8a9f5a2afedc3044af53e4a41728f04ae6180cfdfc2efc5048e6f6
7
+ data.tar.gz: 90133f0e8bda179eafc1e193bcb4caa2466ece28efc20c17e3521e30a18a505d58d26f0ba6e0ff79fb88119bdcbeb9f2b4932ca7b6882e98c351eed0d1509a0d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.9.0] - 2022-07-09
4
+
5
+ - Change parser to parse the definition outside of the initialize block
6
+
3
7
  ## [0.8.0] - 2022-07-09
4
8
 
5
9
  - Add form helpers for form validator
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sinatra-param-validator (0.8.0)
4
+ sinatra-param-validator (0.9.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,12 +12,16 @@ module Sinatra
12
12
  class Parser < SimpleDelegator
13
13
  attr_reader :errors
14
14
 
15
- def initialize(definition, context, *args)
15
+ def initialize(context)
16
16
  super(context)
17
17
  @context = context
18
18
  @errors = {}
19
+ end
19
20
 
21
+ def parse(definition, *args)
20
22
  instance_exec(*args, &definition)
23
+
24
+ self
21
25
  end
22
26
 
23
27
  def add_error(key, error)
@@ -16,7 +16,7 @@ module Sinatra
16
16
  end
17
17
 
18
18
  def run(context, *args)
19
- @errors = Parser.new(@definition, context, *args).errors
19
+ @errors = Parser.new(context).parse(@definition, *args).errors
20
20
  end
21
21
 
22
22
  def success?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sinatra
4
4
  module ParamValidator
5
- VERSION = '0.8.0'
5
+ VERSION = '0.9.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-param-validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Selby