{"action":"created","issue":{"url":"https://api.github.com/repos/gonzalo-bulnes/dredd-rack/issues/12","labels_url":"https://api.github.com/repos/gonzalo-bulnes/dredd-rack/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/gonzalo-bulnes/dredd-rack/issues/12/comments","events_url":"https://api.github.com/repos/gonzalo-bulnes/dredd-rack/issues/12/events","html_url":"https://github.com/gonzalo-bulnes/dredd-rack/issues/12","id":76027717,"number":12,"title":"Task definition can't be in lib/tasks/","user":{"login":"rylnd","id":657252,"avatar_url":"https://avatars.githubusercontent.com/u/657252?v=3","gravatar_id":"","url":"https://api.github.com/users/rylnd","html_url":"https://github.com/rylnd","followers_url":"https://api.github.com/users/rylnd/followers","following_url":"https://api.github.com/users/rylnd/following{/other_user}","gists_url":"https://api.github.com/users/rylnd/gists{/gist_id}","starred_url":"https://api.github.com/users/rylnd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rylnd/subscriptions","organizations_url":"https://api.github.com/users/rylnd/orgs","repos_url":"https://api.github.com/users/rylnd/repos","events_url":"https://api.github.com/users/rylnd/events{/privacy}","received_events_url":"https://api.github.com/users/rylnd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-13T15:34:50Z","updated_at":"2015-05-14T01:49:15Z","closed_at":null,"body":"```ruby\r\n# lib/tasks/dredd_rack.rake\r\nrequire 'dredd/rack'\r\n\r\nDredd::Rack::RakeTask.new\r\n```\r\ncauses the same symptoms as described in #8.\r\n\r\nThe 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](https://github.com/gonzalo-bulnes/dredd-rack/blob/master/lib/dredd/rack/rake_task.rb#L129) is never met.\r\n\r\nI 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."},"comment":{"url":"https://api.github.com/repos/gonzalo-bulnes/dredd-rack/issues/comments/101877772","html_url":"https://github.com/gonzalo-bulnes/dredd-rack/issues/12#issuecomment-101877772","issue_url":"https://api.github.com/repos/gonzalo-bulnes/dredd-rack/issues/12","id":101877772,"user":{"login":"gonzalo-bulnes","id":1619067,"avatar_url":"https://avatars.githubusercontent.com/u/1619067?v=3","gravatar_id":"","url":"https://api.github.com/users/gonzalo-bulnes","html_url":"https://github.com/gonzalo-bulnes","followers_url":"https://api.github.com/users/gonzalo-bulnes/followers","following_url":"https://api.github.com/users/gonzalo-bulnes/following{/other_user}","gists_url":"https://api.github.com/users/gonzalo-bulnes/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzalo-bulnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzalo-bulnes/subscriptions","organizations_url":"https://api.github.com/users/gonzalo-bulnes/orgs","repos_url":"https://api.github.com/users/gonzalo-bulnes/repos","events_url":"https://api.github.com/users/gonzalo-bulnes/events{/privacy}","received_events_url":"https://api.github.com/users/gonzalo-bulnes/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T01:49:15Z","updated_at":"2015-05-14T01:49:15Z","body":"Hi @rylnd!\r\n\r\nThanks for investigating this! There must be an explanation in the [Rails initialisation process][ref], I'll take a look at it.\r\n\r\n  [ref]: http://guides.rubyonrails.org/initialization.html"}}