sbsm 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@ language: ruby
3
3
  notifications:
4
4
  email:
5
5
  - ngiger@ywesee.com
6
+ bundler_args: --without debugger
6
7
  rvm:
7
8
  - ruby-head
8
9
  - 2.0.0
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'hoe'
4
- gem 'rmail'
4
+ gem 'mail', '>=2.2.7'
5
5
  gem 'hpricot'
6
6
  # gem 'rockit', '0.3.8' Cannot find version 0.3.8 is this really needed?
7
7
 
@@ -17,6 +17,6 @@ end
17
17
  group :development do
18
18
  gem 'racc'
19
19
  gem 'travis-lint'
20
- # gem 'pry'
21
- # gem 'pry-debugger'
20
+ gem 'pry'
21
+ gem 'pry-debugger'
22
22
  end
@@ -3,36 +3,59 @@ GEM
3
3
  specs:
4
4
  ansi (1.4.3)
5
5
  builder (3.2.2)
6
- docile (1.1.0)
7
- hashie (2.0.5)
6
+ coderay (1.1.0)
7
+ columnize (0.8.9)
8
+ debugger (1.6.7)
9
+ columnize (>= 0.3.1)
10
+ debugger-linecache (~> 1.2.0)
11
+ debugger-ruby_core_source (~> 1.3.5)
12
+ debugger-linecache (1.2.0)
13
+ debugger-ruby_core_source (1.3.5)
14
+ docile (1.1.3)
8
15
  hashr (0.0.22)
9
- hoe (3.7.1)
16
+ hoe (3.12.0)
10
17
  rake (>= 0.8, < 11.0)
11
18
  hoe-travis (1.2)
12
19
  hoe (~> 3.0)
13
20
  travis-lint (~> 1.2)
14
21
  hpricot (0.8.6)
15
- minitest (5.0.8)
16
- minitest-reporters (1.0.0)
22
+ mail (2.5.4)
23
+ mime-types (~> 1.16)
24
+ treetop (~> 1.4.8)
25
+ method_source (0.8.2)
26
+ mime-types (1.25.1)
27
+ minitest (5.3.4)
28
+ minitest-reporters (1.0.4)
17
29
  ansi
18
30
  builder
19
31
  minitest (>= 5.0)
20
- powerbar
21
- multi_json (1.8.2)
22
- powerbar (1.0.11)
23
- ansi (~> 1.4.0)
24
- hashie (>= 1.1.0)
25
- racc (1.4.10)
26
- rake (10.1.0)
27
- rmail (1.0.0)
32
+ ruby-progressbar
33
+ multi_json (1.10.1)
34
+ polyglot (0.3.4)
35
+ pry (0.9.12.6)
36
+ coderay (~> 1.0)
37
+ method_source (~> 0.8)
38
+ slop (~> 3.4)
39
+ pry-debugger (0.2.2)
40
+ debugger (~> 1.3)
41
+ pry (~> 0.9.10)
42
+ racc (1.4.11)
43
+ rake (10.3.2)
44
+ ruby-progressbar (1.5.1)
45
+ safe_yaml (0.9.7)
28
46
  simplecov (0.8.2)
29
47
  docile (~> 1.1.0)
30
48
  multi_json
31
49
  simplecov-html (~> 0.8.0)
32
50
  simplecov-html (0.8.0)
51
+ slop (3.5.0)
33
52
  test-unit (2.5.5)
34
- travis-lint (1.7.0)
53
+ travis-lint (1.8.0)
35
54
  hashr (~> 0.0.22)
55
+ safe_yaml (~> 0.9.0)
56
+ treetop (1.4.15)
57
+ polyglot
58
+ polyglot (>= 0.3.1)
36
59
 
37
60
  PLATFORMS
38
61
  ruby
@@ -41,11 +64,13 @@ DEPENDENCIES
41
64
  hoe
42
65
  hoe-travis
43
66
  hpricot
67
+ mail (>= 2.2.7)
44
68
  minitest
45
69
  minitest-reporters
70
+ pry
71
+ pry-debugger
46
72
  racc
47
73
  rake
48
- rmail
49
74
  simplecov
50
75
  test-unit
51
76
  travis-lint
@@ -24,7 +24,7 @@
24
24
  # Validator -- sbsm -- 15.11.2002 -- hwyss@ywesee.com
25
25
 
26
26
  require 'digest/md5'
27
- require 'rmail'
27
+ require 'mail'
28
28
  require 'date'
29
29
  require 'drb/drb'
30
30
  require 'uri'
@@ -152,13 +152,19 @@ module SBSM
152
152
  private
153
153
  def email(value)
154
154
  return if(value.empty?)
155
- parsed = RMail::Address.parse(value).first
156
- if(parsed.nil?)
155
+ parsed = Mail::Address.new(value)
156
+ if(parsed.nil?)
157
157
  raise InvalidDataError.new(:e_invalid_email_address, :email, value)
158
- elsif(parsed.domain)
159
- parsed.address
158
+ elsif (parsed.domain)
159
+ parsed.to_s
160
160
  else
161
- raise InvalidDataError.new(:e_domainless_email_address, :email, value)
161
+ raise InvalidDataError.new(:e_invalid_email_address, :email, value)
162
+ end
163
+ rescue => e
164
+ if e.class == SBSM::InvalidDataError
165
+ raise e
166
+ else
167
+ raise InvalidDataError.new(:e_invalid_email_address, :email, value)
162
168
  end
163
169
  end
164
170
  def filename(value)
@@ -1 +1 @@
1
- VERSION = '1.2.4'
1
+ VERSION = '1.2.5'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbsm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 4
10
- version: 1.2.4
9
+ - 5
10
+ version: 1.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Masaomi Hatakeyama, Zeno R.R. Davatz
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-03-05 00:00:00 Z
18
+ date: 2014-05-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rdoc