validate_as_email 1.0.3 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c4e43022d1ae5d9b834816f63c08962132616a7a
4
+ data.tar.gz: 0c419c10c164cff6da3a9a3bda12d12108caa02b
5
+ SHA512:
6
+ metadata.gz: 8563886c52bdcadfad554953c824cd7666dc0e1f45272fbe2bfdae3c3f07d70fe027751ecdc1f68fa35502a134c926605d41dc5daf6c933be184a45e1c6b7b38
7
+ data.tar.gz: 77597d2470f2439ad90ed23e69141dac8f7f642acbc09b62c85ac71cc41583a1f442ddb9201edcdccc472c59680809bb9502eae03254dbde47191aaace9b796f
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
- # ValidateAsEmail [![Build Status](https://secure.travis-ci.org/evently/validate_as_email.png?branch=master)](http://travis-ci.org/evently/validate_as_email) [![CodeClimate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/evently/validate_as_email)
1
+ # Validate as Email
2
+
3
+ [![Build Status](https://travis-ci.org/listora/validate_as_email.png?branch=master)](https://travis-ci.org/listora/validate_as_email)
2
4
 
3
5
  Validation of email addresses via the excellent Mail gem that is
4
- available in all Rails 3 applications.
6
+ available in all Rails 3 and 4 applications.
5
7
 
6
8
  ## Installation
7
9
 
@@ -19,11 +21,11 @@ Or install it yourself as:
19
21
 
20
22
  ## Usage
21
23
 
22
- This gem required Ruby 1.9, and is tested against MRI, JRuby, and
23
- Rubinius using Travis CI.
24
+ This gem is tested against MRI, JRuby, and Rubinius using Travis CI.
24
25
 
25
- You will need to be using Rails 3 to make use of this validator, as it
26
- is built on top of ActiveModel, which was introduced in Rails 3.
26
+ You will need to be using Rails 3 or greater to make use of this
27
+ validator, as it is built on top of ActiveModel, which was introduced in
28
+ Rails 3.
27
29
 
28
30
  ### Usage with ActiveModel
29
31
 
@@ -61,7 +63,13 @@ end
61
63
 
62
64
  ### Built-in RSpec Matcher
63
65
 
66
+ The custom matcher will be loaded automatically if RSpec is loaded
67
+ first. Otherwise, you'll need to require the RSpec matcher manually
68
+ using `require 'validate_as_email/rspec'`.
69
+
64
70
  ``` ruby
71
+ require 'validate_as_email/rspec'
72
+
65
73
  class Person < ActiveRecord::Base
66
74
  validates_as_email :email
67
75
  attr_accessor :email
@@ -1,3 +1,3 @@
1
1
  module ValidateAsEmail
2
- VERSION = '1.0.3'
2
+ VERSION = '2.0.1'
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -8,7 +8,7 @@ end
8
8
  require 'validate_as_email'
9
9
  require 'rspec/rails/extensions/active_record/base'
10
10
 
11
- Dir[File.expand_path('../support/**/*.rb', __FILE__)].each(&method(:require))
11
+ Dir.glob(File.expand_path('../support/**/*.rb', __FILE__)) { |file| require file }
12
12
 
13
13
  RSpec.configure do |config|
14
14
  config.treat_symbols_as_metadata_keys_with_true_values = true
metadata CHANGED
@@ -1,160 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validate_as_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
5
- prerelease:
4
+ version: 2.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - James Conroy-Finn
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-07-20 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activemodel
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - ">"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '3'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
20
+ - - "<"
28
21
  - !ruby/object:Gem::Version
29
- version: '3'
30
- - !ruby/object:Gem::Dependency
31
- name: mail
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: '2'
22
+ version: '4.1'
38
23
  type: :runtime
39
24
  prerelease: false
40
25
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '2'
46
- - !ruby/object:Gem::Dependency
47
- name: rake
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: 0.9.2
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 0.9.2
62
- - !ruby/object:Gem::Dependency
63
- name: rspec-rails
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: '2.11'
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: '2.11'
78
- - !ruby/object:Gem::Dependency
79
- name: cucumber
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- version: '1.2'
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ~>
92
- - !ruby/object:Gem::Version
93
- version: '1.2'
94
- - !ruby/object:Gem::Dependency
95
- name: aruba
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ~>
100
- - !ruby/object:Gem::Version
101
- version: '0.4'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ~>
108
- - !ruby/object:Gem::Version
109
- version: '0.4'
110
- - !ruby/object:Gem::Dependency
111
- name: appraisal
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ~>
116
- - !ruby/object:Gem::Version
117
- version: '0.4'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
26
  requirements:
123
- - - ~>
124
- - !ruby/object:Gem::Version
125
- version: '0.4'
126
- - !ruby/object:Gem::Dependency
127
- name: activerecord
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ~>
27
+ - - ">"
132
28
  - !ruby/object:Gem::Version
133
29
  version: '3'
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ~>
30
+ - - "<"
140
31
  - !ruby/object:Gem::Version
141
- version: '3'
32
+ version: '4.1'
142
33
  - !ruby/object:Gem::Dependency
143
- name: sqlite3
34
+ name: mail
144
35
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
36
  requirements:
147
- - - ~>
37
+ - - "~>"
148
38
  - !ruby/object:Gem::Version
149
- version: '1.3'
150
- type: :development
39
+ version: '2.5'
40
+ type: :runtime
151
41
  prerelease: false
152
42
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
43
  requirements:
155
- - - ~>
44
+ - - "~>"
156
45
  - !ruby/object:Gem::Version
157
- version: '1.3'
46
+ version: '2.5'
158
47
  description: The ultimate Rails 3 email validator
159
48
  email:
160
49
  - james@logi.cl
@@ -162,51 +51,39 @@ executables: []
162
51
  extensions: []
163
52
  extra_rdoc_files: []
164
53
  files:
54
+ - LICENSE
55
+ - README.md
165
56
  - lib/active_model/validations/email_validator.rb
57
+ - lib/validate_as_email.rb
166
58
  - lib/validate_as_email/rspec.rb
167
59
  - lib/validate_as_email/version.rb
168
- - lib/validate_as_email.rb
169
- - README.md
170
- - LICENSE
171
- - features/active_model.feature
172
- - features/active_record.feature
173
- - features/rspec_matcher.feature
174
- - features/support/cucumber_helpers.rb
175
- - features/support/env.rb
176
60
  - spec/active_model/validations/email_validator_spec.rb
177
61
  - spec/spec_helper.rb
178
62
  - spec/support/model.rb
179
63
  homepage: https://github.com/evently/mail_validator
180
64
  licenses: []
65
+ metadata: {}
181
66
  post_install_message:
182
67
  rdoc_options: []
183
68
  require_paths:
184
69
  - lib
185
70
  required_ruby_version: !ruby/object:Gem::Requirement
186
- none: false
187
71
  requirements:
188
- - - ! '>='
72
+ - - ">="
189
73
  - !ruby/object:Gem::Version
190
74
  version: '0'
191
75
  required_rubygems_version: !ruby/object:Gem::Requirement
192
- none: false
193
76
  requirements:
194
- - - ! '>='
77
+ - - ">="
195
78
  - !ruby/object:Gem::Version
196
79
  version: '0'
197
80
  requirements: []
198
81
  rubyforge_project:
199
- rubygems_version: 1.8.23
82
+ rubygems_version: 2.2.0
200
83
  signing_key:
201
- specification_version: 3
84
+ specification_version: 4
202
85
  summary: The ultimate Rails 3 email validator. Powered by the Mail gem.
203
86
  test_files:
204
- - features/active_model.feature
205
- - features/active_record.feature
206
- - features/rspec_matcher.feature
207
- - features/support/cucumber_helpers.rb
208
- - features/support/env.rb
209
87
  - spec/active_model/validations/email_validator_spec.rb
210
88
  - spec/spec_helper.rb
211
89
  - spec/support/model.rb
212
- has_rdoc:
@@ -1,40 +0,0 @@
1
- Feature: ActiveModel validation
2
-
3
- Scenario Outline: Validation via <Macro>
4
- Given a file named "active_model_validation.rb" with:
5
- """
6
- require 'active_model'
7
- require 'validate_as_email'
8
-
9
- class Person
10
- include ActiveModel::Validations
11
-
12
- <Macro>
13
-
14
- attr_accessor :email
15
-
16
- def initialize(email)
17
- @email = email
18
- end
19
- end
20
-
21
- a = Person.new('james@logi.cl')
22
- a.valid?
23
-
24
- b = Person.new('invalid')
25
- b.valid?
26
-
27
- puts a.errors.to_a.inspect
28
- puts b.errors.to_a.inspect
29
- """
30
- When I run `ruby active_model_validation.rb`
31
- Then it should pass with:
32
- """
33
- []
34
- ["Email is invalid"]
35
- """
36
-
37
- Examples:
38
- | Macro |
39
- | validates :email, email: true |
40
- | validates_as_email :email |
@@ -1,35 +0,0 @@
1
- Feature: ActiveRecord validation
2
-
3
- Scenario Outline: Validation via <Macro>
4
- Given a file named "active_record_validation.rb" with:
5
- """
6
- require 'logger'
7
- require 'active_record'
8
- require 'validate_as_email'
9
-
10
- setup_active_record
11
-
12
- class Person < ActiveRecord::Base
13
- <Macro>
14
- end
15
-
16
- a = Person.new(email: 'james@logi.cl')
17
- a.valid?
18
-
19
- b = Person.new(email: 'invalid')
20
- b.valid?
21
-
22
- puts a.errors.to_a.inspect
23
- puts b.errors.to_a.inspect
24
- """
25
- When I run `ruby active_record_validation.rb`
26
- Then it should pass with:
27
- """
28
- []
29
- ["Email is invalid"]
30
- """
31
-
32
- Examples:
33
- | Macro |
34
- | validates :email, email: true |
35
- | validates_as_email :email |
@@ -1,24 +0,0 @@
1
- Feature: RSpec matcher
2
-
3
- Scenario: The built-in RSpec matcher covers validation of email for you
4
- Given a file named "rspec_matcher.rb" with:
5
- """
6
- require 'active_model'
7
- require 'rspec'
8
- require 'validate_as_email'
9
-
10
- class Person
11
- include ActiveModel::Validations
12
- validates_as_email :email
13
- attr_accessor :email
14
- end
15
-
16
- describe Person do
17
- it { should_not have_a_valid_email_address_for(:email) }
18
- end
19
- """
20
- When I run `rspec rspec_matcher.rb`
21
- Then it should fail with:
22
- """
23
- not to have a valid email address for :email
24
- """
@@ -1,18 +0,0 @@
1
- $LOAD_PATH << '../../spec' unless $LOAD_PATH.include?('../../spec')
2
- $LOAD_PATH.unshift '../../lib' unless $LOAD_PATH.include?('../../lib')
3
-
4
- def setup_active_record
5
- ActiveRecord::Base.logger = Logger.new(STDERR)
6
-
7
- ActiveRecord::Base.establish_connection(
8
- adapter: 'sqlite3',
9
- dbfile: ':memory:',
10
- database: 'validate_as_email_test'
11
- )
12
-
13
- ActiveRecord::Schema.define do
14
- create_table :people do |t|
15
- t.column :email, :string
16
- end
17
- end
18
- end
@@ -1,40 +0,0 @@
1
- require 'bundler'
2
- Bundler.setup
3
-
4
- begin
5
- require 'simplecov'
6
- rescue LoadError
7
- end
8
-
9
- require 'aruba/cucumber'
10
-
11
- # Borrowed from VCR
12
- additional_paths = []
13
-
14
- Before do
15
- load_paths, requires = ['../../lib'], []
16
-
17
- # Put any bundler-managed gems (such as :git gems) on the load path
18
- # for when aruba shells out. Alternatively, we could hook up aruba to
19
- # use bundler when it shells out, but invoking bundler for each and
20
- # every time aruba starts ruby would slow everything down. We really
21
- # only need it for bundler-managed gems.
22
- load_paths.push($LOAD_PATH.grep %r|bundler/gems|)
23
-
24
- if RUBY_VERSION < '1.9'
25
- requires << 'rubygems'
26
- else
27
- load_paths << '.'
28
- end
29
-
30
- requires << '../../features/support/cucumber_helpers'
31
- requires.map! { |r| "-r#{r}" }
32
- set_env('RUBYOPT', "-I#{load_paths.join(':')} #{requires.join(' ')}")
33
-
34
- if additional_paths.any?
35
- existing_paths = ENV['PATH'].split(':')
36
- set_env('PATH', (additional_paths + existing_paths).join(':'))
37
- end
38
-
39
- @aruba_timeout_seconds = RUBY_PLATFORM == 'java' ? 60 : 20
40
- end