Skip to content

Commit

Permalink
Freshen codebase to use Supermarket site.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol committed Aug 6, 2014
1 parent f4c071a commit c2baf85
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 105 deletions.
10 changes: 7 additions & 3 deletions lib/emeril/category.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- encoding: utf-8 -*-

require "net/http"
require "net/https"
require "json"
require "uri"

module Emeril

Expand All @@ -18,8 +19,11 @@ class Category
# on the Community site
#
def self.for_cookbook(cookbook)
path = "/api/v1/cookbooks/#{cookbook}"
response = Net::HTTP.get_response("cookbooks.opscode.com", path)
uri = URI("https://supermarket.getchef.com/api/v1/cookbooks/#{cookbook}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
JSON.parse(response.body)["category"]
end
end
Expand Down
51 changes: 28 additions & 23 deletions spec/fixtures/vcr_cassettes/known_cookbook.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

146 changes: 83 additions & 63 deletions spec/fixtures/vcr_cassettes/new_release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c2baf85

Please sign in to comment.