simple_validate 1.0.0 → 1.1.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
  SHA1:
3
- metadata.gz: 3f47a10de1d9a4052b119189c72c76b87dadbc58
4
- data.tar.gz: be46f20b574db68989edf69b23c6d73a599be285
3
+ metadata.gz: 2b66b60f0a9d476fb86881e5b17ee72f0e1e9066
4
+ data.tar.gz: 52e6993234ccd0e4fae8afcd81e0276557236ba0
5
5
  SHA512:
6
- metadata.gz: b1e5761c25c9f5e1f4de99243f8e3c512891546de63a3bb42c89ed7b9a00dd7fa735ef275f0ecd605f73ddc80ddd17f383196ec3f5b7be185174ca1dd60a5ee5
7
- data.tar.gz: 4cf5a016ec9b15c684814c13cf118eb87ae1cde303e638bb9632a6fcff7f34669d884191f8cbbf8a949d4bd116c678efd1d296dff821d1a24857a85d72408854
6
+ metadata.gz: aac062013d71ec0e0bf6774b53a7844b7d6921cc26fbb2d1c078859cbaf219d73781adf6941fa30254f055838c81c44197087ba414f43a9e5d21b487c07d542b
7
+ data.tar.gz: 8cef015dc626644815c1c5c7b28b31ab3b765fb0411c0814fce80576821a85eea95b85fade43f051e2390f8bac143bb9867dfb31050382f9c68541826fb0563f
@@ -1,8 +1,7 @@
1
1
  module SimpleValidate
2
2
  class ValidatesNumericalityOf < ValidatesBase
3
-
4
3
  def initialize(attribute, options)
5
- super(attribute, options[:message] || "must be a number")
4
+ super(attribute, options[:message] || 'must be a number')
6
5
  end
7
6
 
8
7
  def valid?(instance)
@@ -1,3 +1,3 @@
1
1
  module SimpleValidate
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -26,13 +26,8 @@ module SimpleValidate
26
26
 
27
27
  module ClassMethods
28
28
  def method_missing(method, *args, &block)
29
- if "#{method}" =~ /(validates_
30
- (format|
31
- presence|
32
- numericality|
33
- length)_of)
34
- /x
35
- add_validations(args, const_get($1.classify))
29
+ if respond_to_missing?(method)
30
+ add_validations(args, const_get("#{method}".classify))
36
31
  else
37
32
  super
38
33
  end
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Nick Palaniuk']
10
10
  spec.email = ['npalaniuk@gmail.com']
11
11
 
12
- spec.summary = %q(Validations for any plain old ruby object)
13
- spec.description = %q(Validations for any ruby object)
12
+ spec.summary = 'Validations for any plain old ruby object'
13
+ spec.description = 'Validations for any ruby object'
14
14
  spec.homepage = 'https://github.com/nikkypx/simple_validate'
15
15
  spec.license = 'MIT'
16
16
 
@@ -19,7 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
+ spec.add_dependency 'activesupport', '~> 4.2'
22
23
  spec.add_development_dependency 'bundler', '~> 1.11'
23
- spec.add_development_dependency 'rake', '~> 10.0'
24
- spec.add_development_dependency 'rspec', '~> 3.0'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'rspec', '~> 3.0'
25
26
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_validate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Palaniuk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement