validates_formatting_of 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,8 +1,6 @@
1
1
  rvm:
2
- - 1.8.7
3
2
  - 1.9.2
4
3
  - 1.9.3
5
- - ree
6
4
  - rbx
7
5
  - jruby
8
6
  - ruby-head
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## v0.5.0
2
+ * Dropped support for Ruby 1.8.7
3
+ * Dropped support for REE
4
+ * Updated email regex so that hosts/domains cannot start or end with hyphens.
5
+
6
+ ## v0.4.1
7
+ * __Removed Ruby-specific Regex flags in email.__ This was breaking an implementation in another project which used the `client_side_validations` gem which pulled in the Regex directly from the model. As the `u` and `x` flags are not supported by javascript, this made `client_side_validations` entirely useless.
8
+
1
9
  ## v0.4.0
2
10
 
3
11
  * Email and phone validations more flexible.
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Matt Bridges
1
+ Copyright (c) 2012 Matt Bridges
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.markdown CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  The `validates_formatting_of` gem adds several convenient methods to validate things such as emails, urls, and phone numbers in a Rails application.
6
6
 
7
+ # Unsupported versions
8
+
9
+ Please note that this gem takes advantage of regular expression features which are newer features in Ruby. Because of this, certain versions are not supported:
10
+
11
+ * 1.8.7
12
+ * Ruby Enterprise Edition (REE)
13
+
7
14
  # Installation
8
15
 
9
16
  To install `validates_formatting_of`, add the following to your `Gemfile`:
@@ -3,7 +3,7 @@ module ValidatesFormattingOf
3
3
 
4
4
  # This method is very close to allowing what is specified in RFC 5322 and RFC 5321
5
5
  def email
6
- /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
6
+ /\A([^@\s]+)@((?:(?!-)[-a-z0-9]+(?<!-)\.)+[a-z]{2,})\Z/i
7
7
  end
8
8
 
9
9
  # Taken from Ryan Bates' screencast on extracting gems. Works extremely well. Thanks Ryan!
@@ -1,3 +1,3 @@
1
1
  module ValidatesFormattingOf
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -14,6 +14,9 @@ describe ValidatesFormattingOf::ModelAdditions do
14
14
  Email.new(:email => "this__???{}|__should@be-valid.com").should be_valid
15
15
  Email.new(:email => "visitorservices@vmfa.museum").should be_valid
16
16
  Email.new(:email => "info@samoa.travel").should be_valid
17
+ Email.new(:email => "info@-samoa.travel").should_not be_valid
18
+ Email.new(:email => "info@samoa-.travel").should_not be_valid
19
+ Email.new(:email => "info@123-samoa.travel").should be_valid
17
20
  end
18
21
  end
19
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_formatting_of
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-14 00:00:00.000000000 Z
12
+ date: 2012-02-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70294744473040 !ruby/object:Gem::Requirement
16
+ requirement: &70230387998560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70294744473040
24
+ version_requirements: *70230387998560
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70294744472540 !ruby/object:Gem::Requirement
27
+ requirement: &70230387997920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70294744472540
35
+ version_requirements: *70230387997920
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70294744488180 !ruby/object:Gem::Requirement
38
+ requirement: &70230387997300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70294744488180
46
+ version_requirements: *70230387997300
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: supermodel
49
- requirement: &70294744487540 !ruby/object:Gem::Requirement
49
+ requirement: &70230387996860 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70294744487540
57
+ version_requirements: *70230387996860
58
58
  description: Common Rails validations wrapped in a gem.
59
59
  email:
60
60
  - mbridges.91@gmail.com
@@ -94,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  segments:
96
96
  - 0
97
- hash: 2251195787141757696
97
+ hash: -1332009593602573104
98
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  none: false
100
100
  requirements:
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  segments:
105
105
  - 0
106
- hash: 2251195787141757696
106
+ hash: -1332009593602573104
107
107
  requirements: []
108
108
  rubyforge_project:
109
109
  rubygems_version: 1.8.10