simple_validate 1.1.2 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +10 -1
- data/Rakefile +1 -1
- data/lib/simple_validate/version.rb +1 -1
- data/lib/simple_validate.rb +12 -9
- data/simple_validate.gemspec +2 -3
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: '088622398860ce0640092a27f1f6a20cf1c6888f'
|
4
|
+
data.tar.gz: 97156629872295a0d1b1134a0d27467b74568a12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbd5436dee6f843d1c1759fe509271204ed4bd87f7c268a90c6930f345c41d6c8c8cbde5604d3d903fa33958fcecda0169007223e378a3cb1fee4bec43b0db3b
|
7
|
+
data.tar.gz: 0f863a046f6dbec9e8c311b3feb2a1019b4945f607743e3755dfba02c570bfb0c93d2c9cc619d7c8ad9f607943abc4ec188bb647e15ec8c59b6efb5205c6f327
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/simple_validate.rb
CHANGED
@@ -15,19 +15,22 @@ require 'active_support/all'
|
|
15
15
|
|
16
16
|
module SimpleValidate
|
17
17
|
def self.included(klass)
|
18
|
-
klass.extend
|
18
|
+
klass.extend(ClassMethods)
|
19
|
+
klass.include(InstanceMethods)
|
19
20
|
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
module InstanceMethods
|
23
|
+
def valid?
|
24
|
+
self.class.validate(self)
|
25
|
+
end
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
def invalid?
|
28
|
+
!valid?
|
29
|
+
end
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
+
def errors
|
32
|
+
@errors ||= Errors.new
|
33
|
+
end
|
31
34
|
end
|
32
35
|
|
33
36
|
module ClassMethods
|
data/simple_validate.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require 'simple_validate/version'
|
4
4
|
|
@@ -19,6 +19,5 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
spec.add_dependency 'activesupport', '~> 5.0'
|
22
|
-
spec.add_development_dependency '
|
23
|
-
spec.add_development_dependency 'rubocop'
|
22
|
+
spec.add_development_dependency 'bundler'
|
24
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_validate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Palaniuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01
|
11
|
+
date: 2018-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -25,21 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
28
|
+
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - ">="
|
@@ -99,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
85
|
version: '0'
|
100
86
|
requirements: []
|
101
87
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.6.13
|
103
89
|
signing_key:
|
104
90
|
specification_version: 4
|
105
91
|
summary: Validations for any plain old ruby object
|