validate_email 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -39,12 +39,12 @@ The gem only supports Rails 3 (has dependencies in ActiveModel and ActiveSupport
39
39
 
40
40
  #### I18n
41
41
 
42
- The default error message `is not valid email`.
42
+ The default error message `is not valid email`.
43
43
  You can pass the `:message => "my custom error"` option to your validation to define your own, custom message.
44
44
 
45
45
  ## Authors
46
46
 
47
- **Tanel Suurhans** (<http://twitter.com/tanelsuurhans>)
47
+ **Tanel Suurhans** (<http://twitter.com/tanelsuurhans>)
48
48
  **Tarmo Lehtpuu** (<http://twitter.com/tarmolehtpuu>)
49
49
 
50
50
  ## License
@@ -1,15 +1,12 @@
1
1
  require 'active_model'
2
2
  require 'active_model/validations'
3
- require 'active_support/concern'
4
3
  require 'mail'
5
4
 
6
5
  module Perfectline
7
6
  module ValidatesEmail
8
- extend ActiveSupport::Concern
9
-
10
7
  class EmailValidator < ActiveModel::EachValidator
11
8
  def initialize(options)
12
- options[:message] ||= "is not a valid email"
9
+ options.reverse_merge!(:message => "is not valid email")
13
10
  super(options)
14
11
  end
15
12
 
@@ -33,4 +30,5 @@ module Perfectline
33
30
  end
34
31
  end
35
32
 
36
- ActiveModel::Validations.send(:include, Perfectline::ValidatesEmail)
33
+ ActiveModel::Validations::HelperMethods.send(:include, Perfectline::ValidatesEmail::ClassMethods)
34
+ ActiveModel::Validations::EmailValidator = Perfectline::ValidatesEmail::EmailValidator
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tanel Suurhans
@@ -15,14 +15,13 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-08 00:00:00 +03:00
18
+ date: 2010-09-16 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rspec
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
@@ -35,7 +34,6 @@ dependencies:
35
34
  name: diff-lcs
36
35
  prerelease: false
37
36
  requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
37
  requirements:
40
38
  - - ">="
41
39
  - !ruby/object:Gem::Version
@@ -50,7 +48,6 @@ dependencies:
50
48
  name: mail
51
49
  prerelease: false
52
50
  requirement: &id003 !ruby/object:Gem::Requirement
53
- none: false
54
51
  requirements:
55
52
  - - ">="
56
53
  - !ruby/object:Gem::Version
@@ -62,10 +59,9 @@ dependencies:
62
59
  type: :runtime
63
60
  version_requirements: *id003
64
61
  - !ruby/object:Gem::Dependency
65
- name: activesupport
62
+ name: activemodel
66
63
  prerelease: false
67
64
  requirement: &id004 !ruby/object:Gem::Requirement
68
- none: false
69
65
  requirements:
70
66
  - - ">="
71
67
  - !ruby/object:Gem::Version
@@ -75,20 +71,6 @@ dependencies:
75
71
  version: "3.0"
76
72
  type: :runtime
77
73
  version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: activemodel
80
- prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- segments:
87
- - 3
88
- - 0
89
- version: "3.0"
90
- type: :runtime
91
- version_requirements: *id005
92
74
  description: Library for validating email addresses in Rails 3 models.
93
75
  email:
94
76
  - tanel.suurhans@perfectline.ee
@@ -104,12 +86,6 @@ files:
104
86
  - install.rb
105
87
  - lib/validates_email.rb
106
88
  - rails/init.rb
107
- - spec/resources/user.rb
108
- - spec/resources/user_with_blank.rb
109
- - spec/resources/user_with_legacy_syntax.rb
110
- - spec/resources/user_with_nil.rb
111
- - spec/spec_helper.rb
112
- - spec/validate_email_spec.rb
113
89
  has_rdoc: true
114
90
  homepage: http://github.com/perfectline/validates_email/tree/master
115
91
  licenses: []
@@ -120,7 +96,6 @@ rdoc_options:
120
96
  require_paths:
121
97
  - lib
122
98
  required_ruby_version: !ruby/object:Gem::Requirement
123
- none: false
124
99
  requirements:
125
100
  - - ">="
126
101
  - !ruby/object:Gem::Version
@@ -128,7 +103,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
103
  - 0
129
104
  version: "0"
130
105
  required_rubygems_version: !ruby/object:Gem::Requirement
131
- none: false
132
106
  requirements:
133
107
  - - ">="
134
108
  - !ruby/object:Gem::Version
@@ -138,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
112
  requirements: []
139
113
 
140
114
  rubyforge_project:
141
- rubygems_version: 1.3.7
115
+ rubygems_version: 1.3.6
142
116
  signing_key:
143
117
  specification_version: 3
144
118
  summary: Library for validating email addresses in Rails 3 models.
@@ -148,4 +122,4 @@ test_files:
148
122
  - spec/resources/user_with_legacy_syntax.rb
149
123
  - spec/resources/user_with_nil.rb
150
124
  - spec/spec_helper.rb
151
- - spec/validate_email_spec.rb
125
+ - spec/validates_email_spec.rb