naughty_or_nice 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/naughty_or_nice.rb +6 -8
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9ec2962f05e20ca9a53e633bbdd92f3101952f5
4
- data.tar.gz: 56d69e53d9de67e3cc15bcf74f9e378c7d59162c
3
+ metadata.gz: 9d85f51a7bb462630a5fa8145a88ebff5e51aed7
4
+ data.tar.gz: 67c413c0373ed0dd8516c33f07c0852dca6e79a6
5
5
  SHA512:
6
- metadata.gz: 6d107d77f230c2d36ed95028b0c36861259daa690d17391c9f0f68b9a9996ca506a264679ece78559097ca868bb5aeb534f900862bec70a2c014242c297fba67
7
- data.tar.gz: 06bbda45299cffc58bd6028ade79a7a2b46e51e8de089ec2943b7c454f4b0c094d4f4d7eff5e4a91ee7d7696bf12135da71b0ef53f3a055a1d0c6200761d1084
6
+ metadata.gz: d8a2b4b6a128bc0cbd5194281552941e17948f9db74e42081c26729b1d56d05cf61d1a3f55bc5de348868755e711361241df4f83d66634419522795ed9fa377d
7
+ data.tar.gz: a19f454d60ca1406921622c01ce20b45cb292f567530e320a8317b1a6f66c1d64015e09380b2f3e30a52477bff14a28d3bf3894028fd24ae1a5f5c9e09f2f6dc
@@ -68,15 +68,13 @@ class NaughtyOrNice
68
68
  elsif email?
69
69
  @text.match(/@([\w\.\-]+)\Z/i)[1]
70
70
  else # url sans http://
71
- begin
72
- uri = Addressable::URI.parse("http://#{@text}")
73
- # properly parse http://foo edge cases
74
- # see https://github.com/sporkmonger/addressable/issues/145
75
- uri.host if uri.host =~ /\./
76
- rescue Addressable::URI::InvalidURIError
77
- nil
78
- end
71
+ uri = Addressable::URI.parse("http://#{@text}")
72
+ # properly parse http://foo edge cases
73
+ # see https://github.com/sporkmonger/addressable/issues/145
74
+ uri.host if uri.host =~ /\./
79
75
  end
76
+ rescue Addressable::URI::InvalidURIError
77
+ nil
80
78
  end
81
79
  end
82
80
  alias_method :to_s, :domain
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naughty_or_nice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-18 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: public_suffix
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.2.0
115
+ rubygems_version: 2.2.3
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: You've made the list. We'll help you check it twice. Given a domain-like