myna_bird 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 94f4bdbb1c8f11c7c04d9c0e63ba955fa8806d09
4
- data.tar.gz: 7b7218273f28bb9886429741536f72dd19bab3f8
2
+ SHA256:
3
+ metadata.gz: 46f55f1b5df1f4491f4bdbb249b2225176addc5833262d16d873db2ba3f19643
4
+ data.tar.gz: f918981314bb0b820510fd1fc2f9e99a3b43cf9c95c397e1a7bc624d8f89051b
5
5
  SHA512:
6
- metadata.gz: 82d99f2f9dd2d293c2392361e9f9a2d5228c912d9590494f77fd58e7e233b77ab58dbae6ec9f89cfd8e83edcc414a94cd63974c98ba407d21ff8e709610009bf
7
- data.tar.gz: 0abe86d1e15fc5193243c6d81ba04374af554fd06c3334c16e2afa841ec80ad08e55b3682a9a187a217fc4d73d652304fcd98ae87af2bb1570bb12d325b84c1d
6
+ metadata.gz: 99b8fa3bfa338122ac942494f78486f97cc46e993b7ecd90de431514e4d06e652aca24f6a3d7085724cbcd3812ec87f014c8f5e41e59d40665ad6a8f81d5d756
7
+ data.tar.gz: bc9c2a845475b1d006c77dee4178fea43349b73273ab1ff86d6786ea419d423bf4d18823031d6eadf5e7425f0152739d407ef5e70d26eb236e7713ec02731d62
data/Gemfile.lock CHANGED
@@ -2,64 +2,88 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  addressable (2.4.0)
5
- builder (3.2.2)
5
+ base64 (0.2.0)
6
+ bigdecimal (3.1.9)
7
+ builder (3.3.0)
8
+ date (3.4.1)
6
9
  descendants_tracker (0.0.4)
7
10
  thread_safe (~> 0.3, >= 0.3.1)
8
- diff-lcs (1.1.3)
11
+ diff-lcs (1.6.1)
9
12
  faraday (0.9.2)
10
13
  multipart-post (>= 1.2, < 3)
11
- git (1.3.0)
12
- github_api (0.13.1)
14
+ git (1.11.0)
15
+ rchardet (~> 1.8)
16
+ github_api (0.16.0)
13
17
  addressable (~> 2.4.0)
14
18
  descendants_tracker (~> 0.0.4)
15
19
  faraday (~> 0.8, < 0.10)
16
20
  hashie (>= 3.4)
17
- multi_json (>= 1.7.5, < 2.0)
18
- oauth2
19
- hashie (3.4.3)
20
- highline (1.7.8)
21
- jeweler (2.1.1)
21
+ mime-types (>= 1.16, < 3.0)
22
+ oauth2 (~> 1.0)
23
+ hashie (5.0.0)
24
+ highline (3.1.2)
25
+ reline
26
+ io-console (0.8.0)
27
+ jeweler (2.3.9)
22
28
  builder
23
- bundler (>= 1.0)
29
+ bundler
24
30
  git (>= 1.2.5)
25
- github_api
31
+ github_api (~> 0.16.0)
26
32
  highline (>= 1.6.15)
27
33
  nokogiri (>= 1.5.10)
34
+ psych
28
35
  rake
29
36
  rdoc
30
- semver
31
- json (1.8.3)
32
- jwt (1.5.1)
33
- mini_portile2 (2.0.0)
34
- multi_json (1.11.3)
35
- multi_xml (0.5.5)
36
- multipart-post (2.0.0)
37
- nokogiri (1.6.7.2)
38
- mini_portile2 (~> 2.0.0.rc2)
39
- oauth2 (1.1.0)
40
- faraday (>= 0.8, < 0.10)
41
- jwt (~> 1.0, < 1.5.2)
37
+ semver2
38
+ jwt (2.10.1)
39
+ base64
40
+ mime-types (2.99.3)
41
+ multi_json (1.15.0)
42
+ multi_xml (0.7.1)
43
+ bigdecimal (~> 3.1)
44
+ multipart-post (2.4.1)
45
+ nokogiri (1.18.7-arm64-darwin)
46
+ racc (~> 1.4)
47
+ oauth2 (1.4.8)
48
+ faraday (>= 0.8, < 3.0)
49
+ jwt (>= 1.0, < 3.0)
42
50
  multi_json (~> 1.3)
43
51
  multi_xml (~> 0.5)
44
52
  rack (>= 1.2, < 3)
