dredd-rack
dredd-rack copied to clipboard
Task definition can't be in lib/tasks/
# lib/tasks/dredd_rack.rake
require 'dredd/rack'
Dredd::Rack::RakeTask.new
causes the same symptoms as described in #8.
The reason is that the hook that loads all these tasks, Rails.application.load_tasks
, seems to load local tasks before the environment
task, such that this condition is never met.
I wish I had the time and/or knowledge to figure out how to make this work. For now, placing the task definition after the load_tasks
hook in the Rakefile is a reasonable workaround.
Hi @rylnd!
Thanks for investigating this! There must be an explanation in the Rails initialisation process, I'll take a look at it.
Would something like this help? (Seen in the grape-apiary docs)
spec = Gem::Specification.find_by_name 'grape-apiary'
load "#{spec.gem_dir}/lib/grape-apiary/tasks/grape-apiary.rake"