wordnik 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wordnik.rb +2 -10
- data/lib/wordnik/version.rb +1 -1
- metadata +1 -1
data/lib/wordnik.rb
CHANGED
@@ -38,18 +38,10 @@ module Wordnik
|
|
38
38
|
self.resources = {}
|
39
39
|
self.resource_names.map do |resource_name|
|
40
40
|
name = resource_name.underscore.to_sym # 'fooBar' => :foo_bar
|
41
|
-
|
42
|
-
# This is the path the installed gem will want
|
43
|
-
filename = File.join(ENV['GEM_HOME'], "gems", "wordnik-#{Wordnik::VERSION}", "api_docs/#{resource_name}.json")
|
44
|
-
raw_data = JSON.parse(File.read(filename))
|
45
|
-
rescue
|
46
|
-
# This is the path the not-installed gem in development will want
|
47
|
-
filename = File.join("api_docs/#{resource_name}.json")
|
48
|
-
raw_data = JSON.parse(File.read(filename))
|
49
|
-
end
|
41
|
+
filename = File.join(File.dirname(__FILE__), "../api_docs/#{resource_name}.json")
|
50
42
|
resource = Resource.new(
|
51
43
|
:name => name,
|
52
|
-
:raw_data =>
|
44
|
+
:raw_data => JSON.parse(File.read(filename))
|
53
45
|
)
|
54
46
|
self.resources[name] = resource
|
55
47
|
end
|
data/lib/wordnik/version.rb
CHANGED