Skip to content

Commit

Permalink
Use direct path to rake file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stevenharman committed Feb 24, 2017
1 parent 351020a commit d18a203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/railtie.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d18a203

Please sign in to comment.