veto 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 9e305094f3935b538af7cd8c9d0c7e7e161184c5
4
- data.tar.gz: f7036823f2d394a118e988c74921c04c592a3014
3
+ metadata.gz: 569cf65f25931b9a8ae0f2a357d7163c04195fa8
4
+ data.tar.gz: c95247aed3ff88dd2e413e5d48c05fa13b6fb63b
5
5
  SHA512:
6
- metadata.gz: 2d53f44223ba0e643bb49cb743497df739dbb636ea83c6a92c15a1d572ecaf709637a69e077cbe6458906f9d753b7b9f461d02c4e84891bf9d1708f6db375381
7
- data.tar.gz: 6fd789da9b2c6308c6c792582bc1d49a7bba6e130ad810b9d485234aeb5688076f768a707c240bcd66c36978c0e7417ae6ddee7d4959b0f43b0865249ef0a9e1
6
+ metadata.gz: 2159bc303f0dd6ba0fa69b3ba497abeec0981893e6b630bd235fe7378207588a22b3d65913fc98a9efd491b67182bd5c1eccedfa436816e3ef18137efec3bec3
7
+ data.tar.gz: 88f37e7ebc017a26b23dab4303ca28e8abd885286caa5fbc4c7f5f35bf30708c602ddaf39c65e4b8308d060a2e875ba5e8fbf29df93fbaa88e1de2fcedc652cb
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
3
+ - 2.0.0
4
+ - 1.9.3
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Veto provides lightweight validation for plain old ruby objects, using a familiar DSL.
4
4
 
5
- Tested on the following Rubies: MRI 2.0.0.
5
+ Tested on the following Rubies: MRI 2.0.0, 1.9.3
6
6
 
7
7
  [![Build Status](https://travis-ci.org/kodio/veto.png)](https://travis-ci.org/kodio/veto)
8
8
 
@@ -32,8 +32,8 @@ $ gem install veto
32
32
  class PersonValidator
33
33
  include Veto.validator
34
34
 
35
- validate :name, :presence => true
36
- validate :age, :inclusion => 0..100
35
+ validates :name, :presence => true
36
+ validates :age, :inclusion => 0..100
37
37
  end
38
38
 
39
39
  # Create an entity
@@ -16,12 +16,12 @@ require 'veto/validators/presence_validator'
16
16
  module Veto
17
17
  class AttributeValidatorFactory
18
18
  def self.new_validator type, attribute, options={}
19
- klass_name = "::Veto::#{camel_case(type.to_s)}Validator"
19
+ klass_name = "#{camel_case(type.to_s)}Validator"
20
20
 
21
21
  begin
22
- klass = const_get(klass_name)
22
+ klass = Veto.const_get(klass_name)
23
23
  rescue NameError => e
24
- raise(ArgumentError, "Validator not found: #{klass_name}")
24
+ raise(ArgumentError, "Validator not found: ::Veto::#{klass_name}")
25
25
  end
26
26
 
27
27
  klass.new(attribute, options)
@@ -8,8 +8,6 @@ module Veto
8
8
  base.extend ClassMethods
9
9
  end
10
10
 
11
-
12
-
13
11
  module ClassMethods
14
12
  def with_options *args, &block
15
13
  builder.with_options(*args, &block)
data/lib/veto/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Veto
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Lott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-08 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -177,4 +177,3 @@ test_files:
177
177
  - spec/validators/numeric_validator_spec.rb
178
178
  - spec/validators/presence_validator_spec.rb
179
179
  - spec/veto_spec.rb
180
- has_rdoc: