kawaii_email_address 0.1.5 → 0.2.0

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: b9f9d489cd5ff7ced98dc58ac741d37ba9d2dd5b
4
- data.tar.gz: 375867f676963801390d00c416a570bbc72c43da
3
+ metadata.gz: 5728c34af560e873951b362a546fc1006af53dbd
4
+ data.tar.gz: 829aa39b94c682285eb2df7155d05113512d0136
5
5
  SHA512:
6
- metadata.gz: b1c44947221d0e536e97d3e45fa2fc325b58d3b1cc7f2e59c9cff57857c9ddb71f220e49fa33226ab43b4e54c808ead3a2ad81c13c93bb1c3a49de09dcf04695
7
- data.tar.gz: ba8abaa03b53fba5a4375b8ca4d3aba91e59c7e603587d50abb59237e83175d6e540b3e5fa2503d01669fee907194f6eb7e5f0a4a1b70dee6ea0705970238675
6
+ metadata.gz: 0c834ad7caf9350bc2d4bbae6dcd45b48c2327aaff89e89d84ec8e34e0d4998b1ae5d12c44d482aee539af96a299b119b19b89696268c6762d8c00e1eceb87a9
7
+ data.tar.gz: d6688cb0885a3e998323514a5414fd431fa6d3842338b9d97a9cfb100198e1f0d762482c8ebcd63bd4f3ae8e7331e509b2e1c3b9bc6fa346bdbcc74e4a14ac69
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 1.9.3
5
4
  - 2.0.0
6
5
  - 2.1
7
6
  - 2.2
@@ -58,8 +58,13 @@ module KawaiiEmailAddress
58
58
  end
59
59
 
60
60
  when DOUBLE_QUOTE # double quote delimits quoted strings
61
- in_quoted_string = !in_quoted_string
62
- next true
61
+ if i == 0
62
+ in_quoted_string = true
63
+ next true
64
+ elsif (i == local_part.length - 1) && in_quoted_string
65
+ in_quoted_string = false
66
+ next true
67
+ end
63
68
 
64
69
  when PERIOD
65
70
  period_restriction_violate_domain? ||
@@ -1,3 +1,3 @@
1
1
  module KawaiiEmailAddress
2
- VERSION = "0.1.5"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -11,20 +11,29 @@ describe KawaiiEmailAddress::Validator do
11
11
 
12
12
  subject { KawaiiEmailAddress::Validator }
13
13
 
14
- it { should pass_validation_with 'a@example.com' }
15
- it { should pass_validation_with 'a.!/==@example.com' }
16
-
17
- it { should_not pass_validation_with 'a@bc@example.com' }
18
- it { should_not pass_validation_with 'a..b@example.com' }
19
- it { should_not pass_validation_with 'a.@example.com' }
20
- it { should_not pass_validation_with '.aaa@example.com' }
14
+ describe 'pass case' do
15
+ it { should pass_validation_with 'a@example.com' }
16
+ it { should pass_validation_with 'a.!/==@example.com' }
17
+ end
21
18
 
22
- it { should pass_validation_with '"a@a"@example.com' }
23
- it { should pass_validation_with "'or'1'='1'--@example.com" }
19
+ describe 'fail case' do
20
+ it { should_not pass_validation_with 'a@bc@example.com' }
21
+ it { should_not pass_validation_with 'a..b@example.com' }
22
+ it { should_not pass_validation_with 'a.@example.com' }
23
+ it { should_not pass_validation_with '.aaa@example.com' }
24
+ it { should_not pass_validation_with 'example_address' }
25
+ it { should_not pass_validation_with '@example.com' }
26
+ end
24
27
 
25
- it { should_not pass_validation_with 'example_address' }
28
+ describe 'quoted-string case' do
29
+ it { should pass_validation_with '"a@a"@example.com' }
30
+ it { should pass_validation_with "'or'1'='1'--@example.com" }
26
31
 
27
- it { should_not pass_validation_with '@example.com' }
32
+ it { should_not pass_validation_with 'a"b"@example.com' }
33
+ it { should_not pass_validation_with '"a"b@example.com' }
34
+ it { should_not pass_validation_with '"a"b"@example.com' }
35
+ it { should_not pass_validation_with 'abc"defghi"xyz@example.com' }
36
+ end
28
37
 
29
38
  context 'kawaii: aka.docomo' do
30
39
  it { should pass_validation_with 'mail..example@docomo.ne.jp' }
@@ -5,13 +5,10 @@
5
5
  #
6
6
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
7
 
8
- if ENV['CODECLIMATE_REPO_TOKEN'] && RUBY_VERSION.start_with?('2.1')
9
- require 'codeclimate-test-reporter'
10
- CodeClimate::TestReporter.start
11
- end
8
+ require 'simplecov'
9
+ SimpleCov.start
12
10
 
13
11
  RSpec.configure do |config|
14
- config.treat_symbols_as_metadata_keys_with_true_values = true
15
12
  config.run_all_when_everything_filtered = true
16
13
  config.filter_run :focus
17
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kawaii_email_address
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - moro