spree_core 2.1.8 → 2.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43818b70db72f063df0a2ca6ec5a814bbee08e32
4
- data.tar.gz: f8cc6b3a6c23d6f8cef08b16a11cda8ef76041f6
3
+ metadata.gz: bef9bb6cb651e122c3dd179632b3cd03db25db5c
4
+ data.tar.gz: 847f17d74a32fd42dc00d455663908d9a7b161d7
5
5
  SHA512:
6
- metadata.gz: 7ca9edf26cea41ea8f52c020206da785cc243c808f2b1c6647310b2f44d23d661f9c18380b3eb4804162852bd5bdc6faec6bbb1c1bc751cc103dbef34bae5c89
7
- data.tar.gz: a7da9a9569a87f7a6025d1ca7c837a3bb2bfb7c458daccfdce8ca5c914c0e6b5f3e480c09e9cc574b3ce5ecfb54512f590b9eb129ded0a4f15298bcbf4aa8021
6
+ metadata.gz: 466fb2ea2e0628e982dfbced5a7f6ceac9b3c8889ce10b65f63b92c5804636731eb69c0a728cc096d47d4d1e8d16a32914605d131d71746ed8a1f80558cca279
7
+ data.tar.gz: e30d22e469863e8eac638e5700dc094aed9db9f5e518ac976b6607d7feee5a3b74fddb30e26586d9e4213b6cec4246ba0f1b1602a8d307fc7506a0b2bacc76a4
@@ -1,29 +1,7 @@
1
- # Borrowed from http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/
2
- # Mentioned in tweet here: https://twitter.com/_sohara/status/177120126083141633
3
- require 'mail'
4
1
  class EmailValidator < ActiveModel::EachValidator
5
2
  def validate_each(record,attribute,value)
6
- unless valid?(value)
3
+ unless value =~ /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
7
4
  record.errors.add(attribute, :invalid, {:value => value}.merge!(options))
8
5
  end
9
6
  end
10
-
11
- def valid?(email)
12
- begin
13
- m = Mail::Address.new(email)
14
- # We must check that value contains a domain and that value is an email address
15
- r = m.domain && m.address == email
16
- t = m.__send__(:tree)
17
- # We need to dig into treetop
18
- # A valid domain must have dot_atom_text elements size > 1
19
- # user@localhost is excluded
20
- # treetop must respond to domain
21
- # We exclude valid email values like <user@localhost.com>
22
- # Hence we use m.__send__(tree).domain
23
- r &&= (t.domain.dot_atom_text.elements.size > 1)
24
- rescue Exception => e
25
- r = false
26
- end
27
- r
28
- end
29
7
  end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "2.1.8"
3
+ "2.1.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.8
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-29 00:00:00.000000000 Z
11
+ date: 2014-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant