swot 0.2.0 → 0.2.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -0,0 +1 @@
1
+ Algonquin College
@@ -0,0 +1 @@
1
+ Helsinki Metropolia University of Applied Sciences
@@ -0,0 +1 @@
1
+ Dublin Institute of Technology
@@ -0,0 +1 @@
1
+ National Institute for Subatomic Physics
@@ -0,0 +1 @@
1
+ Zuyd University
@@ -0,0 +1 @@
1
+ IT College Sweden
data/lib/swot.rb CHANGED
@@ -131,6 +131,7 @@ 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!
134
135
  return false if text.nil?
135
136
  begin
136
137
  domain = get_domain(text)
@@ -156,6 +157,7 @@ module Swot
156
157
  #
157
158
  # Returns a string with the instution name; nil if nothing is found.
158
159
  def get_institution_name(text)
160
+ text.strip!
159
161
  text.downcase!
160
162
  text = text.split("@")[1] if text.include? "@"
161
163
  domain = PublicSuffix.parse(text)
@@ -167,6 +169,7 @@ module Swot
167
169
  # Returns true if the domain name belongs to a known academic instition;
168
170
  # false otherwise.
169
171
  def match_academic_domain?(domain)
172
+ domain.strip!
170
173
  File.exists?("#{File.expand_path(__FILE__+'/..')}/domains/#{domain.tld}/#{domain.sld}")
171
174
  end
172
175
 
@@ -174,6 +177,7 @@ module Swot
174
177
  #
175
178
  # Return the institution name, or nil if not found.
176
179
  def name_from_academic_domain(domain)
180
+ domain.strip!
177
181
  begin
178
182
  file = File.open("#{File.expand_path(__FILE__+'/..')}/domains/#{domain.tld}/#{domain.sld}", "rb")
179
183
  contents = file.read
@@ -188,6 +192,7 @@ module Swot
188
192
  #
189
193
  # Returns a string with the FQDN; nil if there's an error.
190
194
  def get_domain(text)
195
+ text.strip!
191
196
  return false if text.nil?
192
197
  text.downcase!
193
198
  text = text.split("@")[1] if text.include? "@"
data/swot.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "swot"
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
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"]
12
- s.date = "2012-08-24"
12
+ s.date = "2012-09-11"
13
13
  s.description = "email helpers"
14
14
  s.email = "lee@leereilly.net"
