From d18a20332559d95bfd135f15c63834c38c8c41e8 Mon Sep 17 00:00:00 2001 From: Steven Harman Date: Thu, 23 Feb 2017 18:11:43 -0500 Subject: [PATCH] Use direct path to rake file Before this, we were relying on the Gem's `lib` dir being on the $LOAD_PATH, and thus `load` would find the `tasks/doc.rake` file. This can break when a different gem also has a `tasks/docs.rake` file, and it's further up in the load path. Same goes for a Rails app with a `tasks/docs.rake` file existing. This ensures we get OUR `tasks/docs.rake` file. --- lib/rspec_api_documentation/railtie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec_api_documentation/railtie.rb b/lib/rspec_api_documentation/railtie.rb index 35f31c79..edf5c8c9 100644 --- a/lib/rspec_api_documentation/railtie.rb +++ b/lib/rspec_api_documentation/railtie.rb @@ -1,7 +1,7 @@ module RspecApiDocumentation class Railtie < Rails::Railtie rake_tasks do - load "tasks/docs.rake" + load File.join(File.dirname(__FILE__), '../tasks/docs.rake') end end end