45
- rack (1.6.4)
46
- rake (11.1.2)
47
- rdoc (4.2.2)
48
- json (~> 1.4)
49
- rspec (2.11.0)
50
- rspec-core (~> 2.11.0)
51
- rspec-expectations (~> 2.11.0)
52
- rspec-mocks (~> 2.11.0)
53
- rspec-core (2.11.1)
54
- rspec-expectations (2.11.3)
55
- diff-lcs (~> 1.1.3)
56
- rspec-mocks (2.11.3)
57
- semver (1.0.1)
58
- thread_safe (0.3.5)
53
+ psych (5.2.3)
54
+ date
55
+ stringio
56
+ racc (1.8.1)
57
+ rack (2.2.13)
58
+ rake (13.2.1)
59
+ rchardet (1.9.0)
60
+ rdoc (6.13.1)
61
+ psych (>= 4.0.0)
62
+ reline (0.6.1)
63
+ io-console (~> 0.5)
64
+ rspec (3.13.0)
65
+ rspec-core (~> 3.13.0)
66
+ rspec-expectations (~> 3.13.0)
67
+ rspec-mocks (~> 3.13.0)
68
+ rspec-core (3.13.3)
69
+ rspec-support (~> 3.13.0)
70
+ rspec-expectations (3.13.3)
71
+ diff-lcs (>= 1.2.0, < 2.0)
72
+ rspec-support (~> 3.13.0)
73
+ rspec-mocks (3.13.2)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.13.0)
76
+ rspec-support (3.13.2)
77
+ semver2 (3.4.2)
78
+ stringio (3.1.7)
79
+ thread_safe (0.3.6)
59
80
 
60
81
  PLATFORMS
61
- ruby
82
+ arm64-darwin-24
62
83
 
63
84
  DEPENDENCIES
64
85
  jeweler
65
86
  rspec
87
+
88
+ BUNDLED WITH
89
+ 2.4.10
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.11
1
+ 0.2.13
data/lib/myna_bird.rb CHANGED
@@ -79,22 +79,14 @@ class MynaBird
79
79
 
80
80
  def avoided_domain?
81
81
  self.class.avoided_domains.any? do |domain|
82
- /#{domain}/.match(@domain)
82
+ matches_domain?(domain)
83
83
  end
84
84
  end
85
85
 
86
86
  def common_domain?
87
- COMMON_DOMAINS.each do |domain|
88
- if domain.is_a?(Regexp)
89
- return true if domain.match(@domain)
90
- elsif domain =~ /\./
91
- return true if /#{domain}$/.match(@domain)
92
- else
93
- return true if /^#{domain}\./.match(@domain)
94
- end
87
+ COMMON_DOMAINS.any? do |domain|
88
+ matches_domain?(domain)
95
89
  end
96
-
97
- return false
98
90
  end
99
91
 
100
92
  def common_local?
@@ -109,4 +101,17 @@ class MynaBird
109
101
  return false
110
102
  end
111
103
 
104
+ private
105
+
106
+ def matches_domain?(domain)
107
+ if domain.is_a?(Regexp)
108
+ return true if domain.match(@domain)
109
+ elsif domain =~ /\./
110
+ return true if /#{domain}$/.match(@domain)
111
+ else
112
+ return true if /^#{domain}\./.match(@domain)
113
+ end
114
+
115
+ false
116
+ end
112
117
  end
data/myna_bird.gemspec CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "myna_bird"
9
- s.version = "0.2.12"
9
+ s.version = "0.2.13"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -1,7 +1,6 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe MynaBird do
4
-
5
4
  it_should_convert 'brendan@wistia.com', to: 'wistia'
6
5
  it_should_convert 'brendan.schwartz@gmail.com', to: 'brendan-schwartz'
7
6
  it_should_convert 'support@gmail.com', to: 'support-at-gmail'
@@ -18,6 +17,7 @@ describe MynaBird do
18
17
  it_should_convert 'BRENDAN@WISTIA', to: 'wistia'
19
18
  it_should_convert 'brendan@outlook.com', to: 'brendan'
20
19
  it_should_convert 'james@outlook.com.br', to: 'james'
20
+ it_should_convert 'james@karaol.com', to: 'karaol'
21
21
 
22
22
  # bad input
23
23
  it_should_not_convert 'no.at.sign'
@@ -26,10 +26,12 @@ describe MynaBird do
26
26
  it_should_not_convert '@@@@'
27
27
  it_should_not_convert '++@++'
28
28
 
29
- context 'domain should be avoided' do
30
- it 'uses the local name' do
31
- MynaBird.avoided_domains = ['post-jazz']
32
- MynaBird.convert('davej@post-jazz.no').should == 'davej'
29
+ describe '.avoided_domains' do
30
+ before do
31
+ MynaBird.avoided_domains = ['post-jazz', 'my']
33
32
  end
33
+
34
+ it_should_convert 'davej@post-jazz.no', to: 'davej'
35
+ it_should_convert 'thijs@mychickennuggets.com', to: 'mychickennuggets'
34
36
  end
35
37
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myna_bird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendan Schwartz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2016-04-25 00:00:00.000000000 Z
@@ -63,7 +63,7 @@ files:
63
63
  homepage: http://github.com/wistia/myna_bird
64
64
  licenses: []
65
65
  metadata: {}
66
- post_install_message:
66
+ post_install_message:
67
67
  rdoc_options: []
68
68
  require_paths:
69
69
  - lib
@@ -78,9 +78,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubyforge_project:
82
- rubygems_version: 2.2.3
83
- signing_key:
81
+ rubygems_version: 3.4.10
82
+ signing_key:
84
83
  specification_version: 4
85
84
  summary: Transform email addresses into account names for your app
86
85
  test_files: []