{"action":"created","issue":{"url":"https://api.github.com/repos/codeclimate/ruby-test-reporter/issues/74","labels_url":"https://api.github.com/repos/codeclimate/ruby-test-reporter/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/codeclimate/ruby-test-reporter/issues/74/comments","events_url":"https://api.github.com/repos/codeclimate/ruby-test-reporter/issues/74/events","html_url":"https://github.com/codeclimate/ruby-test-reporter/pull/74","id":58321360,"number":74,"title":"Fixed bug preventing non-rails apps to fail to transfer coverage to code climate","user":{"login":"peppyheppy","id":41025,"avatar_url":"https://avatars.githubusercontent.com/u/41025?v=3","gravatar_id":"","url":"https://api.github.com/users/peppyheppy","html_url":"https://github.com/peppyheppy","followers_url":"https://api.github.com/users/peppyheppy/followers","following_url":"https://api.github.com/users/peppyheppy/following{/other_user}","gists_url":"https://api.github.com/users/peppyheppy/gists{/gist_id}","starred_url":"https://api.github.com/users/peppyheppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peppyheppy/subscriptions","organizations_url":"https://api.github.com/users/peppyheppy/orgs","repos_url":"https://api.github.com/users/peppyheppy/repos","events_url":"https://api.github.com/users/peppyheppy/events{/privacy}","received_events_url":"https://api.github.com/users/peppyheppy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-20T08:13:31Z","updated_at":"2015-02-24T01:44:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/codeclimate/ruby-test-reporter/pulls/74","html_url":"https://github.com/codeclimate/ruby-test-reporter/pull/74","diff_url":"https://github.com/codeclimate/ruby-test-reporter/pull/74.diff","patch_url":"https://github.com/codeclimate/ruby-test-reporter/pull/74.patch"},"body":"After setting up code climate in my non-rails app I noticed that I was not transmitting the coverage report up to codeclimate due to some bad/wrong code that relied on `defined?` and `Rails.root` incorrectly.\r\n\r\nThe \"fix\" for the `Rails.root` support also didn't have tests.\r\n\r\nSo, I added a fix to support non rails and wrote tests to make sure that we wouldn't have trouble going forward.\r\n\r\nHere is the original exception:\r\n\r\n    Coverage = 100.0%. Code Climate encountered an exception: NoMethodError\r\n    undefined method `root' for Rails:Module\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/git.rb:61:in `rails_git_dir_present?'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/git.rb:53:in `git_dir'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/git.rb:48:in `git'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/git.rb:35:in `head'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/git.rb:8:in `info'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/formatter.rb:72:in `to_payload'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/lib/code_climate/test_reporter/formatter.rb:20:in `format'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/simplecov-0.9.1/lib/simplecov/result.rb:46:in `format!'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/simplecov-0.9.1/lib/simplecov/configuration.rb:158:in `block in at_exit'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/simplecov-0.9.1/lib/simplecov/defaults.rb:54:in `call'\r\n    /home/ubuntu/census/vendor/bundle/ruby/1.9.1/gems/simplecov-0.9.1/lib/simplecov/defaults.rb:54:in `block in <top (required)>'\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/codeclimate/ruby-test-reporter/issues/comments/75683109","html_url":"https://github.com/codeclimate/ruby-test-reporter/pull/74#issuecomment-75683109","issue_url":"https://api.github.com/repos/codeclimate/ruby-test-reporter/issues/74","id":75683109,"user":{"login":"peppyheppy","id":41025,"avatar_url":"https://avatars.githubusercontent.com/u/41025?v=3","gravatar_id":"","url":"https://api.github.com/users/peppyheppy","html_url":"https://github.com/peppyheppy","followers_url":"https://api.github.com/users/peppyheppy/followers","following_url":"https://api.github.com/users/peppyheppy/following{/other_user}","gists_url":"https://api.github.com/users/peppyheppy/gists{/gist_id}","starred_url":"https://api.github.com/users/peppyheppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peppyheppy/subscriptions","organizations_url":"https://api.github.com/users/peppyheppy/orgs","repos_url":"https://api.github.com/users/peppyheppy/repos","events_url":"https://api.github.com/users/peppyheppy/events{/privacy}","received_events_url":"https://api.github.com/users/peppyheppy/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T01:44:17Z","updated_at":"2015-02-24T01:44:17Z","body":"Please reconsider this pull request."}}