Fix path to file

This commit is contained in:
Lee Reilly 2012-04-25 10:29:32 -07:00
parent d50e81d5f6
commit 0cfdd465ca

View File

@ -1,5 +1,3 @@
$:.unshift(File.dirname(__FILE__))
require 'public_suffix'
module Swot
@ -177,8 +175,7 @@ module Swot
# Return the institution name, or nil if not found.
def name_from_academic_domain(domain)
begin
file = File.expand_path(__FILE__+'/..')
file = File.open("lib/domains/#{domain.tld}/#{domain.sld}", "rb")
file = File.open("#{File.expand_path(__FILE__+'/..')}/domains/#{domain.tld}/#{domain.sld}", "rb")
contents = file.read
contents.strip!
return contents