diff --git a/.gitignore b/.gitignore index 8976b9e..a6143d6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ pkg/* *.gem .bundle USAGE.md -spec/vcr/* \ No newline at end of file +spec/vcr/* +.idea/* \ No newline at end of file diff --git a/lib/wordnik/configuration.rb b/lib/wordnik/configuration.rb index 13f54c0..fde6130 100644 --- a/lib/wordnik/configuration.rb +++ b/lib/wordnik/configuration.rb @@ -44,11 +44,11 @@ def initialize @user_agent = "ruby-#{Wordnik::VERSION}" # Build the default set of resource names from the filenames of the API documentation begin - api_docs_path = File.join(File.dirname(__FILE__), "../../api_docs") - @resource_names = `find #{api_docs_path} -name '*.json'`.split("\n").map {|f| f.split("/").last.sub('.json', '') }.sort + api_docs_path = File.join(File.dirname(__FILE__), '../../api_docs') + @resource_names = Dir.glob(File.join(api_docs_path, '*.json')).map {|f| f.split('/').last.sub('.json', '') }.sort true rescue - raise "Problem loading the resource files in ./api_docs/" + raise 'Problem loading the resource files in ./api_docs/' end end