swot 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/lib/swot.rb +1 -3
  3. data/swot.gemspec +1 -1
  4. data/test/test_swot.rb +4 -0
  5. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/lib/swot.rb CHANGED
@@ -131,8 +131,8 @@ module Swot
131
131
  # Returns true if the domain name belongs to an academic institution;
132
132
  # false oterwise.
133
133
  def is_academic?(text)
134
- text.strip!
135
134
  return false if text.nil?
135
+ text.strip!
136
136
  begin
137
137
  domain = get_domain(text)
138
138
  return false if domain.nil?
@@ -169,7 +169,6 @@ module Swot
169
169
  # Returns true if the domain name belongs to a known academic instition;
170
170
  # false otherwise.
171
171
  def match_academic_domain?(domain)
172
- domain.strip!
173
172
  File.exists?("#{File.expand_path(__FILE__+'/..')}/domains/#{domain.tld}/#{domain.sld}")
174
173
  end
175
174
 
@@ -177,7 +176,6 @@ module Swot
177
176
  #
178
177
  # Return the institution name, or nil if not found.
179
178
  def name_from_academic_domain(domain)
180
- domain.strip!
181
179
  begin
182
180
  file = File.open("#{File.expand_path(__FILE__+'/..')}/domains/#{domain.tld}/#{domain.sld}", "rb")
183
181
  contents = file.read
data/swot.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "swot"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Lee Reilly"]
data/test/test_swot.rb CHANGED
@@ -38,6 +38,10 @@ class TestEmail < Test::Unit::TestCase
38
38
  assert_equal Swot::is_academic?(nil), false
39
39
  assert_equal Swot::is_academic?(''), false
40
40
  assert_equal Swot::is_academic?('the'), false
41
+
42
+ assert_equal Swot::is_academic?(' stanford.edu'), true
43
+ assert_equal Swot::is_academic?('lee@strath.ac.uk '), true
44
+ assert_equal Swot::is_academic?(' gmail.com '), false
41
45
  end
42
46
 
43
47
  should "returns name of valid institution" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -7746,7 +7746,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
7746
7746
  version: '0'
7747
7747
  segments:
7748
7748
  - 0
7749
- hash: -3376494585758241949
7749
+ hash: -425376927745833943
7750
7750
  required_rubygems_version: !ruby/object:Gem::Requirement
7751
7751
  none: false
7752
7752
  requirements: