validates 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Validates
2
+
3
+ ## Summary
4
+
5
+ Email, Slug, Url simple format validators for Rails 3
6
+
7
+ ## Installing
8
+
9
+ Add this to your `Gemfile`:
10
+
11
+ gem "validates"
12
+
13
+ ## Usage
14
+
15
+ model User < ActiveRecord::Base
16
+ validate :email, :presence => true, :email => true
17
+ validate :site, :presence => true, :url => true, :allow_nil => true
18
+ end
19
+
20
+ model Page < ActiveRecord::Base
21
+ validate :slug, :presence => true, :slug => true
22
+ end
23
+
24
+
25
+ ## Relise notes
26
+
27
+ 0.0.2 - Fixed email validator. If email not presence, should be validate anyway.
28
+
29
+ ## Similar
30
+
31
+ * http://github.com/balexand/email_validator
32
+ * http://github.com/cesario/activevalidators
33
+ * https://rubygems.org/gems/date_validator
34
+ * and more...
@@ -1,6 +1,5 @@
1
1
  class EmailValidator < ActiveModel::EachValidator
2
2
  def validate_each(record, attribute, value)
3
- return if value.blank?
4
3
  unless value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
5
4
  record.errors.add(attribute, :email, options.merge(:value => value))
6
5
  end
@@ -1,3 +1,3 @@
1
1
  module Validates
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,50 +1,37 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: validates
3
- version: !ruby/object:Gem::Version
4
- hash: 29
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Mikhail Stolbov
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-17 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-23 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: activemodel
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &75471680 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 7
29
- segments:
30
- - 3
31
- - 0
32
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 3.0.0
34
22
  type: :runtime
35
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: *75471680
36
25
  description: Email, Slug, Url validators for Rails 3
37
- email:
26
+ email:
38
27
  - mstolbov@gmail.com
39
28
  executables: []
40
-
41
29
  extensions: []
42
-
43
30
  extra_rdoc_files: []
44
-
45
- files:
31
+ files:
46
32
  - .gitignore
47
33
  - Gemfile
34
+ - README.md
48
35
  - Rakefile
49
36
  - lib/validates.rb
50
37
  - lib/validates/email_validator.rb
@@ -54,36 +41,26 @@ files:
54
41
  - validates.gemspec
55
42
  homepage: https://github.com/kaize/validates
56
43
  licenses: []
57
-
58
44
  post_install_message:
59
45
  rdoc_options: []
60
-
61
- require_paths:
46
+ require_paths:
62
47
  - lib
63
- required_ruby_version: !ruby/object:Gem::Requirement
48
+ required_ruby_version: !ruby/object:Gem::Requirement
64
49
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
70
- - 0
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
55
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
- version: "0"
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
81
60
  requirements: []
82
-
83
61
  rubyforge_project: validates
84
62
  rubygems_version: 1.8.10
85
63
  signing_key:
86
64
  specification_version: 3
87
65
  summary: Collection of simple validators for Rails 3
88
66
  test_files: []
89
-