validates_swift 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/swift_validator.rb +4 -6
- data/lib/validates_swift/version.rb +1 -1
- metadata +13 -14
- data/lib/tasks/validates_swift_tasks.rake +0 -4
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZDkxNjlkYjExNzVkN2U4MjUwNmRlNjkwYjAzMTk3YTA3N2Y0YmExMQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 589d7fecbffd818b52cabe056e362d631cc0e4ca
|
4
|
+
data.tar.gz: 12a30f60eed52013e7f827656d8bd0e640b92c02
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDE3NmJiNDhiZWNhNjA2MTM4N2EyYWFlOGEzMDRlMTQ0MzYxOTJkYzI3NDU4
|
11
|
-
YmRmMzY0ZDM4ZDBmZjRiOGJjMGE0YTQxMGI1OGFjZTc0ODE0Y2U=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YjQ1NGQyYjY1ODU1NzUwN2RhODc4NGI0ZjIyOTljODk4NjNlNzgwMzI3NGU5
|
14
|
-
NDY2NDk1ZWIyNThjYWQ4OWQ5MTg0MTFjZDJmYzg0NzU1MGQ4MjM0YjQ1ZGE4
|
15
|
-
ODkzNTE1NzVlNjBkNzFlNjNmNGU0ZWNjNDk2ODBmODljZWU1MjY=
|
6
|
+
metadata.gz: be4379681baa0f6d8f6a956b74418099adcb3d86bd2d4c831038e29c714be9554e1bcff818034c01736dd660886e29d9cdc0fee35b48be08a1863289b49071a1
|
7
|
+
data.tar.gz: 5a79ea0f7c4a6c233b97b3c44a333e0d2d290d386a206c1d53e47f0d0189c779ebba05531b6608b3c4dbd03057ebbb03248a62ec9fcdb07c2c488e2b088af15a
|
data/lib/swift_validator.rb
CHANGED
@@ -2,13 +2,11 @@ require_relative "swift-code-tool/lib/swift-code"
|
|
2
2
|
|
3
3
|
class SwiftValidator < ActiveModel::EachValidator
|
4
4
|
def validate_each(object, attribute, value)
|
5
|
-
|
6
|
-
|
7
|
-
errors = swift.validation_errors(nil)
|
5
|
+
swift = SWIFTCodeTool::SWIFT.new(value.to_s)
|
6
|
+
errors = swift.validation_errors(nil)
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
end
|
8
|
+
unless errors.empty?
|
9
|
+
object.errors[attribute] << (options[:message] || "is not a valid SWIFT code: #{errors.join(", ")}")
|
12
10
|
end
|
13
11
|
end
|
14
12
|
end
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_swift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: codeclimate-test-reporter
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: SWIFT validator for ActiveRecord attributes.
|
@@ -79,7 +79,6 @@ files:
|
|
79
79
|
- lib/swift-code-tool/README.md
|
80
80
|
- lib/swift-code-tool/lib/swift-code.rb
|
81
81
|
- lib/swift_validator.rb
|
82
|
-
- lib/tasks/validates_swift_tasks.rake
|
83
82
|
- lib/validates_swift.rb
|
84
83
|
- lib/validates_swift/version.rb
|
85
84
|
homepage: https://www.github.com/kaspernj/validates_swift
|
@@ -91,17 +90,17 @@ require_paths:
|
|
91
90
|
- lib
|
92
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
92
|
requirements:
|
94
|
-
- -
|
93
|
+
- - ">="
|
95
94
|
- !ruby/object:Gem::Version
|
96
95
|
version: '0'
|
97
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
97
|
requirements:
|
99
|
-
- -
|
98
|
+
- - ">="
|
100
99
|
- !ruby/object:Gem::Version
|
101
100
|
version: '0'
|
102
101
|
requirements: []
|
103
102
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.4.
|
103
|
+
rubygems_version: 2.4.0
|
105
104
|
signing_key:
|
106
105
|
specification_version: 4
|
107
106
|
summary: SWIFT validator for ActiveRecord attributes.
|