{"action":"created","issue":{"url":"https://api.github.com/repos/thibaudgg/video_info/issues/67","labels_url":"https://api.github.com/repos/thibaudgg/video_info/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/thibaudgg/video_info/issues/67/comments","events_url":"https://api.github.com/repos/thibaudgg/video_info/issues/67/events","html_url":"https://github.com/thibaudgg/video_info/pull/67","id":74590205,"number":67,"title":"Ability to disable individual providers","user":{"login":"vheuken","id":735512,"avatar_url":"https://avatars.githubusercontent.com/u/735512?v=3","gravatar_id":"","url":"https://api.github.com/users/vheuken","html_url":"https://github.com/vheuken","followers_url":"https://api.github.com/users/vheuken/followers","following_url":"https://api.github.com/users/vheuken/following{/other_user}","gists_url":"https://api.github.com/users/vheuken/gists{/gist_id}","starred_url":"https://api.github.com/users/vheuken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vheuken/subscriptions","organizations_url":"https://api.github.com/users/vheuken/orgs","repos_url":"https://api.github.com/users/vheuken/repos","events_url":"https://api.github.com/users/vheuken/events{/privacy}","received_events_url":"https://api.github.com/users/vheuken/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-09T05:19:54Z","updated_at":"2015-05-10T19:17:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thibaudgg/video_info/pulls/67","html_url":"https://github.com/thibaudgg/video_info/pull/67","diff_url":"https://github.com/thibaudgg/video_info/pull/67.diff","patch_url":"https://github.com/thibaudgg/video_info/pull/67.patch"},"body":"As discussed in issue #66, I implemented the ability to disable individual providers. This is necessary to move forward with fixing Youtube support.\r\n\r\nDocumentation for this feature is in README.md, at the bottom of the Options section.\r\n\r\nI implemented a few tests. Note that Travis should fail because of the Youtube API changes, but closer inspection should reveal that my changes did not break anything.\r\n\r\nI also realize that my changes are a bit ugly, but this is the only way I could get it to function properly."},"comment":{"url":"https://api.github.com/repos/thibaudgg/video_info/issues/comments/100683228","html_url":"https://github.com/thibaudgg/video_info/pull/67#issuecomment-100683228","issue_url":"https://api.github.com/repos/thibaudgg/video_info/issues/67","id":100683228,"user":{"login":"thibaudgg","id":1322,"avatar_url":"https://avatars.githubusercontent.com/u/1322?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaudgg","html_url":"https://github.com/thibaudgg","followers_url":"https://api.github.com/users/thibaudgg/followers","following_url":"https://api.github.com/users/thibaudgg/following{/other_user}","gists_url":"https://api.github.com/users/thibaudgg/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaudgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaudgg/subscriptions","organizations_url":"https://api.github.com/users/thibaudgg/orgs","repos_url":"https://api.github.com/users/thibaudgg/repos","events_url":"https://api.github.com/users/thibaudgg/events{/privacy}","received_events_url":"https://api.github.com/users/thibaudgg/received_events","type":"User","site_admin":false},"created_at":"2015-05-10T19:17:53Z","updated_at":"2015-05-10T19:17:53Z","body":"Yeah `const_provider.provider` need to be checked because of the mocking in the spec. What about?\r\n\r\n``` ruby\r\n  def self.disabled_provider?(provider)\r\n    disable_providers.map(&:downcase).include?(provider.downcase)\r\n  end\r\n\r\n  private\r\n\r\n  def _select_provider(url, options)\r\n    if provider_const = _providers_const.detect { |p| p.usable?(url) }\r\n      const_provider = provider_const.new(url, options)\r\n      ensure_enabled_provider(const_provider)\r\n      const_provider\r\n    else\r\n      raise UrlError, \"Url is not usable by any Providers: #{url}\"\r\n    end\r\n  end\r\n\r\n  def ensure_enabled_provider(const_provider)\r\n    if const_provider.respond_to?(:provider) &&\r\n      self.class.disabled_provider?(const_provider.provider)\r\n      raise UrlError, \"#{const_provider.provider} is disabled\"\r\n    end\r\n  end\r\n```\r\n\r\nPlease also fix the last HoundCi issues and we can merge it! :dancers: "}}