15
15
  s.extra_rdoc_files = [
@@ -1811,6 +1811,7 @@ Gem::Specification.new do |s|
1811
1811
  "lib/domains/com/aesom",
1812
1812
  "lib/domains/com/ahlulbaitonline",
1813
1813
  "lib/domains/com/aiu-online",
1814
+ "lib/domains/com/algonquinlive",
1814
1815
  "lib/domains/com/almaarifah",
1815
1816
  "lib/domains/com/american-college",
1816
1817
  "lib/domains/com/andoncollege",
@@ -6146,6 +6147,7 @@ Gem::Specification.new do |s|
6146
6147
  "lib/domains/fi/kuva",
6147
6148
  "lib/domains/fi/lamk",
6148
6149
  "lib/domains/fi/lut",
6150
+ "lib/domains/fi/metropolia",
6149
6151
  "lib/domains/fi/oamk",
6150
6152
  "lib/domains/fi/oulu",
6151
6153
  "lib/domains/fi/puv",
@@ -6483,6 +6485,7 @@ Gem::Specification.new do |s|
6483
6485
  "lib/domains/ie/ittralee",
6484
6486
  "lib/domains/ie/lsb",
6485
6487
  "lib/domains/ie/may",
6488
+ "lib/domains/ie/mydit",
6486
6489
  "lib/domains/ie/ncirl",
6487
6490
  "lib/domains/ie/nui",
6488
6491
  "lib/domains/ie/rcpi",
@@ -6893,6 +6896,7 @@ Gem::Specification.new do |s|
6893
6896
  "lib/domains/nl/leidenuniv",
6894
6897
  "lib/domains/nl/nhtv",
6895
6898
  "lib/domains/nl/nijenrode",
6899
+ "lib/domains/nl/nikhef",
6896
6900
  "lib/domains/nl/ou",
6897
6901
  "lib/domains/nl/roac",
6898
6902
  "lib/domains/nl/ru",
@@ -6908,6 +6912,7 @@ Gem::Specification.new do |s|
6908
6912
  "lib/domains/nl/vu",
6909
6913
  "lib/domains/nl/wageningenuniversity",
6910
6914
  "lib/domains/nl/windesheim",
6915
+ "lib/domains/nl/zuyd",
6911
6916
  "lib/domains/no/aho",
6912
6917
  "lib/domains/no/bi",
6913
6918
  "lib/domains/no/hia",
@@ -7479,6 +7484,7 @@ Gem::Specification.new do |s|
7479
7484
  "lib/domains/se/hj",
7480
7485
  "lib/domains/se/hkr",
7481
7486
  "lib/domains/se/htu",
7487
+ "lib/domains/se/it-gymnasiet",
7482
7488
  "lib/domains/se/kau",
7483
7489
  "lib/domains/se/ki",
7484
7490
  "lib/domains/se/konstfack",
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.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-24 00:00:00.000000000 Z
12
+ date: 2012-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: public_suffix
@@ -1893,6 +1893,7 @@ files:
1893
1893
  - lib/domains/com/aesom
1894
1894
  - lib/domains/com/ahlulbaitonline
1895
1895
  - lib/domains/com/aiu-online
1896
+ - lib/domains/com/algonquinlive
1896
1897
  - lib/domains/com/almaarifah
1897
1898
  - lib/domains/com/american-college
1898
1899
  - lib/domains/com/andoncollege
@@ -6228,6 +6229,7 @@ files:
6228
6229
  - lib/domains/fi/kuva
6229
6230
  - lib/domains/fi/lamk
6230
6231
  - lib/domains/fi/lut
6232
+ - lib/domains/fi/metropolia
6231
6233
  - lib/domains/fi/oamk
6232
6234
  - lib/domains/fi/oulu
6233
6235
  - lib/domains/fi/puv
@@ -6565,6 +6567,7 @@ files:
6565
6567
  - lib/domains/ie/ittralee
6566
6568
  - lib/domains/ie/lsb
6567
6569
  - lib/domains/ie/may
6570
+ - lib/domains/ie/mydit
6568
6571
  - lib/domains/ie/ncirl
6569
6572
  - lib/domains/ie/nui
6570
6573
  - lib/domains/ie/rcpi
@@ -6975,6 +6978,7 @@ files:
6975
6978
  - lib/domains/nl/leidenuniv
6976
6979
  - lib/domains/nl/nhtv
6977
6980
  - lib/domains/nl/nijenrode
6981
+ - lib/domains/nl/nikhef
6978
6982
  - lib/domains/nl/ou
6979
6983
  - lib/domains/nl/roac
6980
6984
  - lib/domains/nl/ru
@@ -6990,6 +6994,7 @@ files:
6990
6994
  - lib/domains/nl/vu
6991
6995
  - lib/domains/nl/wageningenuniversity
6992
6996
  - lib/domains/nl/windesheim
6997
+ - lib/domains/nl/zuyd
6993
6998
  - lib/domains/no/aho
6994
6999
  - lib/domains/no/bi
6995
7000
  - lib/domains/no/hia
@@ -7561,6 +7566,7 @@ files:
7561
7566
  - lib/domains/se/hj
7562
7567
  - lib/domains/se/hkr
7563
7568
  - lib/domains/se/htu
7569
+ - lib/domains/se/it-gymnasiet
7564
7570
  - lib/domains/se/kau
7565
7571
  - lib/domains/se/ki
7566
7572
  - lib/domains/se/konstfack
@@ -7740,7 +7746,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
7740
7746
  version: '0'
7741
7747
  segments:
7742
7748
  - 0
7743
- hash: -9638355454956891
7749
+ hash: -3376494585758241949
7744
7750
  required_rubygems_version: !ruby/object:Gem::Requirement
7745
7751
  none: false
7746
7752
  requirements: