romanianvalidators 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +33 -4
- data/romanianvalidators.gemspec +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -6,13 +6,42 @@ Rails validators for:
|
|
6
6
|
* Cod de identificare fiscală (CIF) and
|
7
7
|
* IBAN (only Romanian format as published by Romanian National Bank).
|
8
8
|
|
9
|
-
|
9
|
+
## Installation
|
10
10
|
|
11
|
+
### In a Rails 3 app, as a gem
|
11
12
|
|
12
|
-
|
13
|
+
First include it in your Gemfile.
|
13
14
|
|
14
|
-
|
15
|
+
$ cat Gemfile
|
16
|
+
...
|
17
|
+
gem 'romanianvalidations'
|
18
|
+
...
|
15
19
|
|
16
|
-
|
20
|
+
Next install it with Bundler.
|
21
|
+
|
22
|
+
$ bundle install
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
In your models (ActiveModel), the gem provides the following new validators:
|
27
|
+
* CIF
|
28
|
+
* CNP
|
29
|
+
* IBAN
|
30
|
+
* BIC
|
31
|
+
|
32
|
+
The algorithms for validation are found in the source code.
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
class User
|
36
|
+
validates :cnp, :cnp => true
|
37
|
+
validates :company_cif, :cif => true
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
### TODO
|
42
|
+
|
43
|
+
* test more edge cases; test nil, blank; test messages; test in app
|
44
|
+
|
45
|
+
### Copyright
|
17
46
|
|
18
47
|
Copyright (c) 2007-2012 Mihai Târnovan. MIT LICENSE. See LICENSE for details.
|
data/romanianvalidators.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'romanianvalidators'
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.1'
|
5
5
|
s.authors = ['Mihai Târnovan']
|
6
6
|
s.email = ['mihai.tarnovan@cubus.ro']
|
7
7
|
s.homepage = 'http://github.com/mtarnovan/romanianvalidators'
|