├── Gemfile ├── .rspec ├── lib ├── brewery_db │ ├── version.rb │ ├── resources │ │ ├── hops.rb │ │ ├── styles.rb │ │ ├── glassware.rb │ │ ├── yeasts.rb │ │ ├── categories.rb │ │ ├── fluid_size.rb │ │ ├── breweries.rb │ │ ├── locations.rb │ │ ├── fermentables.rb │ │ ├── menu.rb │ │ ├── brewery.rb │ │ ├── beers.rb │ │ └── search.rb │ ├── mash.rb │ ├── collection.rb │ ├── request.rb │ ├── config.rb │ ├── response.rb │ ├── paginated_collection.rb │ ├── web_hook.rb │ ├── resource.rb │ ├── middleware │ │ └── error_handler.rb │ └── client.rb └── brewery_db.rb ├── Rakefile ├── .travis.yml ├── spec ├── support │ ├── shared │ │ └── a_resource.rb │ └── vcr.rb ├── brewery_db │ ├── resources │ │ ├── menu_spec.rb │ │ ├── fluid_size_spec.rb │ │ ├── hops_spec.rb │ │ ├── styles_spec.rb │ │ ├── yeasts_spec.rb │ │ ├── glassware_spec.rb │ │ ├── categories_spec.rb │ │ ├── locations_spec.rb │ │ ├── fermentables_spec.rb │ │ ├── breweries_spec.rb │ │ ├── beers_spec.rb │ │ ├── brewery_spec.rb │ │ └── search_spec.rb │ ├── mash_spec.rb │ ├── config_spec.rb │ ├── resource_spec.rb │ ├── middleware │ │ └── error_handler_spec.rb │ ├── web_hook_spec.rb │ └── client_spec.rb ├── spec_helper.rb └── fixtures │ ├── BreweryDB_Resource │ └── _get │ │ ├── a_not_found_request │ │ ├── raises_an_exception.yml │ │ ├── includes_the_response_message_in_the_error_message.yml │ │ └── includes_the_response_status_in_the_error_message.yml │ │ └── an_OK_request │ │ └── returns_the_data.yml │ ├── BreweryDB_Resources_Glassware │ ├── _find │ │ └── fetches_only_the_glassware_asked_for.yml │ └── _all │ │ └── fetches_all_of_the_glassware_at_once.yml │ ├── BreweryDB_Resources_Categories │ ├── _find │ │ └── fetches_only_the_category_asked_for.yml │ └── _all │ │ └── fetches_all_of_the_cagtegories_at_once.yml │ ├── BreweryDB_Resources_FluidSize │ ├── _find │ │ └── fetches_only_the_fluid_size_asked_for.yml │ └── _all │ │ └── fetches_all_of_the_fluid_sizes_at_once.yml │ ├── BreweryDB_Resources_Fermentables │ ├── _find │ │ └── fetches_only_the_fermentable_asked_for.yml │ └── _all │ │ └── fetches_all_of_the_fermentables_at_once.yml │ ├── BreweryDB_Resources_Menu │ └── _beer_availability │ │ └── fetches_all_of_the_beer_availabilities_at_once.yml │ ├── BreweryDB_Resources_Hops │ ├── _find │ │ └── fetches_only_the_hop_asked_for.yml │ └── _all │ │ └── fetches_all_of_the_hops_at_once.yml │ ├── BreweryDB_Resources_Yeasts │ ├── _find │ │ └── fetches_only_the_yeast_asked_for.yml │ └── _all │ │ └── fetches_all_of_the_yeasts_at_once.yml │ ├── BreweryDB_Resources_Styles │ └── _find │ │ └── fetches_only_the_style_asked_for.yml │ ├── BreweryDB_Resources_Beers │ ├── _random │ │ └── fetches_a_random_beer.yml │ └── _find │ │ └── fetches_only_the_beer_asked_for.yml │ ├── BreweryDB_Resources_Locations │ ├── _find │ │ └── fetches_only_the_location_asked_for.yml │ └── _all │ │ └── fetches_all_of_the_breweries_at_once.yml │ ├── BreweryDB_Resources_Breweries │ └── _find │ │ └── fetches_only_the_brewery_asked_for.yml │ └── BreweryDB_Resources_Search │ └── _upc │ └── for_an_existing_upc_code │ └── returns_a_collection_with_the_matched_beer.yml ├── .gitignore ├── examples ├── kaminari.rb └── will_paginate.rb ├── brewery_db.gemspec ├── LICENSE ├── CHANGELOG.md └── README.md /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --format progress 3 | --order rand 4 | -r pry 5 | -------------------------------------------------------------------------------- /lib/brewery_db/version.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | VERSION = '0.2.4' 3 | end 4 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | 3 | require 'bundler/gem_tasks' 4 | require 'rspec/core/rake_task' 5 | 6 | RSpec::Core::RakeTask.new(:spec) 7 | 8 | task default: :spec 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | script: bundle exec rspec 3 | rvm: 4 | - 1.9.2 5 | - 1.9.3 6 | - 2.0.0 7 | - 2.1.0 8 | - 2.1.1 9 | - jruby-19mode 10 | - rbx-2.2 11 | - rbx 12 | -------------------------------------------------------------------------------- /spec/support/shared/a_resource.rb: -------------------------------------------------------------------------------- 1 | shared_examples_for 'a resource', :resource do 2 | let(:api_key) { ENV['BREWERY_DB_API_KEY'] } 3 | let(:client) { BreweryDB::Client.new { |config| config.api_key = api_key } } 4 | let(:config) { client.config } 5 | end 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | *.swp 4 | .bundle 5 | .config 6 | .env 7 | .rbenv-version 8 | .rvmrc 9 | .yardoc 10 | Gemfile.lock 11 | InstalledFiles 12 | _yardoc 13 | bin 14 | coverage 15 | doc/ 16 | lib/bundler/man 17 | pkg 18 | rdoc 19 | spec/reports 20 | tags 21 | test/tmp 22 | test/version_tmp 23 | tmp 24 | -------------------------------------------------------------------------------- /spec/support/vcr.rb: -------------------------------------------------------------------------------- 1 | require 'vcr' 2 | 3 | VCR.configure do |config| 4 | config.hook_into(:faraday) 5 | config.configure_rspec_metadata! 6 | 7 | config.cassette_library_dir = File.expand_path('../../fixtures', __FILE__) 8 | 9 | config.filter_sensitive_data('API_KEY') { ENV['BREWERY_DB_API_KEY'] } 10 | end 11 | 12 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/hops.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Hops < Resource 4 | def all(params={}) 5 | get('hops', params).paginated_collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('hop/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/styles.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Styles < Resource 4 | def all(params={}) 5 | get('styles', params).collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('style/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/glassware.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Glassware < Resource 4 | def all(params={}) 5 | get('glassware', params).collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('glass/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/yeasts.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Yeasts < Resource 4 | def all(params={}) 5 | get('yeasts', params).paginated_collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('yeast/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/categories.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Categories < Resource 4 | def all(params={}) 5 | get('categories', params).collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('category/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/fluid_size.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class FluidSize < Resource 4 | def all(params={}) 5 | get('fluidsizes', params).collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('fluidsize/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/breweries.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Breweries < Resource 4 | def all(params={}) 5 | get('breweries', params).paginated_collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('brewery/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/locations.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Locations < Resource 4 | def all(params={}) 5 | get('locations', params).paginated_collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('location/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/fermentables.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Fermentables < Resource 4 | def all(params={}) 5 | get('fermentables', params).paginated_collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('fermentable/%s' % id, params).data 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/menu.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Menu < Resource 4 | def beer_availability(params={}) 5 | get_menu('beer-availability', params).collection 6 | end 7 | 8 | private 9 | 10 | def get_menu(name, params) 11 | get("menu/#{name}", params) 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/brewery.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Brewery < Resource 4 | attr_reader :id 5 | 6 | def initialize(config, options={}) 7 | @id = options[:id] 8 | super(config) 9 | end 10 | 11 | def beers(params={}) 12 | get("brewery/#{id}/beers", params).collection 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /examples/kaminari.rb: -------------------------------------------------------------------------------- 1 | # Paginate beer search results using Kaminari. 2 | 3 | query = params[:query] 4 | page = params[:page] || 1 5 | per_page = BreweryDB::PaginatedCollection::BATCH_SIZE 6 | 7 | results = client.search.beers(q: query, p: page) 8 | count = results.count 9 | 10 | beers = Kaminari 11 | .paginate_array(results.take(per_page), total_count: count) 12 | .page(page) 13 | .per(per_page) 14 | -------------------------------------------------------------------------------- /examples/will_paginate.rb: -------------------------------------------------------------------------------- 1 | # Paginate beer search results using will_paginate. 2 | 3 | query = params[:query] 4 | page = params[:page] || 1 5 | per_page = BreweryDB::PaginatedCollection::BATCH_SIZE 6 | 7 | results = client.search.beers(q: query, p: page) 8 | count = results.count 9 | 10 | beers = WillPaginate::Collection.create(page, per_page, count) do |pager| 11 | pager.replace results.take(per_page) 12 | end 13 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/beers.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Beers < Resource 4 | def all(params={}) 5 | get('beers', params).paginated_collection 6 | end 7 | 8 | def find(id, params={}) 9 | get('beer/%s' % id, params).data 10 | end 11 | 12 | def random(params={}) 13 | find('random', params) 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/menu_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Menu, :resource do 6 | 7 | describe '#beer_availability', :vcr do 8 | let(:availabilities) { described_class.new(config).beer_availability } 9 | 10 | it 'fetches all of the beer availabilities at once' do 11 | expect(availabilities.count).to eq(8) 12 | end 13 | end 14 | 15 | end 16 | -------------------------------------------------------------------------------- /lib/brewery_db/mash.rb: -------------------------------------------------------------------------------- 1 | require 'hashie' 2 | 3 | module BreweryDB 4 | class Mash < Hashie::Mash 5 | protected 6 | 7 | def convert_key(key) 8 | key = key.to_s.dup 9 | key.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') 10 | key.gsub!(/([a-z\d])([A-Z])/, '\1_\2') 11 | key.tr('-', '_').downcase 12 | end 13 | 14 | def convert_value(value, duping=false) 15 | value.is_a?(String) ? super.gsub("\r\n", "\n") : super 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/fluid_size_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::Resources::FluidSize, :resource do 4 | context '#all', :vcr do 5 | let(:response) { described_class.new(config).all } 6 | 7 | it 'fetches all of the fluid sizes at once' do 8 | expect(response.count).to eq(19) 9 | end 10 | end 11 | 12 | context '#find', :vcr do 13 | let(:response) { described_class.new(config).find(1) } 14 | 15 | it 'fetches only the fluid size asked for' do 16 | expect(response.id).to eq(1) 17 | end 18 | end 19 | end 20 | 21 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/hops_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Hops, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all } 8 | 9 | it 'fetches all of the hops at once' do 10 | expect(response.count).to eq(166) 11 | end 12 | end 13 | 14 | context '#find', :vcr do 15 | let(:response) { described_class.new(config).find(1) } 16 | 17 | it 'fetches only the hop asked for' do 18 | expect(response.id).to eq(1) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/brewery_db/collection.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | class Collection 3 | include Enumerable 4 | 5 | attr_reader :size 6 | alias length size 7 | 8 | def initialize(response) 9 | self.response = response 10 | end 11 | 12 | def each 13 | return to_enum unless block_given? 14 | @collection.each { |element| yield(element) } 15 | end 16 | 17 | private 18 | 19 | def response=(response) 20 | @response = response 21 | @collection = Array(response.data) || [] 22 | @size = @collection.length 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spec/brewery_db/mash_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::Mash do 4 | it { is_expected.to be_a(Hashie::Mash) } 5 | 6 | context '#convert_key' do 7 | it 'underscores camelcased keys' do 8 | response = described_class.new(currentPage: 1) 9 | expect(response.current_page).to eq(1) 10 | end 11 | end 12 | 13 | context '#convert_value' do 14 | it 'converts CR+LF to LF' do 15 | response = described_class.new(description: "This.\r\nThat.") 16 | expect(response.description).to eq("This.\nThat.") 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/styles_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Styles, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all } 8 | 9 | it 'fetches all of the styles at once' do 10 | expect(response.count).to eq(160) 11 | end 12 | end 13 | 14 | context '#find', :vcr do 15 | let(:response) { described_class.new(config).find(1) } 16 | 17 | it 'fetches only the style asked for' do 18 | expect(response.id).to eq(1) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/yeasts_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Yeasts, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all } 8 | 9 | it 'fetches all of the yeasts at once' do 10 | expect(response.count).to eq(404) 11 | end 12 | end 13 | 14 | context '#find', :vcr do 15 | let(:response) { described_class.new(config).find(1836) } 16 | 17 | it 'fetches only the yeast asked for' do 18 | expect(response.id).to eq(1836) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'dotenv' 2 | Dotenv.load 3 | require 'brewery_db' 4 | 5 | # This API key is only for use when developing this client library. Please do 6 | # not use it in your own applications. You may request your own API key here: 7 | # http://www.brewerydb.com/developers 8 | ENV['BREWERY_DB_API_KEY'] ||= '1c394d8947e4a5873920d2333c9e9364' 9 | 10 | RSpec.configure do |config| 11 | config.run_all_when_everything_filtered = true 12 | config.filter_run :focus 13 | end 14 | 15 | Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |file| 16 | require(file) 17 | end 18 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/glassware_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Glassware, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all } 8 | 9 | it 'fetches all of the glassware at once' do 10 | expect(response.count).to eq(12) 11 | end 12 | end 13 | 14 | context '#find', :vcr do 15 | let(:response) { described_class.new(config).find(1) } 16 | 17 | it 'fetches only the glassware asked for' do 18 | expect(response.id).to eq(1) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/categories_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Categories, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all } 8 | 9 | it 'fetches all of the cagtegories at once' do 10 | expect(response.length).to eq(13) 11 | end 12 | end 13 | 14 | context '#find', :vcr do 15 | let(:response) { described_class.new(config).find(1) } 16 | 17 | it 'fetches only the category asked for' do 18 | expect(response.id).to eq(1) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/locations_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::Resources::Locations, :resource do 4 | context '#all', :vcr do 5 | let(:response) { described_class.new(config).all(locality: 'San Francisco') } 6 | 7 | it 'fetches all of the breweries at once' do 8 | expect(response.count).to eq(21) 9 | end 10 | end 11 | 12 | context '#find', :vcr do 13 | let(:response) { described_class.new(config).find('wXmTDU') } 14 | 15 | it 'fetches only the location asked for' do 16 | expect(response.id).to eq('wXmTDU') 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/fermentables_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Fermentables, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all } 8 | 9 | it 'fetches all of the fermentables at once' do 10 | expect(response.count).to eq(222) 11 | end 12 | end 13 | 14 | context '#find', :vcr do 15 | let(:response) { described_class.new(config).find(1924) } 16 | 17 | it 'fetches only the fermentable asked for' do 18 | expect(response.id).to eq(1924) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/brewery_db/request.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | class Request 3 | def initialize(connection, path, params={}) 4 | @connection = connection 5 | @path = path 6 | @params = params 7 | end 8 | 9 | def response 10 | Response.new(response_body, self) 11 | end 12 | 13 | def next_page 14 | self.class.new(@connection, @path, @params.merge(p: page_number + 1)) 15 | end 16 | 17 | private 18 | 19 | def response_body 20 | @connection.get(@path, @params).body 21 | end 22 | 23 | def page_number 24 | @params[:p] || 1 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/breweries_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Breweries, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all(established: 2006) } 8 | 9 | it 'fetches all of the breweries at once' do 10 | expect(response.count).to eq(74) 11 | end 12 | end 13 | 14 | context '#find', :vcr do 15 | let(:response) { described_class.new(config).find('Idm5Y5') } 16 | 17 | it 'fetches only the brewery asked for' do 18 | expect(response.id).to eq('Idm5Y5') 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/brewery_db/config.rb: -------------------------------------------------------------------------------- 1 | require 'faraday' 2 | 3 | module BreweryDB 4 | class Config 5 | BASE_URI = 'http://api.brewerydb.com/v2' 6 | USER_AGENT = "BreweryDB Ruby Gem #{BreweryDB::VERSION}" 7 | TIMEOUT = 60 8 | 9 | attr_accessor :adapter 10 | attr_accessor :api_key 11 | attr_accessor :base_uri 12 | attr_accessor :logger 13 | attr_accessor :timeout 14 | attr_accessor :user_agent 15 | 16 | def initialize 17 | self.adapter = Faraday.default_adapter 18 | self.base_uri = BASE_URI 19 | self.timeout = TIMEOUT 20 | self.user_agent = USER_AGENT 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/brewery_db/response.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | class Response 3 | def initialize(body, request) 4 | @body = body 5 | @request = request 6 | end 7 | 8 | def data 9 | @body.data 10 | end 11 | 12 | def collection 13 | Collection.new(self) 14 | end 15 | 16 | def paginated_collection 17 | PaginatedCollection.new(self) 18 | end 19 | 20 | def next_page 21 | @request.next_page.response 22 | end 23 | 24 | def page_number 25 | @body.current_page 26 | end 27 | 28 | def page_count 29 | @body.number_of_pages 30 | end 31 | 32 | def count 33 | @body.total_results 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /lib/brewery_db/resources/search.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Resources 3 | class Search < Resource 4 | def all(params={}) 5 | get('search', params).paginated_collection 6 | end 7 | 8 | def beers(params={}) 9 | all(params.merge(type: 'beer')) 10 | end 11 | 12 | def breweries(params={}) 13 | all(params.merge(type: 'brewery')) 14 | end 15 | 16 | def guilds(params={}) 17 | all(params.merge(type: 'guild')) 18 | end 19 | 20 | def events(params={}) 21 | all(params.merge(type: 'event')) 22 | end 23 | 24 | def upc(params={}) 25 | get('search/upc', params).paginated_collection 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/brewery_db/paginated_collection.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | class PaginatedCollection < Collection 3 | include Enumerable 4 | 5 | BATCH_SIZE = 50 6 | 7 | def count(*args, &block) 8 | # The Ruby documentation is wrong, and Enumerable#count no longer calls 9 | # #size, so let's make sure it's used here when no arguments are given. 10 | if args.empty? && !block_given? 11 | size 12 | else 13 | super 14 | end 15 | end 16 | 17 | def each 18 | return to_enum unless block_given? 19 | 20 | while @collection.any? 21 | @collection.each { |element| yield(element) } 22 | break if @collection.size < BATCH_SIZE 23 | self.response = @response.next_page 24 | end 25 | end 26 | 27 | private 28 | 29 | def response=(response) 30 | super 31 | @size = response.count || 0 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/brewery_db/web_hook.rb: -------------------------------------------------------------------------------- 1 | require 'digest/sha1' 2 | 3 | module BreweryDB 4 | class WebHook 5 | attr_reader :action 6 | attr_reader :attribute 7 | attr_reader :attribute_id 8 | attr_reader :key 9 | attr_reader :nonce 10 | attr_reader :sub_action 11 | attr_reader :sub_attribute_id 12 | attr_reader :timestamp 13 | 14 | def initialize(args) 15 | @action = args[:action] 16 | @attribute = args[:attribute] 17 | @attribute_id = args[:attributeId] 18 | @key = args[:key] 19 | @nonce = args[:nonce] 20 | @sub_action = args[:subAction] 21 | @sub_attribute_id = args[:subAttributeId] 22 | @timestamp = args[:timestamp] 23 | end 24 | 25 | def valid?(api_key) 26 | hash(api_key) == key 27 | end 28 | 29 | private 30 | 31 | def hash(api_key) 32 | Digest::SHA1.hexdigest("#{api_key}#{nonce}") 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/beers_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Beers, :resource do 6 | subject(:beers_resource) { described_class.new(config) } 7 | 8 | context '#all', :vcr do 9 | let(:response) { beers_resource.all(abv: '5.5') } 10 | 11 | it 'fetches all of the beers at once' do 12 | expect(response.count).to eq(985) 13 | end 14 | end 15 | 16 | context '#find', :vcr do 17 | let(:response) { beers_resource.find('99Uj1n') } 18 | 19 | it 'fetches only the beer asked for' do 20 | expect(response.id).to eq('99Uj1n') 21 | end 22 | end 23 | 24 | context '#random', :vcr do 25 | let(:response) { beers_resource.random(hasLabels: 'Y') } 26 | 27 | it 'fetches a random beer' do 28 | expect(response.status).to eq('verified') 29 | expect(response.labels.size).to eq(3) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/brewery_db/resource.rb: -------------------------------------------------------------------------------- 1 | require 'faraday' 2 | require 'faraday_middleware' 3 | 4 | module BreweryDB 5 | class Resource 6 | def initialize(config) 7 | @config = config 8 | end 9 | 10 | private 11 | 12 | def get(path, params={}) 13 | Request.new(connection, path, params).response 14 | end 15 | 16 | def connection 17 | Faraday.new(request: { timeout: @config.timeout }) do |builder| 18 | builder.url_prefix = @config.base_uri 19 | builder.headers[:user_agent] = @config.user_agent 20 | builder.params[:key] = @config.api_key 21 | 22 | builder.response(:logger, @config.logger) if @config.logger 23 | builder.use(Middleware::ErrorHandler) 24 | builder.response(:mashify, mash_class: Mash) 25 | builder.response(:json, content_type: /\bjson$/) 26 | 27 | builder.adapter(@config.adapter) 28 | end 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/brewery_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::Resources::Brewery do 4 | context '#beers' do 5 | let(:config) { double } 6 | let(:id) { 'KlSsWY' } 7 | let(:response) { double(collection: :some_beers) } 8 | 9 | subject(:brewery) { described_class.new(config, id: id) } 10 | 11 | context 'without params' do 12 | it 'returns the beers for a brewery' do 13 | allow(brewery).to receive(:get).with('brewery/KlSsWY/beers', {}) { response } 14 | expect(brewery.beers).to eq(:some_beers) 15 | end 16 | end 17 | 18 | context 'with params' do 19 | let(:params) { double } 20 | 21 | it 'returns the beers for a brewery with params' do 22 | allow(brewery).to receive(:get).with('brewery/KlSsWY/beers', params) { response } 23 | expect(brewery.beers(params)).to eq(:some_beers) 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/brewery_db/middleware/error_handler.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | module Middleware 3 | class ErrorHandler < Faraday::Response::Middleware 4 | def on_complete(env) 5 | case env[:status] 6 | when 200 7 | when 400 then fail with(BadRequest, env) 8 | when 401 then fail with(rate_limit_exceeded_or_unauthorized(env[:response_headers]), env) 9 | when 404 then fail with(NotFound, env) 10 | else fail with(Error, env) 11 | end 12 | end 13 | 14 | private 15 | 16 | def rate_limit_exceeded_or_unauthorized(headers) 17 | rate_limit = headers.fetch('x-ratelimit-remaining') { :rate_limit_unknown } 18 | 19 | rate_limit == '0' ? RateLimitExceeded : Unauthorized 20 | end 21 | 22 | def with(error_class, env) 23 | message = "Status => #{env[:status]}. Error message => #{env[:body].error_message}" 24 | error_class.new(message) 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resource/_get/a_not_found_request/raises_an_exception.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/brewery/NOT_FOUND?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 404 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:20 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | content-length: 28 | - '95' 29 | connection: 30 | - Close 31 | body: 32 | encoding: UTF-8 33 | string: '{"errorMessage":"The endpoint you requested could not be found","status":"failure"}' 34 | http_version: 35 | recorded_at: Mon, 31 Mar 2014 20:13:20 GMT 36 | recorded_with: VCR 2.4.0 37 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resource/_get/a_not_found_request/includes_the_response_message_in_the_error_message.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/brewery/NOT_FOUND?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 404 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:21 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | content-length: 28 | - '95' 29 | connection: 30 | - Close 31 | body: 32 | encoding: UTF-8 33 | string: '{"errorMessage":"The endpoint you requested could not be found","status":"failure"}' 34 | http_version: 35 | recorded_at: Mon, 31 Mar 2014 20:13:20 GMT 36 | recorded_with: VCR 2.4.0 37 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resource/_get/a_not_found_request/includes_the_response_status_in_the_error_message.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/brewery/NOT_FOUND?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 404 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:21 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | content-length: 28 | - '95' 29 | connection: 30 | - Close 31 | body: 32 | encoding: UTF-8 33 | string: '{"errorMessage":"The endpoint you requested could not be found","status":"failure"}' 34 | http_version: 35 | recorded_at: Mon, 31 Mar 2014 20:13:20 GMT 36 | recorded_with: VCR 2.4.0 37 | -------------------------------------------------------------------------------- /brewery_db.gemspec: -------------------------------------------------------------------------------- 1 | require './lib/brewery_db/version' 2 | 3 | Gem::Specification.new do |gem| 4 | gem.name = 'brewery_db' 5 | gem.version = BreweryDB::VERSION 6 | gem.summary = 'A Ruby library for using the BreweryDB API.' 7 | gem.homepage = 'http://github.com/tylerhunt/brewery_db' 8 | gem.authors = ['Tyler Hunt', 'Steven Harman'] 9 | gem.license = 'MIT' 10 | 11 | gem.required_ruby_version = '>= 1.9' 12 | 13 | gem.add_dependency 'faraday', '~> 0.8.0' 14 | gem.add_dependency 'faraday_middleware', '~> 0.8' 15 | gem.add_dependency 'hashie', '>= 1.1', '< 3' 16 | gem.add_development_dependency 'dotenv', '~> 0.10' 17 | gem.add_development_dependency 'pry' 18 | gem.add_development_dependency 'rspec', '~> 3.0' 19 | gem.add_development_dependency 'vcr', '~> 2.0' 20 | gem.add_development_dependency 'rake', '~> 10.2' 21 | 22 | gem.files = `git ls-files`.split($\) 23 | gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) } 24 | gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) 25 | gem.require_paths = ['lib'] 26 | end 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Tyler Hunt 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Glassware/_find/fetches_only_the_glassware_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/glass/1?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:24 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '137' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":1,"name":"Flute","createDate":"2012-01-03 38 | 02:41:33"},"status":"success"}' 39 | http_version: 40 | recorded_at: Mon, 31 Mar 2014 20:13:23 GMT 41 | recorded_with: VCR 2.4.0 42 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Categories/_find/fetches_only_the_category_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/category/1?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:22 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '148' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":1,"name":"British 38 | Origin Ales","createDate":"2012-03-21 20:06:45"},"status":"success"}' 39 | http_version: 40 | recorded_at: Mon, 31 Mar 2014 20:13:22 GMT 41 | recorded_with: VCR 2.4.0 42 | -------------------------------------------------------------------------------- /spec/brewery_db/resources/search_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resources::Search, :resource do 6 | context '#all', :vcr do 7 | let(:response) { described_class.new(config).all(q: 'IPA') } 8 | 9 | it 'fetches all of the search results at once' do 10 | expect(response.count).to eq(7202) 11 | end 12 | end 13 | 14 | { 15 | beers: 'beer', 16 | breweries: 'brewery', 17 | guilds: 'guild', 18 | events: 'event' 19 | }.each do |method, type| 20 | context "##{method}" do 21 | subject(:search) { described_class.new(config) } 22 | 23 | specify do 24 | results = double(:results) 25 | allow(search).to receive(:all).with(type: type, q: 'IPA') { results } 26 | expect(search.send(method, q: 'IPA')).to eq(results) 27 | end 28 | end 29 | end 30 | 31 | context '#upc', :vcr do 32 | subject(:search) { described_class.new(config) } 33 | 34 | context 'for an existing upc code' do 35 | let(:upc) { '030613000043' } 36 | 37 | it 'returns a collection with the matched beer' do 38 | expect(search.upc(code: upc).map(&:id)).to eq(['LVjHK1']) 39 | end 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_FluidSize/_find/fetches_only_the_fluid_size_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/fluidsize/1?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:23 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '165' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":1,"volume":"oz","volumeDisplay":"Ounce 38 | (oz)","quantity":"22","createDate":"2012-01-03 02:41:33"},"status":"success"}' 39 | http_version: 40 | recorded_at: Mon, 31 Mar 2014 20:13:23 GMT 41 | recorded_with: VCR 2.4.0 42 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Fermentables/_find/fetches_only_the_fermentable_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/fermentable/1924?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:23 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '253' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":1924,"name":"CaraMunich","characteristics":[{"id":5,"name":"Caramel","description":"Imparts 38 | a caramel quality upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 39 | Grains, & Fermentables","createDate":"2013-06-24 16:07:57"},"status":"success"}' 40 | http_version: 41 | recorded_at: Mon, 31 Mar 2014 20:13:23 GMT 42 | recorded_with: VCR 2.4.0 43 | -------------------------------------------------------------------------------- /spec/brewery_db/config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::Config do 4 | subject(:config) { described_class.new } 5 | 6 | context 'defaults' do 7 | it { expect(config.adapter).to eq(Faraday.default_adapter) } 8 | 9 | it { expect(config.api_key).to be_nil } 10 | 11 | it { expect(config.base_uri).to eq(described_class::BASE_URI) } 12 | 13 | it { expect(config.timeout).to eq(described_class::TIMEOUT) } 14 | 15 | it { expect(config.user_agent).to eq(described_class::USER_AGENT) } 16 | end 17 | 18 | context '#adapter=' do 19 | it do 20 | expect { 21 | config.adapter = :typhoeus 22 | }.to change(config, :adapter).to(:typhoeus) 23 | end 24 | end 25 | 26 | context '#api_key=' do 27 | it do 28 | expect { 29 | config.api_key = 'secret' 30 | }.to change(config, :api_key).to('secret') 31 | end 32 | end 33 | 34 | context '#base_uri=' do 35 | it do 36 | expect { 37 | config.base_uri = 'http://example.com' 38 | }.to change(config, :base_uri).to('http://example.com') 39 | end 40 | end 41 | 42 | context 'timeout=' do 43 | it do 44 | expect { 45 | config.timeout = 42 46 | }.to change(config, :timeout).to(42) 47 | end 48 | end 49 | 50 | context 'user_agent=' do 51 | it do 52 | expect { 53 | config.user_agent = 'Brewdega' 54 | }.to change(config, :user_agent).to('Brewdega') 55 | end 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /spec/brewery_db/resource_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | 3 | require 'spec_helper' 4 | 5 | describe BreweryDB::Resource, :resource do 6 | context '#get', :vcr do 7 | let(:resource) do 8 | Class.new(BreweryDB::Resource) { 9 | def ok 10 | get('breweries', name: 'Rogue Ales').data 11 | end 12 | 13 | def list 14 | get('breweries', established: 2006).paginated_collection 15 | end 16 | 17 | def not_found 18 | get('brewery/NOT_FOUND').data 19 | end 20 | }.new(config) 21 | end 22 | 23 | 24 | context 'an OK request' do 25 | it 'returns the data' do 26 | expect(resource.ok.first.name).to eq('Rogue Ales') 27 | end 28 | end 29 | 30 | context 'a list of resources' do 31 | it 'can be enumerated' do 32 | expect(resource.list.inject(0) { |tally, r| tally + 1 }).to eq(74) 33 | end 34 | end 35 | 36 | context 'a not found request' do 37 | it 'raises an exception' do 38 | expect { resource.not_found }.to raise_error(BreweryDB::NotFound) 39 | end 40 | 41 | it 'includes the response message in the error message' do 42 | exception = resource.not_found rescue $! 43 | expect(exception.message).to match(/could not be found/) 44 | end 45 | 46 | it 'includes the response status in the error message' do 47 | exception = resource.not_found rescue $! 48 | expect(exception.message).to match(/404/) 49 | end 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/brewery_db.rb: -------------------------------------------------------------------------------- 1 | require 'brewery_db/version' 2 | 3 | module BreweryDB 4 | Error = Class.new(StandardError) 5 | BadRequest = Class.new(Error) 6 | NotFound = Class.new(Error) 7 | RateLimitExceeded = Class.new(Error) 8 | Unauthorized = Class.new(Error) 9 | 10 | autoload :Client, 'brewery_db/client' 11 | autoload :Collection, 'brewery_db/collection' 12 | autoload :Config, 'brewery_db/config' 13 | autoload :Mash, 'brewery_db/mash' 14 | autoload :PaginatedCollection, 'brewery_db/paginated_collection' 15 | autoload :Request, 'brewery_db/request' 16 | autoload :Resource, 'brewery_db/resource' 17 | autoload :Response, 'brewery_db/response' 18 | autoload :WebHook, 'brewery_db/web_hook' 19 | 20 | module Middleware 21 | autoload :ErrorHandler, 'brewery_db/middleware/error_handler' 22 | end 23 | 24 | module Resources 25 | autoload :Beers, 'brewery_db/resources/beers' 26 | autoload :Breweries, 'brewery_db/resources/breweries' 27 | autoload :Brewery, 'brewery_db/resources/brewery' 28 | autoload :Categories, 'brewery_db/resources/categories' 29 | autoload :Fermentables, 'brewery_db/resources/fermentables' 30 | autoload :FluidSize, 'brewery_db/resources/fluid_size' 31 | autoload :Glassware, 'brewery_db/resources/glassware' 32 | autoload :Hops, 'brewery_db/resources/hops' 33 | autoload :Locations, 'brewery_db/resources/locations' 34 | autoload :Menu, 'brewery_db/resources/menu' 35 | autoload :Search, 'brewery_db/resources/search' 36 | autoload :Styles, 'brewery_db/resources/styles' 37 | autoload :Yeasts, 'brewery_db/resources/yeasts' 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /lib/brewery_db/client.rb: -------------------------------------------------------------------------------- 1 | module BreweryDB 2 | class Client 3 | def initialize(&block) 4 | configure(&block) if block_given? 5 | end 6 | 7 | def config 8 | @config ||= Config.new 9 | end 10 | 11 | def configure 12 | yield(config) 13 | self 14 | end 15 | 16 | def beers 17 | @beers ||= Resources::Beers.new(config) 18 | end 19 | 20 | # Builds a new instance of the brewery resource. 21 | # 22 | # @param id [String] the brewery ID 23 | # @return an instance of the brewery resource 24 | def brewery(id) 25 | Resources::Brewery.new(config, id: id) 26 | end 27 | 28 | def breweries 29 | @breweries ||= Resources::Breweries.new(config) 30 | end 31 | 32 | def categories 33 | @categories ||= Resources::Categories.new(config) 34 | end 35 | 36 | def fermentables 37 | @fermentables ||= Resources::Fermentables.new(config) 38 | end 39 | 40 | def fluid_size 41 | @fluid_size ||= Resources::FluidSize.new(config) 42 | end 43 | 44 | def glassware 45 | @glassware ||= Resources::Glassware.new(config) 46 | end 47 | 48 | def hops 49 | @hops ||= Resources::Hops.new(config) 50 | end 51 | 52 | def locations 53 | @locations ||= Resources::Locations.new(config) 54 | end 55 | 56 | def menu 57 | @menu ||= Resources::Menu.new(config) 58 | end 59 | 60 | def search 61 | @search ||= Resources::Search.new(config) 62 | end 63 | 64 | def styles 65 | @styles ||= Resources::Styles.new(config) 66 | end 67 | 68 | def yeasts 69 | @yeasts ||= Resources::Yeasts.new(config) 70 | end 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.2.4 (2014-04-07) 4 | 5 | * Add support for `beer/random` endpoint. ([Steven Harman][stevenharman]) 6 | 7 | ## 0.2.3 (2014-02-21) 8 | 9 | * Add support for `search/upc` endpoint. ([Matt Griffin][betamatt]) 10 | * Add support for request logging. ([Matt Griffin][betamatt]) 11 | 12 | ## 0.2.2 (2013-08-05) 13 | 14 | * Add support for `fluidsizes`, `fluidsize/:id`, and `menu/beer-availability` 15 | endpoints. ([Steven Harman][stevenharman]) 16 | * Fix: Paginate `Hops`, `Fermentables`, and `Yeasts` 17 | ([Steven Harman][stevenharman]) 18 | 19 | ## 0.2.1 (2013-08-02) 20 | 21 | * Add support for `hops`, `hop/:id`, `fermentables`, `fermentable/:id`, 22 | `yeasts`, and `yeasts:id` endpoints ([Jésus Lopes][jtadeulopes]) 23 | 24 | ## 0.2.0 (2013-06-26) 25 | 26 | * Add support for `locations` and `location/:id` endpoints 27 | ([dbc-apprentice][dbc-apprentice]) 28 | * Add support for `subAttributeId` webhook parameter 29 | ([Steven Harman][stevenharman]) 30 | 31 | ## 0.1.0 (2013-05-14) 32 | 33 | * Add support for handling webhook parameters ([Steven Harman][stevenharman]) 34 | * Raise exceptions on unsuccessful responses ([Tyler Hunt][tylerhunt]) 35 | * Return the data directly on successful responses 36 | ([Steven Harman][stevenharman]) 37 | * Add support for `brewery/:id/beers` endpoint ([Steven Harman][stevenharman]) 38 | * Require `faraday_middleware` ~> 0.8 ([Steven Harman][stevenharman]) 39 | 40 | ## 0.0.1 (2012-05-02) 41 | 42 | * Initial release ([Tyler Hunt][tylerhunt]) 43 | 44 | [dbc-apprentice]: https://github.com/dbc-apprentice 45 | [betamatt]: http://github.com/betamatt 46 | [jtadeulopes]: https://github.com/jtadeulopes 47 | [stevenharman]: http://github.com/stevenharman 48 | [tylerhunt]: http://github.com/tylerhunt 49 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Menu/_beer_availability/fetches_all_of_the_beer_availabilities_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/menu/beer-availability?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:25 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '296' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":[{"id":1,"name":"Year 38 | Round","description":"Available year round as a staple beer."},{"id":2,"name":"Limited","description":"Limited 39 | availability."},{"id":3,"name":"Not Available","description":"Beer is not 40 | available."},{"id":4,"name":"Seasonal","description":"Available at the same 41 | time of year, every year."},{"id":5,"name":"Spring","description":"Available 42 | during the spring months."},{"id":6,"name":"Summer","description":"Available 43 | during the summer months."},{"id":7,"name":"Fall","description":"Available 44 | during the fall months."},{"id":8,"name":"Winter","description":"Available 45 | during the winter months."}],"status":"success"}' 46 | http_version: 47 | recorded_at: Mon, 31 Mar 2014 20:13:25 GMT 48 | recorded_with: VCR 2.4.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Hops/_find/fetches_only_the_hop_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/hop/1?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:24 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '467' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":1,"name":"Admiral","description":"Bred 38 | at Wye as a replacement for Target and released in 1998, Admiral is a high-alpha 39 | variety considered to have a more pleasing, less harsh bitterness.","countryOfOrigin":"GB","alphaAcidMin":13,"betaAcidMin":4.8,"betaAcidMax":6.1,"humuleneMin":7,"humuleneMax":26,"caryophylleneMin":6,"caryophylleneMax":8,"cohumuloneMin":37,"cohumuloneMax":45,"myrceneMin":39,"myrceneMax":48,"farneseneMin":1.8,"farneseneMax":2.2,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 40 | 16:07:26","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 41 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 42 | 02:41:33"}},"status":"success"}' 43 | http_version: 44 | recorded_at: Mon, 31 Mar 2014 20:13:24 GMT 45 | recorded_with: VCR 2.4.0 46 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Glassware/_all/fetches_all_of_the_glassware_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/glassware?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:24 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '251' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":[{"id":1,"name":"Flute","createDate":"2012-01-03 38 | 02:41:33"},{"id":2,"name":"Goblet","createDate":"2012-01-03 02:41:33"},{"id":3,"name":"Mug","createDate":"2012-01-03 39 | 02:41:33"},{"id":4,"name":"Pilsner","createDate":"2012-01-03 02:41:33"},{"id":5,"name":"Pint","createDate":"2012-01-03 40 | 02:41:33"},{"id":6,"name":"Snifter","createDate":"2012-01-03 02:41:33"},{"id":7,"name":"Stange","createDate":"2012-01-03 41 | 02:41:33"},{"id":8,"name":"Tulip","createDate":"2012-01-03 02:41:33"},{"id":9,"name":"Weizen","createDate":"2012-01-03 42 | 02:41:33"},{"id":10,"name":"Oversized Wine Glass","createDate":"2012-01-03 43 | 02:41:33"},{"id":13,"name":"Willi","createDate":"2012-01-03 02:41:33"},{"id":14,"name":"Thistle","createDate":"2012-01-03 44 | 02:41:33"}],"status":"success"}' 45 | http_version: 46 | recorded_at: Mon, 31 Mar 2014 20:13:23 GMT 47 | recorded_with: VCR 2.4.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Yeasts/_find/fetches_only_the_yeast_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/yeast/1836?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:27 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '584' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":1836,"name":"American 38 | Ale II","description":"With many of the best qualities that brewers look for 39 | when brewing American styles of beer, this strain?s performance is consistent 40 | and it makes great beer. This versatile strain is a very good choice for a 41 | ?House? strain. Expect a soft, clean profile with hints of nut, and a slightly 42 | tart finish. Ferment at warmer temperatures to accentuate hop character with 43 | an increased fruitiness. Or, ferment cool for a clean, light citrus character. 44 | It attenuates well and is reliably flocculent, producing bright beer without 45 | filtration.","yeastType":"ale","attenuationMin":72,"attenuationMax":76,"fermentTempMin":60,"fermentTempMax":72,"alcoholToleranceMin":10,"alcoholToleranceMax":10,"productId":"1272","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 46 | 16:09:23","updateDate":"2013-06-24 16:10:52"},"status":"success"}' 47 | http_version: 48 | recorded_at: Mon, 31 Mar 2014 20:13:26 GMT 49 | recorded_with: VCR 2.4.0 50 | -------------------------------------------------------------------------------- /spec/brewery_db/middleware/error_handler_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::Middleware::ErrorHandler do 4 | subject(:handler) { described_class.new } 5 | 6 | describe '#on_complete' do 7 | let(:error_body) { double(error_message: error_message, status: 'failure') } 8 | let(:error_message) { 'error' } 9 | let(:over_ratelimit) { { 'x-ratelimit-remaining' => '0' } } 10 | 11 | it 'does not raise an error when the status is 200' do 12 | expect { handler.on_complete(status: 200) }.to_not raise_error 13 | end 14 | 15 | it 'raises a bad request error when the status is 400' do 16 | expect { 17 | handler.on_complete(status: 400, body: error_body) 18 | }.to raise_error(BreweryDB::BadRequest, 'Status => 400. Error message => error') 19 | end 20 | 21 | it 'raises an rate limit exceeded error when the status is 401 and x-ratelimit-remaining is 0' do 22 | expect { 23 | handler.on_complete(status: 401, body: error_body, response_headers: over_ratelimit) 24 | }.to raise_error(BreweryDB::RateLimitExceeded, 'Status => 401. Error message => error') 25 | end 26 | 27 | it 'raises an unauthorized error when the status is 401 and not over rate limit' do 28 | expect { 29 | handler.on_complete(status: 401, body: error_body, response_headers: {}) 30 | }.to raise_error(BreweryDB::Unauthorized, 'Status => 401. Error message => error') 31 | end 32 | 33 | it 'raises a not found error when the status is 404' do 34 | expect { 35 | handler.on_complete(status: 404, body: error_body) 36 | }.to raise_error(BreweryDB::NotFound, 'Status => 404. Error message => error') 37 | end 38 | 39 | context 'the status is unknown' do 40 | let(:error_message) { 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction' } 41 | 42 | it 'raises an error with the status and error message' do 43 | expect { 44 | handler.on_complete(status: 500, body: error_body) 45 | }.to raise_error(BreweryDB::Error, "Status => 500. Error message => #{error_message}") 46 | end 47 | end 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Categories/_all/fetches_all_of_the_cagtegories_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/categories?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:22 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '330' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":[{"id":1,"name":"British 38 | Origin Ales","createDate":"2012-03-21 20:06:45"},{"id":2,"name":"Irish Origin 39 | Ales","createDate":"2012-03-21 20:06:45"},{"id":3,"name":"North American Origin 40 | Ales","createDate":"2012-03-21 20:06:45"},{"id":4,"name":"German Origin Ales","createDate":"2012-03-21 41 | 20:06:46"},{"id":5,"name":"Belgian And French Origin Ales","createDate":"2012-03-21 42 | 20:06:46"},{"id":6,"name":"International Ale Styles","createDate":"2012-03-21 43 | 20:06:46"},{"id":7,"name":"European-germanic Lager","createDate":"2012-03-21 44 | 20:06:46"},{"id":8,"name":"North American Lager","createDate":"2012-03-21 45 | 20:06:46"},{"id":9,"name":"Other Lager","createDate":"2012-03-21 20:06:46"},{"id":10,"name":"International 46 | Styles","createDate":"2012-03-21 20:06:46"},{"id":11,"name":"Hybrid\/mixed 47 | Beer","createDate":"2012-03-21 20:06:46"},{"id":12,"name":"Mead, Cider, & 48 | Perry","createDate":"2012-03-21 20:06:46"},{"id":13,"name":"Other Origin","createDate":"2013-08-10 49 | 12:44:20"}],"status":"success"}' 50 | http_version: 51 | recorded_at: Mon, 31 Mar 2014 20:13:22 GMT 52 | recorded_with: VCR 2.4.0 53 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Styles/_find/fetches_only_the_style_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/style/1?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:26 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '603' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":1,"categoryId":1,"category":{"id":1,"name":"British 38 | Origin Ales","createDate":"2012-03-21 20:06:45"},"name":"Classic English-Style 39 | Pale Ale","description":"Classic English pale ales are golden to copper colored 40 | and display earthy, herbal English-variety hop character. Note that \"earthy, 41 | herbal English-variety hop character\" is the perceived end, but may be a 42 | result of the skillful use of hops of other national origins. Medium to high 43 | hop bitterness, flavor, and aroma should be evident. This medium-bodied pale 44 | ale has low to medium malt flavor and aroma. Low caramel character is allowable. 45 | Fruity-ester flavors and aromas are moderate to strong. Chill haze may be 46 | in evidence only at very cold temperatures. The absence of diacetyl is desirable, 47 | though, diacetyl (butterscotch character) is acceptable and characteristic 48 | when at very low levels.","ibuMin":"20","ibuMax":"40","abvMin":"4.5","abvMax":"5.5","srmMin":"5","srmMax":"5","ogMin":"1.04","fgMin":"1.008","fgMax":"1.016","createDate":"2012-03-21 49 | 20:06:45"},"status":"success"}' 50 | http_version: 51 | recorded_at: Mon, 31 Mar 2014 20:13:26 GMT 52 | recorded_with: VCR 2.4.0 53 | -------------------------------------------------------------------------------- /spec/brewery_db/web_hook_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::WebHook do 4 | let(:action) { 'edit' } 5 | let(:attribute) { 'beer' } 6 | let(:attribute_id) { 'x6bRxw' } 7 | let(:key) { 'cfae72cf7db09b7508905573c174baf1f026c051' } 8 | let(:nonce) { '576a8003ab8936d99fb104401141d613' } 9 | let(:sub_action) { 'brewery-insert' } 10 | let(:sub_attribute_id) { 'q6vJUK' } 11 | let(:timestamp) { '1350573527' } 12 | 13 | let(:brewery_db_payload) { 14 | { 15 | key: key, 16 | nonce: nonce, 17 | attribute: attribute, 18 | attributeId: attribute_id, 19 | action: action, 20 | subAction: sub_action, 21 | subAttributeId: sub_attribute_id, 22 | timestamp: timestamp 23 | } 24 | } 25 | 26 | subject(:web_hook) { described_class.new(brewery_db_payload) } 27 | 28 | describe '.new' do 29 | it 'extracts the action' do 30 | expect(web_hook.action).to eq(action) 31 | end 32 | 33 | it 'extracts the attribute' do 34 | expect(web_hook.attribute).to eq(attribute) 35 | end 36 | 37 | it 'extracts the attribute ID' do 38 | expect(web_hook.attribute_id).to eq(attribute_id) 39 | end 40 | 41 | it 'extracts the key' do 42 | expect(web_hook.key).to eq(key) 43 | end 44 | 45 | it 'extracts the nonce' do 46 | expect(web_hook.nonce).to eq(nonce) 47 | end 48 | 49 | it 'extracts the sub-action' do 50 | expect(web_hook.sub_action).to eq(sub_action) 51 | end 52 | 53 | it 'extracts the sub-action ID' do 54 | expect(web_hook.sub_attribute_id).to eq(sub_attribute_id) 55 | end 56 | 57 | it 'extracts the timestamp' do 58 | expect(web_hook.timestamp).to eq(timestamp) 59 | end 60 | end 61 | 62 | describe '#valid?' do 63 | let(:api_key) { '1c394d8947e4a5873920d2333c9e9364' } 64 | 65 | it 'is valid for a legit key and nonce' do 66 | expect(web_hook).to be_valid(api_key) 67 | end 68 | 69 | context 'invalid nonce' do 70 | let(:nonce) { '316d141104401bf99d6398ba3008a675' } 71 | 72 | it 'is not valid' do 73 | expect(web_hook).to_not be_valid(api_key) 74 | end 75 | end 76 | 77 | context 'invalid key' do 78 | let(:key) { '150c620f1fab471c3755098057b90bd7fc27eafc' } 79 | 80 | it 'is not valid' do 81 | expect(web_hook).to_not be_valid(api_key) 82 | end 83 | end 84 | end 85 | end 86 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Beers/_random/fetches_a_random_beer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/beer/random?key=API_KEY&hasLabels=Y 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 07 Apr 2014 18:41:19 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '675' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":"7WbFtq","name":"Bornem 38 | Double","abv":"8","styleId":70,"isOrganic":"N","labels":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/7WbFtq\/upload_f5WnFM-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/7WbFtq\/upload_f5WnFM-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/7WbFtq\/upload_f5WnFM-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 39 | 02:42:53","updateDate":"2012-11-03 17:25:31","style":{"id":70,"categoryId":5,"category":{"id":5,"name":"Belgian 40 | And French Origin Ales","createDate":"2012-03-21 20:06:46"},"name":"Other 41 | Belgian-Style Ales","description":"Recognizing the uniqueness and traditions 42 | of several other styles of Belgian Ales, the beers entered in this category 43 | will be assessed on the merits that they do not fit existing style guidelines 44 | and information that the brewer provides explaining the history and tradition 45 | of the style. Balance of character is a key component when assessing these 46 | beers. Barrel or wood-aged entries in competitions may be directed to other 47 | categories by competition director. In competitions the brewer must provide 48 | the historical or regional tradition of the style, or his interpretation of 49 | the style, in order to be assessed properly by the judges.","createDate":"2012-03-21 50 | 20:06:46"}},"status":"success"}' 51 | http_version: 52 | recorded_at: Mon, 07 Apr 2014 18:41:19 GMT 53 | recorded_with: VCR 2.9.0 54 | -------------------------------------------------------------------------------- /spec/brewery_db/client_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe BreweryDB::Client do 4 | subject(:client) { described_class.new } 5 | 6 | context '#config' do 7 | it 'returns a configuration instance' do 8 | expect(client.config).to be_a(BreweryDB::Config) 9 | end 10 | 11 | it 'memoizes the return value' do 12 | expect(BreweryDB::Config).to receive(:new).once.and_return(double) 13 | 2.times { client.config } 14 | end 15 | end 16 | 17 | context '#configure' do 18 | it 'can set the adapter' do 19 | expect { 20 | client.configure { |config| config.adapter = :typhoeus } 21 | }.to change(client.config, :adapter).to(:typhoeus) 22 | end 23 | 24 | it 'can set the API key' do 25 | expect { 26 | client.configure { |config| config.api_key = 'secret' } 27 | }.to change(client.config, :api_key).to('secret') 28 | end 29 | 30 | it 'can set the base URI' do 31 | expect { 32 | client.configure { |config| config.base_uri = 'http://example.com' } 33 | }.to change(client.config, :base_uri).to('http://example.com') 34 | end 35 | 36 | it 'can set the timeout' do 37 | expect { 38 | client.configure { |config| config.timeout = 42 } 39 | }.to change(client.config, :timeout).to(42) 40 | end 41 | 42 | it 'can set the user agent' do 43 | expect { 44 | client.configure { |config| config.user_agent = 'Brewdega' } 45 | }.to change(client.config, :user_agent).to('Brewdega') 46 | end 47 | end 48 | 49 | it { expect(client.beers).to be_a(BreweryDB::Resources::Beers) } 50 | 51 | it { expect(client.breweries).to be_a(BreweryDB::Resources::Breweries) } 52 | 53 | it { expect(client.categories).to be_a(BreweryDB::Resources::Categories) } 54 | 55 | it { expect(client.fermentables).to be_a(BreweryDB::Resources::Fermentables) } 56 | 57 | it { expect(client.fluid_size).to be_a(BreweryDB::Resources::FluidSize) } 58 | 59 | it { expect(client.glassware).to be_a(BreweryDB::Resources::Glassware) } 60 | 61 | it { expect(client.hops).to be_a(BreweryDB::Resources::Hops) } 62 | 63 | it { expect(client.locations).to be_a(BreweryDB::Resources::Locations) } 64 | 65 | it { expect(client.menu).to be_a(BreweryDB::Resources::Menu) } 66 | 67 | it { expect(client.search).to be_a(BreweryDB::Resources::Search) } 68 | 69 | it { expect(client.styles).to be_a(BreweryDB::Resources::Styles) } 70 | 71 | it { expect(client.yeasts).to be_a(BreweryDB::Resources::Yeasts) } 72 | 73 | it { expect(client.brewery('KlSsWY')).to be_a(BreweryDB::Resources::Brewery) } 74 | end 75 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Locations/_find/fetches_only_the_location_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/location/wXmTDU?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:25 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '864' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":"wXmTDU","name":"Main 38 | Brewery","streetAddress":"563 Second Street","locality":"San Francisco","region":"California","postalCode":"94107","phone":"415-369-0900","hoursOfOperation":"Monday 39 | - Thursday: 11:30am to 12:00am\r\nFriday & Saturday: 11:30am to 1:00am\r\nSunday: 40 | 10:00am to 12:00am","latitude":37.7824175,"longitude":-122.3925921,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"brewpub","locationTypeDisplay":"Brewpub","countryIsoCode":"US","yearOpened":"2000","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 41 | 02:41:43","updateDate":"2012-09-29 13:00:01","breweryId":"EdRcIs","brewery":{"id":"EdRcIs","name":"21st 42 | Amendment Brewery","description":"The 21st Amendment Brewery offers a variety 43 | of award winning house made brews and American grilled cuisine in a comfortable 44 | loft like setting. Join us before and after Giants baseball games in our outdoor 45 | beer garden. A great location for functions and parties in our semi-private 46 | Brewers Loft. See you soon at the 21A!","website":"http:\/\/www.21st-amendment.com\/","established":"2000","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/EdRcIs\/upload_YmgSv3-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/EdRcIs\/upload_YmgSv3-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/EdRcIs\/upload_YmgSv3-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 47 | 02:41:43","updateDate":"2012-10-22 17:12:59"},"country":{"isoCode":"US","name":"UNITED 48 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 49 | 02:41:33"}},"status":"success"}' 50 | http_version: 51 | recorded_at: Mon, 31 Mar 2014 20:13:25 GMT 52 | recorded_with: VCR 2.4.0 53 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resource/_get/an_OK_request/returns_the_data.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/breweries?key=API_KEY&name=Rogue+Ales 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:20 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '889' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"currentPage":1,"numberOfPages":1,"totalResults":1,"data":[{"id":"X0l98q","name":"Rogue 38 | Ales","description":"Rogue Ales was founded in 1988 by Jack Joyce, Rob Strasser 39 | and Bob Woodell, three corporate types who wanted to go into the food\/beverage 40 | industry. Rogue''s first brewpub was located in Ashland, Oregon and was a 41 | 10bbl brewsystem. Rogue opened a second brewpub, 15bbl brewsystem, in May 42 | 1989 located in Newport, Oregon. Rogue closed its Ashland operation in 1997, 43 | after the great flood destroyed the place. In 1991, the 15bbl system, named 44 | Howard after John Maier''s former boss, from the Newport brewpub was transferred 45 | across the bay to the current brewery and upgraded to a 30bbl system. In 1998 46 | Rogue bought a 50bbl brewsystem, named Kobe. Kobe is the only brewsystem in 47 | use. Tours: We offer brewery tours every day at 3 pm (followed by a distillery 48 | tour at 4pm). Go up to the bar inside the brewery (Brewers on the Bay) and 49 | check in with the bartender and the tour will commence. Please call ahead 50 | if you have a large group and or to verify the tour time...Brewer''s on the 51 | Bay phone is 541-867-3664. The view from Brewers on the Bay includes the marina 52 | (outside), and the bottling line and brew kettles (inside).","website":"http:\/\/www.rogue.com\/","established":"1987","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/X0l98q\/upload_G7JsDk-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/X0l98q\/upload_G7JsDk-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/X0l98q\/upload_G7JsDk-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 53 | 02:42:07","updateDate":"2012-10-19 14:08:55"}],"status":"success"}' 54 | http_version: 55 | recorded_at: Mon, 31 Mar 2014 20:13:20 GMT 56 | recorded_with: VCR 2.4.0 57 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Breweries/_find/fetches_only_the_brewery_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/brewery/Idm5Y5?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:22 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '731' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":"Idm5Y5","name":"Founders 38 | Brewing Company","description":"Founders Brewing Company, founded by Mike 39 | Stevens and Dave Engbers produced its first beer in November of 1997. Built 40 | out of a dream and a passion for home brewing, what started out as a hobby 41 | quickly became a thriving business. As the years have passed, Founders has 42 | built its brewery on the exploration of recipe development and brewing techniques. 43 | We are not the standard micro-brewery, rather we have traveled a path that 44 | breaks from the standard craft-brewer.\r\n\r\nCarving a niche out of the craft 45 | industry, Founders Brewing Company has built its reputation on producing very 46 | unique beers. Our focus is to offer our wholesalers, retailers and consumers 47 | a product that stands alone on the shelf and offers a true drinking experience 48 | to our friends, the consumer. As the years have passed, Founders has built 49 | its brewery on the exploration of recipe development and brewing techniques. 50 | We are not the standard micro-brewery, rather we have traveled a path that 51 | breaks from the standard craft-brewer. Carving a niche out of the craft industry, 52 | Founders Brewing Company has built its reputation on producing very unique 53 | beers. Our focus is to offer our wholesalers, retailers and consumers a product 54 | that stands alone on the shelf and offers a true drinking experience to our 55 | friends, the consumer.","website":"http:\/\/www.foundersbrewing.com\/","established":"1997","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/Idm5Y5\/upload_5gYn8V-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/Idm5Y5\/upload_5gYn8V-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/Idm5Y5\/upload_5gYn8V-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 56 | 02:41:55","updateDate":"2012-09-11 19:30:21"},"status":"success"}' 57 | http_version: 58 | recorded_at: Mon, 31 Mar 2014 20:13:22 GMT 59 | recorded_with: VCR 2.4.0 60 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_FluidSize/_all/fetches_all_of_the_fluid_sizes_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/fluidsizes?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:23 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '412' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":[{"id":1,"volume":"oz","volumeDisplay":"Ounce 38 | (oz)","quantity":"22","createDate":"2012-01-03 02:41:33"},{"id":2,"volume":"oz","volumeDisplay":"Ounce 39 | (oz)","quantity":"12","createDate":"2012-01-03 02:41:33"},{"id":3,"volume":"oz","volumeDisplay":"Ounce 40 | (oz)","quantity":"16","createDate":"2012-01-03 02:41:33"},{"id":4,"volume":"oz","volumeDisplay":"Ounce 41 | (oz)","quantity":"7","createDate":"2012-01-03 02:41:33"},{"id":5,"volume":"liter","volumeDisplay":"Liter","quantity":".75","createDate":"2012-01-03 42 | 02:41:33"},{"id":6,"volume":"pack","volumeDisplay":"Pack","quantity":"6","createDate":"2012-01-03 43 | 02:41:33"},{"id":7,"volume":"pack","volumeDisplay":"Pack","quantity":"4","createDate":"2012-01-03 44 | 02:41:33"},{"id":8,"volume":"pack","volumeDisplay":"Pack","quantity":"12","createDate":"2012-01-03 45 | 02:41:33"},{"id":9,"volume":"case","createDate":"2012-01-03 02:41:33"},{"id":10,"volume":"oz","volumeDisplay":"Ounce 46 | (oz)","quantity":"18","createDate":"2012-01-04 13:41:24"},{"id":11,"volume":"oz","volumeDisplay":"Ounce 47 | (oz)","quantity":"25.4","createDate":"2012-01-04 13:47:15"},{"id":12,"volume":"oz","volumeDisplay":"Ounce 48 | (oz)","quantity":"11.2","createDate":"2012-07-15 13:06:32"},{"id":13,"volume":"oz","volumeDisplay":"Ounce 49 | (oz)","quantity":"16.9","createDate":"2012-07-29 21:20:00"},{"id":14,"volume":"pack","volumeDisplay":"Pack","quantity":"Case 50 | 12\/22","createDate":"2012-09-09 14:49:35","updateDate":"2012-09-09 14:49:55"},{"id":15,"volume":"barrel","volumeDisplay":"Barrel","quantity":"1\/2","createDate":"2012-09-09 51 | 14:51:14"},{"id":16,"volume":"barrel","volumeDisplay":"Barrel","quantity":"1\/6","createDate":"2012-09-09 52 | 14:51:29"},{"id":17,"volume":"barrel","volumeDisplay":"Barrel","quantity":"1\/4","createDate":"2012-09-09 53 | 14:51:44"},{"id":18,"volume":"oz","volumeDisplay":"Ounce (oz)","createDate":"2013-12-05 54 | 05:15:08"},{"id":19,"volume":"liter","volumeDisplay":"Liter","createDate":"2013-12-05 55 | 05:16:50"}],"status":"success"}' 56 | http_version: 57 | recorded_at: Mon, 31 Mar 2014 20:13:23 GMT 58 | recorded_with: VCR 2.4.0 59 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Beers/_find/fetches_only_the_beer_asked_for.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/beer/99Uj1n?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:22 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '1156' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"message":"READ ONLY MODE: Request Successful","data":{"id":"99Uj1n","name":"Curmudgeon\u2019s 38 | Better Half","abv":"11.9","glasswareId":5,"styleId":13,"isOrganic":"N","labels":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/99Uj1n\/upload_vcInAc-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/99Uj1n\/upload_vcInAc-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/99Uj1n\/upload_vcInAc-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-02-21 39 | 11:27:00","updateDate":"2012-09-08 17:12:04","glass":{"id":5,"name":"Pint","createDate":"2012-01-03 40 | 02:41:33"},"style":{"id":13,"categoryId":1,"category":{"id":1,"name":"British 41 | Origin Ales","createDate":"2012-03-21 20:06:45"},"name":"Old Ale","description":"Dark 42 | amber to brown in color, old ales are medium to full bodied with a malty sweetness. 43 | Hop aroma should be minimal and flavor can vary from none to medium in character 44 | intensity. Fruity-ester flavors and aromas can contribute to the character 45 | of this ale. Bitterness should be minimal but evident and balanced with malt 46 | and\/or caramel-like sweetness. Alcohol types can be varied and complex. A 47 | distinctive quality of these ales is that they undergo an aging process (often 48 | for years) on their yeast either in bulk storage or through conditioning in 49 | the bottle, which contributes to a rich, wine-like and often sweet oxidation 50 | character. Complex estery characters may also emerge. Some very low diacetyl 51 | character may be evident and acceptable. Wood aged characters such as vanillin 52 | and other woody characters are acceptable. Horsey, goaty, leathery and phenolic 53 | character evolved from Brettanomyces organisms and acidity may be present 54 | but should be at low levels and balanced with other flavors Residual flavors 55 | that come from liquids previously aged in a barrel such as bourbon or sherry 56 | should not be present. Chill haze is acceptable at low temperatures. (This 57 | style may often be split into two categories, strong and very strong. Brettanomyces 58 | organisms and acidic characters reflect historical character. Competition 59 | organizers may choose to distinguish these types of old ale from modern versions.)","ibuMin":"30","ibuMax":"65","abvMin":"6","abvMax":"9","srmMin":"12","srmMax":"30","ogMin":"1.058","fgMin":"1.014","fgMax":"1.03","createDate":"2012-03-21 60 | 20:06:45"}},"status":"success"}' 61 | http_version: 62 | recorded_at: Mon, 31 Mar 2014 20:13:22 GMT 63 | recorded_with: VCR 2.4.0 64 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Search/_upc/for_an_existing_upc_code/returns_a_collection_with_the_matched_beer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/search/upc?key=API_KEY&code=030613000043 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:16 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '1342' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"currentPage":1,"numberOfPages":1,"totalResults":1,"data":[{"id":"LVjHK1","name":"Brooklyn 38 | Brown Ale","description":"This is the award-winning original American brown 39 | ale, first brewed as a holiday specialty, and now one of our most popular 40 | beers year-round. Northern English brown ales tend to be strong and dry, while 41 | southern English brown ales are milder and sweeter. Brooklyn Brown Ale combines 42 | the best of those classic styles and then adds an American accent in the form 43 | of a firm hop character and roasty palate. A blend of six malts, some of them 44 | roasted, give this beer its deep russet-brown color and complex malt flavor, 45 | fruity, smooth and rich, with a caramel, chocolate and coffee background. 46 | Generous late hopping brings forward a nice hop aroma to complete the picture. 47 | Brooklyn Brown Ale is full-flavored but retains a smoothness and easy drinkability 48 | that has made it one of the most popular dark beers in the Northeast.","abv":"5.6","ibu":"30","glasswareId":5,"availableId":1,"styleId":37,"isOrganic":"N","labels":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/LVjHK1\/upload_yxlhuf-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/LVjHK1\/upload_yxlhuf-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/beer\/LVjHK1\/upload_yxlhuf-large.png"},"status":"verified","statusDisplay":"Verified","foodPairings":"Brooklyn 49 | Brown Ale is particularly good with steaks, burgers, stews and barbecue, where 50 | it can put its caramel flavors to work with the caramelized flavors in the 51 | meat. It\u2019s also excellent with venison, ham and roasted pork, which engage 52 | the depth of malt character. Well-aged cheddar and sheep\u2019s milk cheese 53 | will pair up nicely.","originalGravity":"1.063","createDate":"2012-01-03 02:42:54","updateDate":"2013-08-13 54 | 15:55:57","glass":{"id":5,"name":"Pint","createDate":"2012-01-03 02:41:33"},"available":{"id":1,"name":"Year 55 | Round","description":"Available year round as a staple beer."},"style":{"id":37,"categoryId":3,"category":{"id":3,"name":"North 56 | American Origin Ales","createDate":"2012-03-21 20:06:45"},"name":"American-Style 57 | Brown Ale","description":"American brown ales range from deep copper to brown 58 | in color. Roasted malt caramel-like and chocolate-like characters should be 59 | of medium intensity in both flavor and aroma. American brown ales have evident 60 | low to medium hop flavor and aroma, medium to high hop bitterness, and a medium 61 | body. Estery and fruity-ester characters should be subdued. Diacetyl should 62 | not be perceived. Chill haze is allowable at cold temperatures.","ibuMin":"25","ibuMax":"45","abvMin":"4","abvMax":"6.4","srmMin":"15","srmMax":"26","ogMin":"1.04","fgMin":"1.01","fgMax":"1.018","createDate":"2012-03-21 63 | 20:06:46"},"fluidSize":{"id":9,"volume":"case","createDate":"2012-01-03 02:41:33"}}],"status":"success"}' 64 | http_version: 65 | recorded_at: Mon, 31 Mar 2014 20:13:16 GMT 66 | recorded_with: VCR 2.4.0 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BreweryDB 2 | 3 | [![Gem Version](http://img.shields.io/gem/v/brewery_db.svg)](https://rubygems.org/gems/brewery_db) 4 | [![Build Status](https://img.shields.io/travis/tylerhunt/brewery_db.svg)](https://travis-ci.org/tylerhunt/brewery_db) 5 | [![Code Climate](http://img.shields.io/codeclimate/github/tylerhunt/brewery_db.svg)](https://codeclimate.com/github/tylerhunt/brewery_db) 6 | [![Dependency Status](https://img.shields.io/gemnasium/tylerhunt/brewery_db.svg)](https://gemnasium.com/tylerhunt/brewery_db) 7 | 8 | A Ruby library for using the [BreweryDB][] API. 9 | 10 | [brewerydb]: http://www.brewerydb.com/ 11 | 12 | 13 | ## Requirements 14 | 15 | Tested and known to work with the following Rubies: 16 | 17 | - Ruby/MRI 1.9.2, 1.9.3, 2.0.0, 2.1 18 | - [JRuby][] 1.7.x in 1.9 mode 19 | - [Rubinius][] ~> 2.2 20 | 21 | [jruby]: http://jruby.org/ 22 | [rubinius]: http://rubini.us/ 23 | 24 | 25 | ## Installation 26 | 27 | Add this line to your application’s `Gemfile`: 28 | 29 | ```ruby 30 | gem 'brewery_db' 31 | ``` 32 | 33 | And then execute: 34 | 35 | $ bundle 36 | 37 | Or install it yourself as: 38 | 39 | $ gem install brewery_db 40 | 41 | 42 | ## Configuration 43 | 44 | You must have a valid API key to use the BreweryDB API. If you don’t yet have 45 | one, you may [request one here][api-key]. 46 | 47 | [api-key]: http://www.brewerydb.com/developers 48 | 49 | You can use the following method to configure your API key: 50 | 51 | ```ruby 52 | brewery_db = BreweryDB::Client.new do |config| 53 | config.api_key = API_KEY 54 | end 55 | ``` 56 | 57 | ### Logging 58 | 59 | Optionally, you can configure `BreweryDB` to use a logger for to help with 60 | request debugging. 61 | 62 | ```ruby 63 | brewery_db = BreweryDB::Client.new do |config| 64 | # ... 65 | config.logger = Rails.logger 66 | end 67 | ``` 68 | 69 | ## Usage 70 | 71 | Once an API key has been set, resources can be called on the client instance. 72 | 73 | ```ruby 74 | brewery_db.beers.all(abv: '5.5') 75 | brewery_db.beers.find('vYlBZQ') 76 | brewery_db.beers.random 77 | 78 | brewery_db.breweries.all(established: 2006) 79 | brewery_db.breweries.find('d1zSa7') 80 | 81 | brewery_db.brewery('d1zSa7').beers 82 | 83 | brewery_db.categories.all 84 | brewery_db.categories.find(1) 85 | 86 | brewery_db.fermentables.all(country: 'Brazil') 87 | brewery_db.fermentables.find(1924) 88 | 89 | brewery_db.fluid_size.all 90 | brewery_db.fluid_size.find(1) 91 | 92 | brewery_db.glassware.all 93 | brewery_db.glassware.find(1) 94 | 95 | brewery_db.hops.all 96 | brewery_db.hops.find(1) 97 | 98 | brewery_db.search.all(q: 'IPA') 99 | brewery_db.search.beers(q: 'IPA') 100 | brewery_db.search.breweries(q: 'IPA') 101 | brewery_db.search.guilds(q: 'IPA') 102 | brewery_db.search.events(q: 'IPA') 103 | brewery_db.search.upc(code: '030613000043') 104 | 105 | brewery_db.styles.all 106 | brewery_db.styles.find(1) 107 | 108 | brewery_db.locations.all(locality: 'San Francisco') 109 | 110 | brewery_db.yeasts.all 111 | brewery_db.yeasts.find(1836) 112 | 113 | brewery_db.menu.beer_availability 114 | ``` 115 | 116 | ### WebHooks 117 | 118 | The BreweryDB API also provides [webhooks][], which can be used to: 119 | 120 | > keep your local data stores in sync with the main BreweryDB API. Instead of 121 | > having to constantly query the API, webhooks will send you a message when 122 | > something changes. 123 | 124 | This library provides a simple abstraction over the data posted by those 125 | webhooks. 126 | 127 | ```ruby 128 | webhook = BreweryDB::WebHook.new(webhook_params_hash) 129 | ``` 130 | 131 | #### Validating a WebHook 132 | 133 | The `webhook_params_hash` should contain the `key`, `nonce`, `action`, etc. 134 | sent as the payload of the webhook. A `BreweryDB::WebHook` object can validate 135 | the posted data by SHA-1 hashing your API key with the `nonce` value and 136 | comparing it to the `key` value (as per the [docs][webhooks]). 137 | 138 | ```ruby 139 | webhook.valid?(API_KEY) # => true or false 140 | ``` 141 | 142 | #### Idiomatic Access to WebHook Parameters 143 | 144 | The `BreweryDB::WebHook` object also provides an idiomatic Ruby interface to 145 | the parameters. For example, one of the parameters posted in a webhook is 146 | `attributeId`, which is the BreweryDB ID for a brewery, beer, etc. This 147 | parameter is exposed by an instance of `BreweryDB::WebHook` as `#attribute_id`. 148 | 149 | Here’s the full list of parameters: 150 | 151 | ```ruby 152 | webhook.action #=> 'insert' 153 | webhook.attribute #=> 'beer' 154 | webhook.attribute_id #=> 'x6bRxw' 155 | webhook.key #=> 'some-long-key-value-here' 156 | webhook.nonce #=> 'some-long-nonce-value-here' 157 | webhook.sub_action #=> 'brewery-insert' 158 | webhook.sub_attribute_id #=> 'q6vJUK' 159 | webhook.timestamp #=> '1350573527' 160 | ``` 161 | 162 | [webhooks]: http://www.brewerydb.com/developers/docs-webhooks 163 | 164 | 165 | ### Examples 166 | 167 | Additional examples may be found in the `examples` directory. 168 | 169 | 170 | ## Contributing 171 | 172 | 1. Fork it. 173 | 2. Create your feature branch (`git checkout -b my-new-feature`). 174 | 3. Commit your changes (`git commit -am 'Added some feature'`). 175 | 4. Push to the branch (`git push origin my-new-feature`). 176 | 5. Create a new Pull Request. 177 | 178 | 179 | ## Contributors 180 | 181 | Thanks to the following people who have contributed patches or helpful 182 | suggestions: 183 | 184 | * [Steven Harman](https://github.com/stevenharman) 185 | * [Jésus Lopes](https://github.com/jtadeulopes) 186 | * [Matt Griffin](https://github.com/betamatt) 187 | 188 | 189 | ## Copyright 190 | 191 | Copyright © 2012 Tyler Hunt. See LICENSE for details. 192 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Fermentables/_all/fetches_all_of_the_fermentables_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/fermentables?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:23 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '2727' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"currentPage":1,"numberOfPages":5,"totalResults":222,"data":[{"id":165,"name":"Abbey 38 | Malt","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 39 | 16:07:41"},{"id":166,"name":"Acidulated Malt","description":"Lowers mash, 40 | wort, and beer pH. Contains 1-2% lactic acid. Enhances enzymatic activity 41 | in mash and improves extract efficiency. Lightens color in pale brews. Enhances 42 | stability and extends shelf life of finished beer. Promotes well-rounded, 43 | complex beer flavor.","countryOfOrigin":"DE","srmId":3,"srmPrecise":3,"moistureContent":7,"dryYield":58.4,"potential":1.027,"protein":12,"maxInBatch":10,"requiresMashing":"Y","characteristics":[{"id":9,"name":"Head","description":"Helps 44 | the head retention of the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 45 | Grains, & Fermentables","createDate":"2013-06-24 16:07:41","updateDate":"2013-06-24 46 | 16:10:14","srm":{"id":3,"name":"3","hex":"FFCA5A"},"country":{"isoCode":"DE","name":"GERMANY","displayName":"Germany","isoThree":"DEU","numberCode":276,"createDate":"2012-01-03 47 | 02:41:33"}},{"id":181,"name":"Amber Malt","description":"Roasted specialty 48 | malt used in some English browns, milds and old ales to add color and a biscuit 49 | taste. Intense flavour","countryOfOrigin":"GB","srmId":22,"srmPrecise":22,"moistureContent":2.8,"coarseFineDifference":1.5,"diastaticPower":20,"dryYield":75,"potential":1.035,"protein":10,"maxInBatch":20,"requiresMashing":"Y","characteristics":[{"id":2,"name":"Biscuit","description":"Imparts 50 | a biscuity quality upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 51 | Grains, & Fermentables","createDate":"2013-06-24 16:07:41","updateDate":"2013-06-24 52 | 16:10:14","srm":{"id":22,"name":"22","hex":"8E2900"},"country":{"isoCode":"GB","name":"UNITED 53 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 54 | 02:41:33"}},{"id":209,"name":"Aromatic Malt","description":"Aromatic malt 55 | is a kilned barley malt used to give beer a strong, aggressive malt aroma 56 | and rich color.","countryOfOrigin":"BE","srmId":26,"srmPrecise":26,"dryYield":77.9,"potential":1.036,"maxInBatch":100,"requiresMashing":"Y","characteristics":[{"id":1,"name":"Aromatic","description":"Imparts 57 | an aromatic quality upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":10,"name":"Malty","description":"Imparts 58 | a malty flavor upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 59 | Grains, & Fermentables","createDate":"2013-06-24 16:07:41","updateDate":"2013-06-24 60 | 16:10:14","srm":{"id":26,"name":"26","hex":"771900"},"country":{"isoCode":"BE","name":"BELGIUM","displayName":"Belgium","isoThree":"BEL","numberCode":56,"createDate":"2012-01-03 61 | 02:41:33"}},{"id":1958,"name":"Asheburne Mild Malt","category":"malt","categoryDisplay":"Malts, 62 | Grains, & Fermentables","createDate":"2013-06-24 16:07:59"},{"id":1987,"name":"Bamberg 63 | Smoked Malt","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 64 | 16:08:00"},{"id":184,"name":"Barley - Black","description":"Unmalted barley 65 | roasted at high temperature to create a dry, coffee-like flavor. Imparts the 66 | sharp, acrid flavor characteristic of dry stouts. Gives dryness to a stout 67 | or porter -- much more so than regular Roasted Barley.","countryOfOrigin":"US","srmId":41,"srmPrecise":500,"moistureContent":5,"coarseFineDifference":1.5,"dryYield":55,"potential":1.025,"protein":13.2,"maxInBatch":10,"requiresMashing":"N","category":"malt","categoryDisplay":"Malts, 68 | Grains, & Fermentables","createDate":"2013-06-24 16:07:41","updateDate":"2013-06-24 69 | 16:10:14","srm":{"id":41,"name":"Over 40","hex":"000000"},"country":{"isoCode":"US","name":"UNITED 70 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 71 | 02:41:33"}},{"id":534,"name":"Barley - Flaked","category":"malt","categoryDisplay":"Malts, 72 | Grains, & Fermentables","createDate":"2013-06-24 16:07:50"},{"id":214,"name":"Barley 73 | - Hulls","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 74 | 16:07:42"},{"id":302,"name":"Barley - Lightly Roasted","category":"malt","categoryDisplay":"Malts, 75 | Grains, & Fermentables","createDate":"2013-06-24 16:07:43"},{"id":1947,"name":"Barley 76 | - Malted","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 77 | 16:07:58"},{"id":217,"name":"Barley - Raw","category":"malt","categoryDisplay":"Malts, 78 | Grains, & Fermentables","createDate":"2013-06-24 16:07:42"},{"id":753,"name":"Barley 79 | - Roasted","description":"Unmalted and roasted at high temperature to create 80 | a burnt, grainy, coffee-like flavor. Imparts a red to deep brown color to 81 | beer, and very strong roasted flavor. Use 2-4% in Brown ales to add a nutty 82 | flavor, or 3-10% in Porters and Stouts for coffee flavor.","countryOfOrigin":"US","srmId":41,"srmPrecise":300,"moistureContent":5,"coarseFineDifference":1.5,"dryYield":55,"potential":1.025,"protein":13.2,"maxInBatch":10,"requiresMashing":"N","characteristics":[{"id":4,"name":"Burnt","description":"Imparts 83 | a burnt tasting quality upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":7,"name":"Coffee","description":"Imparts 84 | a coffee flavor upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":8,"name":"Grainy","description":"Imparts 85 | a grainty taste upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":11,"name":"Nutty","description":"Imparts 86 | a nutty flavor upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":12,"name":"Roasted","description":"Imparts 87 | a roasted flavor upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 88 | Grains, & Fermentables","createDate":"2013-06-24 16:07:54","updateDate":"2013-06-24 89 | 16:10:14","srm":{"id":41,"name":"Over 40","hex":"000000"},"country":{"isoCode":"US","name":"UNITED 90 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 91 | 02:41:33"}},{"id":1930,"name":"Barley - Roasted\/De-husked","category":"malt","categoryDisplay":"Malts, 92 | Grains, & Fermentables","createDate":"2013-06-24 16:07:57"},{"id":218,"name":"Barley 93 | - Torrefied","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 94 | 16:07:42"},{"id":1925,"name":"Beechwood Smoked","category":"malt","categoryDisplay":"Malts, 95 | Grains, & Fermentables","createDate":"2013-06-24 16:07:57"},{"id":246,"name":"Biscuit 96 | Malt","description":"Another Belgian malt, this gives a biscuit like flavor 97 | and aroma. Use for English ales, brown ales and porters. Can be used as a 98 | substitute for toasted malt.","countryOfOrigin":"BE","srmId":23,"srmPrecise":23,"moistureContent":4,"coarseFineDifference":1.5,"diastaticPower":6,"dryYield":79,"potential":1.036,"protein":10.5,"maxInBatch":10,"requiresMashing":"Y","characteristics":[{"id":1,"name":"Aromatic","description":"Imparts 99 | an aromatic quality upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":2,"name":"Biscuit","description":"Imparts 100 | a biscuity quality upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 101 | Grains, & Fermentables","createDate":"2013-06-24 16:07:42","updateDate":"2013-06-24 102 | 16:10:14","srm":{"id":23,"name":"23","hex":"882300"},"country":{"isoCode":"BE","name":"BELGIUM","displayName":"Belgium","isoThree":"BEL","numberCode":56,"createDate":"2012-01-03 103 | 02:41:33"}},{"id":247,"name":"Black Malt","characteristics":[{"id":7,"name":"Coffee","description":"Imparts 104 | a coffee flavor upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 105 | Grains, & Fermentables","createDate":"2013-06-24 16:07:42"},{"id":501,"name":"Black 106 | Malt - Debittered","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 107 | 16:07:49"},{"id":270,"name":"Black Malt - Organic","category":"malt","categoryDisplay":"Malts, 108 | Grains, & Fermentables","createDate":"2013-06-24 16:07:42"},{"id":1955,"name":"Black 109 | Patent","description":"Black patent malt, sometimes called simply black malt, 110 | is the darkest of the common roasted malts. It gives beer dark color and flavor 111 | with a very different character than roasted barley.","srmId":41,"srmPrecise":500,"dryYield":54.1,"potential":1.025,"maxInBatch":10,"requiresMashing":"N","characteristics":[{"id":4,"name":"Burnt","description":"Imparts 112 | a burnt tasting quality upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":12,"name":"Roasted","description":"Imparts 113 | a roasted flavor upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 114 | Grains, & Fermentables","createDate":"2013-06-24 16:07:59","updateDate":"2013-06-24 115 | 16:10:14","srm":{"id":41,"name":"Over 40","hex":"000000"}},{"id":186,"name":"Black 116 | Roast","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 117 | 16:07:41"},{"id":254,"name":"Black Treacle","category":"malt","categoryDisplay":"Malts, 118 | Grains, & Fermentables","createDate":"2013-06-24 16:07:42"},{"id":271,"name":"Blackprinz 119 | Malt","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 120 | 16:07:42"},{"id":1974,"name":"Blue Agave Nectar","category":"malt","categoryDisplay":"Malts, 121 | Grains, & Fermentables","createDate":"2013-06-24 16:07:59"},{"id":1973,"name":"Blue 122 | Corn","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 123 | 16:07:59"},{"id":272,"name":"Bonlander","category":"malt","categoryDisplay":"Malts, 124 | Grains, & Fermentables","createDate":"2013-06-24 16:07:43"},{"id":338,"name":"Brown 125 | Malt","description":"Imparts a dry, biscuit flavor. Used in nut brown ales, 126 | porters and some Belgian ales.","countryOfOrigin":"GB","srmId":65,"srmPrecise":65,"moistureContent":4,"coarseFineDifference":1.5,"dryYield":70,"potential":1.032,"maxInBatch":10,"requiresMashing":"Y","characteristics":[{"id":2,"name":"Biscuit","description":"Imparts 127 | a biscuity quality upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 128 | Grains, & Fermentables","createDate":"2013-06-24 16:07:44","updateDate":"2013-06-24 129 | 16:10:14","country":{"isoCode":"GB","name":"UNITED KINGDOM","displayName":"United 130 | Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 02:41:33"}},{"id":339,"name":"Brown 131 | Sugar","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 132 | 16:07:44"},{"id":1994,"name":"Brumalt","description":"Dark German malt developed 133 | to add malt flavor of Alt, Marzen and Oktoberfest beers. Helps create authentic 134 | maltiness without having to do a decoction mash. Rarely available for homebrewers.","countryOfOrigin":"DE","srmId":23,"srmPrecise":23,"moistureContent":4,"coarseFineDifference":1.5,"dryYield":71.7,"potential":1.033,"protein":7,"maxInBatch":10,"requiresMashing":"Y","characteristics":[{"id":10,"name":"Malty","description":"Imparts 135 | a malty flavor upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 136 | Grains, & Fermentables","createDate":"2013-06-24 16:10:14","srm":{"id":23,"name":"23","hex":"882300"},"country":{"isoCode":"DE","name":"GERMANY","displayName":"Germany","isoThree":"DEU","numberCode":276,"createDate":"2012-01-03 137 | 02:41:33"}},{"id":757,"name":"Buckwheat - Roasted","category":"malt","categoryDisplay":"Malts, 138 | Grains, & Fermentables","createDate":"2013-06-24 16:07:54"},{"id":1956,"name":"Canada 139 | 2-Row Silo","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 140 | 16:07:59"},{"id":1983,"name":"Cara Malt","category":"malt","categoryDisplay":"Malts, 141 | Grains, & Fermentables","createDate":"2013-06-24 16:08:00"},{"id":366,"name":"CaraAmber","category":"malt","categoryDisplay":"Malts, 142 | Grains, & Fermentables","createDate":"2013-06-24 16:07:44"},{"id":367,"name":"CaraAroma","description":"Very 143 | dark crystal malt - similar to a crystal 120 or Caramunich 120 malt. Adds 144 | strong caramel flavor, red color, and malty aroma.","countryOfOrigin":"DE","srmId":41,"srmPrecise":130,"moistureContent":4,"coarseFineDifference":1.5,"dryYield":75,"potential":1.035,"protein":11.7,"maxInBatch":15,"requiresMashing":"N","characteristics":[{"id":3,"name":"Body","description":"Increases 145 | the body of the beer.","createDate":"2013-06-24 16:07:26"},{"id":5,"name":"Caramel","description":"Imparts 146 | a caramel quality upon the beer.","createDate":"2013-06-24 16:07:26"},{"id":9,"name":"Head","description":"Helps 147 | the head retention of the beer.","createDate":"2013-06-24 16:07:26"},{"id":10,"name":"Malty","description":"Imparts 148 | a malty flavor upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 149 | Grains, & Fermentables","createDate":"2013-06-24 16:07:44","updateDate":"2013-06-24 150 | 16:10:14","srm":{"id":41,"name":"Over 40","hex":"000000"},"country":{"isoCode":"DE","name":"GERMANY","displayName":"Germany","isoThree":"DEU","numberCode":276,"createDate":"2012-01-03 151 | 02:41:33"}},{"id":368,"name":"CaraBelge","category":"malt","categoryDisplay":"Malts, 152 | Grains, & Fermentables","createDate":"2013-06-24 16:07:44"},{"id":369,"name":"CaraBohemian","category":"malt","categoryDisplay":"Malts, 153 | Grains, & Fermentables","createDate":"2013-06-24 16:07:44"},{"id":273,"name":"CaraBrown","category":"malt","categoryDisplay":"Malts, 154 | Grains, & Fermentables","createDate":"2013-06-24 16:07:43"},{"id":370,"name":"Carafa 155 | I","description":"Used to intensify aroma and color in dark Munich beers and 156 | stouts.","countryOfOrigin":"DE","srmId":41,"srmPrecise":337,"moistureContent":4,"coarseFineDifference":1.5,"dryYield":70,"potential":1.032,"protein":11.7,"maxInBatch":5,"requiresMashing":"N","characteristics":[{"id":1,"name":"Aromatic","description":"Imparts 157 | an aromatic quality upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 158 | Grains, & Fermentables","createDate":"2013-06-24 16:07:44","updateDate":"2013-06-24 159 | 16:10:14","srm":{"id":41,"name":"Over 40","hex":"000000"},"country":{"isoCode":"DE","name":"GERMANY","displayName":"Germany","isoThree":"DEU","numberCode":276,"createDate":"2012-01-03 160 | 02:41:33"}},{"id":371,"name":"Carafa II","description":"Used to intensify 161 | aroma and color in dark Munich beers and stouts.","countryOfOrigin":"DE","srmId":41,"srmPrecise":412,"moistureContent":4,"coarseFineDifference":1.5,"dryYield":70,"potential":1.032,"protein":11.7,"maxInBatch":5,"requiresMashing":"N","characteristics":[{"id":1,"name":"Aromatic","description":"Imparts 162 | an aromatic quality upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 163 | Grains, & Fermentables","createDate":"2013-06-24 16:07:45","updateDate":"2013-06-24 164 | 16:10:14","srm":{"id":41,"name":"Over 40","hex":"000000"},"country":{"isoCode":"DE","name":"GERMANY","displayName":"Germany","isoThree":"DEU","numberCode":276,"createDate":"2012-01-03 165 | 02:41:33"}},{"id":372,"name":"Carafa III","description":"Used to intensify 166 | aroma and color in dark Munich beers and stouts.","countryOfOrigin":"DE","srmId":41,"srmPrecise":525,"moistureContent":4,"coarseFineDifference":1.5,"dryYield":70,"potential":1.032,"protein":11.7,"maxInBatch":5,"requiresMashing":"N","characteristics":[{"id":1,"name":"Aromatic","description":"Imparts 167 | an aromatic quality upon the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 168 | Grains, & Fermentables","createDate":"2013-06-24 16:07:45","updateDate":"2013-06-24 169 | 16:10:14","srm":{"id":41,"name":"Over 40","hex":"000000"},"country":{"isoCode":"DE","name":"GERMANY","displayName":"Germany","isoThree":"DEU","numberCode":276,"createDate":"2012-01-03 170 | 02:41:33"}},{"id":1988,"name":"Carafa Special","category":"malt","categoryDisplay":"Malts, 171 | Grains, & Fermentables","createDate":"2013-06-24 16:08:00"},{"id":376,"name":"CaraFoam","description":"Significantly 172 | increases foam\/head retention and body of the beer.","srmId":1,"srmPrecise":1,"characteristics":[{"id":3,"name":"Body","description":"Increases 173 | the body of the beer.","createDate":"2013-06-24 16:07:26"},{"id":9,"name":"Head","description":"Helps 174 | the head retention of the beer.","createDate":"2013-06-24 16:07:26"}],"category":"malt","categoryDisplay":"Malts, 175 | Grains, & Fermentables","createDate":"2013-06-24 16:07:45","updateDate":"2013-06-24 176 | 16:10:14","srm":{"id":1,"name":"1","hex":"FFE699"}},{"id":828,"name":"CaraHell","category":"malt","categoryDisplay":"Malts, 177 | Grains, & Fermentables","createDate":"2013-06-24 16:07:56"},{"id":378,"name":"Caramel\/Crystal 178 | Malt","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 179 | 16:07:45"},{"id":564,"name":"Caramel\/Crystal Malt - Dark","category":"malt","categoryDisplay":"Malts, 180 | Grains, & Fermentables","createDate":"2013-06-24 16:07:51"},{"id":777,"name":"Caramel\/Crystal 181 | Malt - Extra Dark","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 182 | 16:07:54"},{"id":364,"name":"Caramel\/Crystal Malt - Gold","category":"malt","categoryDisplay":"Malts, 183 | Grains, & Fermentables","createDate":"2013-06-24 16:07:44"},{"id":780,"name":"Caramel\/Crystal 184 | Malt - Heritage","category":"malt","categoryDisplay":"Malts, Grains, & Fermentables","createDate":"2013-06-24 185 | 16:07:54"},{"id":566,"name":"Caramel\/Crystal Malt - Light","category":"malt","categoryDisplay":"Malts, 186 | Grains, & Fermentables","createDate":"2013-06-24 16:07:51"}],"status":"success"}' 187 | http_version: 188 | recorded_at: Mon, 31 Mar 2014 20:13:23 GMT 189 | recorded_with: VCR 2.4.0 190 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Yeasts/_all/fetches_all_of_the_yeasts_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/yeasts?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:27 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '4353' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"currentPage":1,"numberOfPages":9,"totalResults":404,"data":[{"id":1531,"name":"10th 38 | Anniversary Blend","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 39 | 16:08:57"},{"id":1756,"name":"Abbey Ale","description":"Used to produce Trappist 40 | style beers. Similar to WLP500, but is less fruity and more alcohol tolerant 41 | (up to 15% ABV). Excellent yeast for high gravity beers, Belgian ales, dubbels 42 | and trippels.","yeastType":"ale","attenuationMin":75,"attenuationMax":80,"fermentTempMin":66,"fermentTempMax":72,"alcoholToleranceMin":10,"alcoholToleranceMax":15,"productId":"WLP530","supplier":"White 43 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 44 | 16:09:16","updateDate":"2013-06-24 16:10:52"},{"id":1532,"name":"Abbey Ale","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 45 | 16:08:57"},{"id":1757,"name":"Abbey IV Ale","description":"An authentic Trappist 46 | style yeast. Use for Belgian style ales, dubbels, trippels, and specialty 47 | beers. Fruit character is medium, in between WLP500 (high) and WLP530 (low).","yeastType":"ale","attenuationMin":74,"attenuationMax":82,"fermentTempMin":66,"fermentTempMax":72,"alcoholToleranceMin":10,"alcoholToleranceMax":15,"productId":"WLP540","supplier":"White 48 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 49 | 16:09:16","updateDate":"2013-06-24 16:10:52"},{"id":1835,"name":"American 50 | Ale","description":"Very clean, crisp flavor characteristics with low fruitiness 51 | and mild ester production. A very versatile yeast for styles that desire dominant 52 | malt and hop character. This strain makes a wonderful ?House? strain. Mild 53 | citrus notes develop with cooler 60-66?F (15-19?C) fermentations. Normally 54 | requires filtration for bright beers.","yeastType":"ale","attenuationMin":73,"attenuationMax":77,"fermentTempMin":60,"fermentTempMax":72,"alcoholToleranceMin":11,"alcoholToleranceMax":11,"productId":"1056","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 55 | 16:09:23","updateDate":"2013-06-24 16:10:52"},{"id":1533,"name":"American 56 | Ale","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 57 | 16:08:57"},{"id":1534,"name":"American Ale Blend","description":"Our most 58 | popular yeast strain is WLP001, California Ale Yeast. This blend celebrates 59 | the strengths of California- clean, neutral fermentation, versatile usage, 60 | and adds two other strains that belong to the same ''clean\/neutral'' flavor 61 | category. The additional strains create complexity to the finished beer. This 62 | blend tastes more lager like than WLP001. Hop flavors and bitterness are accentuated, 63 | but not to the extreme of California. Slight sulfur will be produced during 64 | fermentation.","yeastType":"ale","attenuationMin":72,"attenuationMax":80,"fermentTempMin":68,"fermentTempMax":72,"alcoholToleranceMin":8,"alcoholToleranceMax":12,"productId":"WLP060","supplier":"White 65 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 66 | 16:08:57","updateDate":"2013-06-24 16:10:52"},{"id":1836,"name":"American 67 | Ale II","description":"With many of the best qualities that brewers look for 68 | when brewing American styles of beer, this strain?s performance is consistent 69 | and it makes great beer. This versatile strain is a very good choice for a 70 | ?House? strain. Expect a soft, clean profile with hints of nut, and a slightly 71 | tart finish. Ferment at warmer temperatures to accentuate hop character with 72 | an increased fruitiness. Or, ferment cool for a clean, light citrus character. 73 | It attenuates well and is reliably flocculent, producing bright beer without 74 | filtration.","yeastType":"ale","attenuationMin":72,"attenuationMax":76,"fermentTempMin":60,"fermentTempMax":72,"alcoholToleranceMin":10,"alcoholToleranceMax":10,"productId":"1272","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 75 | 16:09:23","updateDate":"2013-06-24 16:10:52"},{"id":1535,"name":"American 76 | Ale II","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 77 | 16:08:58"},{"id":1536,"name":"American Hefeweizen Ale","description":"This 78 | yeast is used to produce the Oregon style American Hefeweizen. Unlike WLP300, 79 | this yeast produces a very slight amount of the banana and clove notes. It 80 | produces some sulfur, but is otherwise a clean fermenting yeast, which does 81 | not flocculate well, producing a cloudy beer.","yeastType":"wheat","attenuationMin":70,"attenuationMax":75,"fermentTempMin":65,"fermentTempMax":69,"alcoholToleranceMin":5,"alcoholToleranceMax":10,"productId":"WLP320","supplier":"White 82 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 83 | 16:08:58","updateDate":"2013-06-24 16:10:52"},{"id":1537,"name":"American 84 | Lager","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 85 | 16:08:58"},{"id":1837,"name":"American Lager","description":"A complex and 86 | aromatic strain that can be used for a variety of lager beers. This strain 87 | is an excellent choice for Classic American Pilsner beers.","yeastType":"lager","attenuationMin":73,"attenuationMax":77,"fermentTempMin":48,"fermentTempMax":58,"alcoholToleranceMin":9,"alcoholToleranceMax":9,"productId":"2035","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 88 | 16:09:23","updateDate":"2013-06-24 16:10:53"},{"id":1761,"name":"American 89 | Lager","description":"This yeast is used to produce American style lagers. 90 | Dry and clean with a very slight apple fruitiness. Sulfur and diacetyl production 91 | is minimal.","yeastType":"lager","attenuationMin":75,"attenuationMax":80,"fermentTempMin":50,"fermentTempMax":55,"alcoholToleranceMin":5,"alcoholToleranceMax":10,"productId":"WLP840","supplier":"White 92 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 93 | 16:09:16","updateDate":"2013-06-24 16:10:52"},{"id":1538,"name":"American 94 | Megabrewery","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 95 | 16:08:58"},{"id":1539,"name":"American Microbrewery Ale No.1","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 96 | 16:08:58"},{"id":1540,"name":"American Microbrewery Ale No.2","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 97 | 16:08:58"},{"id":1541,"name":"American Microbrewery Lager","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 98 | 16:08:58"},{"id":1838,"name":"American Wheat","description":"A strong fermenting, 99 | true top cropping yeast that produces a dry, slightly tart, crisp beer. Ideal 100 | for beers when a low ester profile is desirable.","yeastType":"ale","attenuationMin":74,"attenuationMax":78,"fermentTempMin":58,"fermentTempMax":74,"alcoholToleranceMin":10,"alcoholToleranceMax":10,"productId":"1010","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 101 | 16:09:23","updateDate":"2013-06-24 16:10:52"},{"id":1542,"name":"American 102 | Wheat Ale","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 103 | 16:08:58"},{"id":1543,"name":"American White Ale","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 104 | 16:08:58"},{"id":1762,"name":"Antwerp Ale","description":"Clean, almost lager 105 | like Belgian type ale yeast. Good for Belgian type pales ales and amber ales, 106 | or with blends to combine with other Belgian type yeast strains. Biscuity, 107 | ale like aroma present. Hop flavors and bitterness are accentuated. Slight 108 | sulfur will be produced during fermentation, which can give the yeast a lager 109 | like flavor profile.","yeastType":"ale","attenuationMin":73,"attenuationMax":80,"fermentTempMin":67,"fermentTempMax":70,"alcoholToleranceMin":5,"alcoholToleranceMax":10,"productId":"WLP515","supplier":"White 110 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 111 | 16:09:16","updateDate":"2013-06-24 16:10:52"},{"id":1946,"name":"Assmanshausen 112 | Wine","description":"German red wine yeast, which results in spicy, fruit 113 | aromas. Perfect for Pinot Noir and Zinfandel. Slow to moderate fermenter which 114 | is cold tolerant.","yeastType":"wine","attenuationMin":80,"fermentTempMin":50,"fermentTempMax":90,"alcoholToleranceMin":16,"alcoholToleranceMax":16,"productId":"WLP749","supplier":"White 115 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 116 | 16:10:52"},{"id":1544,"name":"Attenuation 80 percent","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 117 | 16:08:58"},{"id":1763,"name":"Australian Ale","description":"Produces a clean, 118 | malty beer. Pleasant ester character, can be described as \"bready.\" Can 119 | ferment successfully, and clean, at higher temperatures. This yeast combines 120 | good flocculation with good attenuation.","yeastType":"ale","attenuationMin":70,"attenuationMax":75,"fermentTempMin":65,"fermentTempMax":70,"alcoholToleranceMin":5,"alcoholToleranceMax":10,"productId":"WLP009","supplier":"White 121 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 122 | 16:09:16","updateDate":"2013-06-24 16:10:52"},{"id":1942,"name":"Avize Wine","description":"Champagne 123 | isolate used for complexity in whites. Contributes elegance, especially in 124 | barrel fermented Chardonnays.","yeastType":"wine","attenuationMin":80,"fermentTempMin":60,"fermentTempMax":90,"alcoholToleranceMin":15,"alcoholToleranceMax":15,"productId":"WLP718","supplier":"White 125 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 126 | 16:10:52"},{"id":1545,"name":"Bastogne Belgian Ale","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 127 | 16:08:58"},{"id":1546,"name":"Bavarian Lager","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 128 | 16:08:58"},{"id":1839,"name":"Bavarian Lager","description":"Used by many 129 | German breweries to produce rich, full-bodied, malty beers, this strain is 130 | a good choice for bocks and dopplebocks. A thorough diacetyl rest is recommended 131 | after fermentation is complete.","yeastType":"lager","attenuationMin":73,"attenuationMax":77,"fermentTempMin":46,"fermentTempMax":58,"alcoholToleranceMin":9,"alcoholToleranceMax":9,"productId":"2206","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 132 | 16:09:23","updateDate":"2013-06-24 16:10:53"},{"id":1764,"name":"Bavarian 133 | Weizen","description":"Former Yeast Lab W51 yeast strain, acquired from Dan 134 | McConnell. The description originally used by Yeast Lab still fits: \"This 135 | strain produces a classic German-style wheat beer, with moderately high, spicy, 136 | phenolic overtones reminiscent of cloves.\"","yeastType":"wheat","attenuationMin":73,"attenuationMax":77,"fermentTempMin":66,"fermentTempMax":70,"alcoholToleranceMin":5,"alcoholToleranceMax":10,"productId":"WLP351","supplier":"White 137 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 138 | 16:09:16","updateDate":"2013-06-24 16:10:52"},{"id":1547,"name":"Bavarian 139 | Wheat","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 140 | 16:08:58"},{"id":1841,"name":"Bavarian Wheat","description":"A complex alternative 141 | to the standard German wheat strain profile. This strain produces apple, pear, 142 | and plum esters in addition to the dominant banana character. The esters are 143 | complemented nicely by clove and subtle vanilla phenolics. The balance can 144 | be manipulated towards ester production through increasing fermentation temperature, 145 | increasing the wort density, and decreasing the pitch rate. Over pitching 146 | can result in a near complete loss of banana character. Decreasing the ester 147 | level will allow a higher clove character to be perceived. Sulfur is commonly 148 | produced, but will dissipate with conditioning. This strain is very powdery 149 | and will remain in suspension for an extended amount of time following attenuation. 150 | This is true top cropping yeast and requires fermenter headspace of 33%.","yeastType":"ale","attenuationMin":70,"attenuationMax":76,"fermentTempMin":64,"fermentTempMax":75,"alcoholToleranceMin":10,"alcoholToleranceMax":10,"productId":"3638","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 151 | 16:09:24","updateDate":"2013-06-24 16:10:53"},{"id":1840,"name":"Bavarian 152 | Wheat Blend","description":"This proprietary blend of a top-fermenting neutral 153 | ale strain and a Bavarian wheat strain is a great choice when a subtle German 154 | style wheat beer is desired. The complex esters and phenolics from the wheat 155 | strain are nicely softened and balanced by the neutral ale strain.","yeastType":"wheat","attenuationMin":73,"attenuationMax":77,"fermentTempMin":64,"fermentTempMax":74,"alcoholToleranceMin":10,"alcoholToleranceMax":10,"productId":"3056","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 156 | 16:09:23","updateDate":"2013-06-24 16:10:53"},{"id":1548,"name":"Bavarian 157 | Wheat Yeast","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 158 | 16:08:59"},{"id":1549,"name":"Bedford British","description":"Ferments dry 159 | and flocculates very well. Produces a distinctive ester profile. Good choice 160 | for most English style ales including bitter, pale ale, porter, and brown 161 | ale.","yeastType":"ale","attenuationMin":72,"attenuationMax":80,"fermentTempMin":65,"fermentTempMax":70,"alcoholToleranceMin":5,"alcoholToleranceMax":10,"productId":"WLP006","supplier":"White 162 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 163 | 16:08:59","updateDate":"2013-06-24 16:10:52"},{"id":1842,"name":"Belgian Abbey","description":"A 164 | widely used and alcohol tolerant Abbey yeast that is suitable for a variety 165 | of Belgian style ales. This strain produces a nice ester profile as well as 166 | slightly spicy alcohol notes. It can be slow to start; however, it attenuates 167 | well.","yeastType":"ale","attenuationMin":74,"attenuationMax":78,"fermentTempMin":68,"fermentTempMax":78,"alcoholToleranceMin":12,"alcoholToleranceMax":12,"productId":"1214","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 168 | 16:09:24","updateDate":"2013-06-24 16:10:53"},{"id":1550,"name":"Belgian Abbey 169 | II","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 170 | 16:08:59"},{"id":1843,"name":"Belgian Abbey II","description":"An excellent 171 | yeast strain for use in Belgian dark strong ales. This strain has a relatively 172 | ?clean profile? which allows a rich malt and distinctive ethanol character 173 | to shine. Delicate dried fruit esters can be produced when used at higher 174 | fermentation temperatures or in a high gravity wort.","yeastType":"ale","attenuationMin":73,"attenuationMax":77,"fermentTempMin":65,"fermentTempMax":75,"alcoholToleranceMin":12,"alcoholToleranceMax":12,"productId":"1762","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 175 | 16:09:24","updateDate":"2013-06-24 16:10:53"},{"id":1551,"name":"Belgian Ale","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 176 | 16:08:59"},{"id":1766,"name":"Belgian Ale","description":"Saisons, Belgian 177 | Ales, Belgian Reds, Belgian Browns, and White beers are just a few of the 178 | classic Belgian beer styles that can be created with this yeast strain. Phenolic 179 | and spicy flavors dominate the profile, with less fruitiness then WLP500.","yeastType":"ale","attenuationMin":78,"attenuationMax":85,"fermentTempMin":68,"fermentTempMax":78,"alcoholToleranceMin":8,"alcoholToleranceMax":12,"productId":"WLP550","supplier":"White 180 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 181 | 16:09:17","updateDate":"2013-06-24 16:10:52"},{"id":1552,"name":"Belgian Ale 182 | No.1","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 183 | 16:08:59"},{"id":1553,"name":"Belgian Ale No.2","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 184 | 16:08:59"},{"id":1554,"name":"Belgian Ale No.3","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 185 | 16:08:59"},{"id":1555,"name":"Belgian Ardennes","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 186 | 16:08:59"},{"id":1845,"name":"Belgian Ardennes","description":"One of the 187 | great and versatile strains for the production of classic Belgian style ales. 188 | This strain produces a beautiful balance of delicate fruit esters and subtle 189 | spicy notes; with neither one dominating. Unlike many other Belgian style 190 | strains, this strain is highly flocculent and results in bright beers.","yeastType":"ale","attenuationMin":72,"attenuationMax":76,"fermentTempMin":65,"fermentTempMax":76,"alcoholToleranceMin":12,"alcoholToleranceMax":12,"productId":"3522","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 191 | 16:09:24","updateDate":"2013-06-24 16:10:53"},{"id":1767,"name":"Belgian Bastogne 192 | Ale","description":"A high gravity, Trappist style ale yeast. Produces dry 193 | beer with slight acidic finish. More ?clean? fermentation character than WLP500 194 | or WLP530. Not as spicy as WLP530 or WLP550. Excellent yeast for high gravity 195 | beers, Belgian ales, dubbels and trippels.","yeastType":"ale","attenuationMin":74,"attenuationMax":80,"fermentTempMin":66,"fermentTempMax":72,"alcoholToleranceMin":10,"alcoholToleranceMax":15,"productId":"WLP510","supplier":"White 196 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 197 | 16:09:17","updateDate":"2013-06-24 16:10:52"},{"id":1556,"name":"Belgian Golden 198 | Ale","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 199 | 16:08:59"},{"id":1768,"name":"Belgian Golden Ale","description":"From East 200 | Flanders, versatile yeast that can produce light Belgian ales to high gravity 201 | Belgian beers (12% ABV). A combination of fruitiness and phenolic characteristics 202 | dominate the flavor profile. Some sulfur is produced during fermentation, 203 | which will dissipate following the end of fermentation.","yeastType":"ale","attenuationMin":73,"attenuationMax":78,"fermentTempMin":68,"fermentTempMax":75,"alcoholToleranceMin":10,"alcoholToleranceMax":15,"productId":"WLP570","supplier":"White 204 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 205 | 16:09:17","updateDate":"2013-06-24 16:10:52"},{"id":1950,"name":"Belgian Lager","description":"Clean, 206 | crisp European lager yeast with low sulfur production. The strain originates 207 | from a very old brewery in West Belgium. Great for European style pilsners, 208 | dark lagers, Vienna lager, and American style lagers.","yeastType":"lager","attenuationMin":72,"attenuationMax":78,"fermentTempMin":50,"fermentTempMax":55,"alcoholToleranceMin":5,"alcoholToleranceMax":10,"productId":"WLP815","supplier":"White 209 | Labs","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 210 | 16:10:52"},{"id":1557,"name":"Belgian Lambic Blend","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 211 | 16:08:59"},{"id":1847,"name":"Belgian Saison","description":"This strain is 212 | the classic farmhouse ale yeast. A traditional yeast that is spicy with complex 213 | aromatics, including bubble gum. It is very tart and dry on the palate with 214 | a mild fruitiness. Expect a crisp, mildly acidic finish that will benefit 215 | from elevated fermentation temperatures. This strain is notorious for a rapid 216 | and vigorous start to fermentation, only to stick around 1.035 S.G. Fermentation 217 | will finish, given time and warm temperatures. Warm fermentation temperatures 218 | at least 90?F (32?C) or the use of a secondary strain can accelerate attenuation.","yeastType":"ale","attenuationMin":76,"attenuationMax":80,"fermentTempMin":70,"fermentTempMax":95,"alcoholToleranceMin":12,"alcoholToleranceMax":12,"productId":"3724","supplier":"Wyeast","yeastFormat":"liquid","category":"yeast","categoryDisplay":"Yeast","createDate":"2013-06-24 219 | 16:09:24","updateDate":"2013-06-24 16:10:53"}],"status":"success"}' 220 | http_version: 221 | recorded_at: Mon, 31 Mar 2014 20:13:26 GMT 222 | recorded_with: VCR 2.4.0 223 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Hops/_all/fetches_all_of_the_hops_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/hops?key=API_KEY 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:24 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '5327' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"currentPage":1,"numberOfPages":4,"totalResults":166,"data":[{"id":1976,"name":"#06300","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 38 | 16:07:41"},{"id":1,"name":"Admiral","description":"Bred at Wye as a replacement 39 | for Target and released in 1998, Admiral is a high-alpha variety considered 40 | to have a more pleasing, less harsh bitterness.","countryOfOrigin":"GB","alphaAcidMin":13,"betaAcidMin":4.8,"betaAcidMax":6.1,"humuleneMin":7,"humuleneMax":26,"caryophylleneMin":6,"caryophylleneMax":8,"cohumuloneMin":37,"cohumuloneMax":45,"myrceneMin":39,"myrceneMax":48,"farneseneMin":1.8,"farneseneMax":2.2,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 41 | 16:07:26","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 42 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 43 | 02:41:33"}},{"id":2,"name":"Aged \/ Debittered Hops (Lambic)","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 44 | 16:07:26"},{"id":3,"name":"Ahtanum","description":"An open-pollinated aroma 45 | variety developed in Washington, Ahtanum is used for its distinctive, somewhat 46 | Cascade-like aroma and for moderate bittering.","countryOfOrigin":"US","alphaAcidMin":5.7,"betaAcidMin":5,"betaAcidMax":6.5,"humuleneMin":16,"humuleneMax":20,"caryophylleneMin":9,"caryophylleneMax":12,"cohumuloneMin":30,"cohumuloneMax":35,"myrceneMin":50,"myrceneMax":55,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 47 | 16:07:26","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 48 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 49 | 02:41:33"}},{"id":1946,"name":"Alchemy","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 50 | 16:07:40"},{"id":4,"name":"Amarillo","description":"Amarillo is a privately 51 | grown and registered hop variety; it was introduced recently but has been 52 | extremely popular with brewers seeking a Cascade-type hop with a distinctive 53 | American character. It is considered by many to be ideal for dry hopping, 54 | but also gives a clean bitterness due to low cohumulone content. The flavor 55 | has citrus and floral notes, and something like a Cascade character, but with 56 | more bitterness. Amarillo is a registered trademark of Virgil Gamache Farms, 57 | Inc., where the hop was originally developed.","countryOfOrigin":"US","alphaAcidMin":8,"betaAcidMin":6,"betaAcidMax":7,"humuleneMin":9,"humuleneMax":11,"caryophylleneMin":2,"caryophylleneMax":4,"cohumuloneMin":21,"cohumuloneMax":24,"myrceneMin":68,"myrceneMax":70,"farneseneMin":2,"farneseneMax":4,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 58 | 16:07:26","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 59 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 60 | 02:41:33"}},{"id":5,"name":"Amarillo Gold","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 61 | 16:07:26"},{"id":6,"name":"Apollo","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 62 | 16:07:26"},{"id":7,"name":"Aquila","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 63 | 16:07:26"},{"id":1957,"name":"Aramis","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 64 | 16:07:40"},{"id":8,"name":"Argentine Cascade","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 65 | 16:07:26"},{"id":1960,"name":"Athanum","description":"\r\n","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 66 | 16:07:40"},{"id":9,"name":"Aurora","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 67 | 16:07:27"},{"id":10,"name":"Auscha (Saaz)","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 68 | 16:07:27"},{"id":12,"name":"Banner","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 69 | 16:07:27"},{"id":13,"name":"Boadicea","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 70 | 16:07:27"},{"id":14,"name":"Bobek","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 71 | 16:07:27"},{"id":15,"name":"Bor","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 72 | 16:07:27"},{"id":1982,"name":"Bramling","description":"An older variety of 73 | Golding, Bramling is rarely if ever available to home brewers under its own 74 | name. The original was selected from the field of a farmer named Musgrave 75 | Hilton who had a farm in the English town of Bramling. Bramling was once one 76 | of the most popular aroma hops in England, but gradually faded as higher-yielding 77 | varieties became available. Until recently, it was still grown in small amounts 78 | in England and in British Columbia, Canada, where it may be one of the cultivars 79 | sold as British Columbia Golding. Bramling also lent its name to one of its 80 | progeny, the rare but still available Bramling Cross cultivar.","countryOfOrigin":"GB","alphaAcidMin":5,"alphaAcidMax":5,"betaAcidMin":2.3,"betaAcidMax":3.2,"humuleneMin":31,"humuleneMax":31,"caryophylleneMin":16,"caryophylleneMax":16,"cohumuloneMin":33,"cohumuloneMax":35,"myrceneMin":36,"myrceneMax":36,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 81 | 16:10:37","country":{"isoCode":"GB","name":"UNITED KINGDOM","displayName":"United 82 | Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 02:41:33"}},{"id":16,"name":"Bramling 83 | Cross","description":"Started in 1927 from a cross between a wild Manitoban 84 | male hop and a female Bramling hop, a variety of Golding. Used as a general-purpose 85 | bittering hop, lately this easy-growing hop has been used to provide a unique 86 | fruity, blackcurrant and lemon notes in traditional ales, especially in Christmas 87 | ales and cask-conditioned ales. Dry hopping can produce a very interesting 88 | effect. Bramling Cross is an under-appreciated hop.","countryOfOrigin":"GB","alphaAcidMin":5,"betaAcidMin":2.2,"betaAcidMax":3.2,"humuleneMin":28,"humuleneMax":33,"caryophylleneMin":14,"caryophylleneMax":18,"cohumuloneMin":26,"cohumuloneMax":34,"myrceneMin":35,"myrceneMax":40,"farneseneMin":0.2,"farneseneMax":0.2,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 89 | 16:07:27","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 90 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 91 | 02:41:33"}},{"id":17,"name":"Bravo","description":"Bred in 2000 and released 92 | commercially for the first time in 2006, Bravo is a proprietary hop variety 93 | sold by S.S. Steiner. Bravo is a diploid high-alpha hop derived from a female 94 | Zeus and a male derived in part from Nugget. It is reported by Steiner to 95 | have excellent resistance to powdery mildew. Bravo has been used in Rogue''s 96 | 20007 release of their Glen Ale, and was also the featured hop used in every 97 | beer in the 2007 Single Hop Festival hosted by Drake''s Brewing Company.","countryOfOrigin":"US","alphaAcidMin":14,"betaAcidMin":3,"betaAcidMax":4,"humuleneMin":18,"humuleneMax":20,"caryophylleneMin":10,"caryophylleneMax":12,"cohumuloneMin":29,"cohumuloneMax":34,"myrceneMin":25,"myrceneMax":50,"farneseneMin":0.5,"farneseneMax":0.5,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 98 | 16:07:27","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 99 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 100 | 02:41:33"}},{"id":18,"name":"Brewer''s Gold","description":"A seedling selected 101 | at Wye in 1919 from a wild Manitoban hop and released in 1934, Brewer''s Gold 102 | was one an early bittering hop, grown in England and in the United States 103 | (see Brewer''s Gold (American)), until the release of new high-alpha varieties 104 | in the 1970s and 1980s. It is also an ancestor of most modern high-alpha hops. 105 | Some Brewer''s Gold is still grown in England, but there is no longer significant 106 | production in the United States. Brewer''s Gold was never used as an aroma 107 | hop in England because of its intense flavors, but has been used experimentally 108 | as a dry hop by some American craft brewers.","countryOfOrigin":"GB","alphaAcidMin":5.5,"betaAcidMin":2.5,"betaAcidMax":3.5,"humuleneMin":29,"humuleneMax":31,"caryophylleneMin":7,"caryophylleneMax":7.5,"cohumuloneMin":40,"cohumuloneMax":48,"myrceneMin":37,"myrceneMax":40,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 109 | 16:07:27","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 110 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 111 | 02:41:33"}},{"id":1983,"name":"Brewer''s Gold (American)","description":"A 112 | seedling selected at Wye in 1919 from a wild Manitoban hop and released in 113 | 1934, Brewer''s Gold was one an early bittering hop, grown in England (see 114 | Brewer''s Gold) and in the United States, until the release of new high-alpha 115 | varieties in the 1970s and 1980s. It is also an ancestor of most modern high-alpha 116 | hops. Some Brewer''s Gold is still grown in England, but there is no longer 117 | significant production in the United States. Brewer''s Gold was never used 118 | as an aroma hop in England because of its intense flavors, but has been used 119 | experimentally as a dry hop by some American craft brewers.","countryOfOrigin":"US","alphaAcidMin":8,"alphaAcidMax":8,"betaAcidMin":3.5,"betaAcidMax":4.5,"humuleneMin":29,"humuleneMax":31,"caryophylleneMin":7,"caryophylleneMax":7.5,"cohumuloneMin":40,"cohumuloneMax":48,"myrceneMin":37,"myrceneMax":40,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 120 | 16:10:37","country":{"isoCode":"US","name":"UNITED STATES","displayName":"United 121 | States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 02:41:33"}},{"id":19,"name":"Bullion","description":"One 122 | of the earliest bittering hops, Bullion was created in 1919 by an open pollinated 123 | cross between an unidentified English male and an wild Manitoba hop. Unlike 124 | modern bittering hops, Bullion has a strong, distinctive character which is 125 | perceptible, especially in additions later than 60 minutes. The aroma and 126 | flavor characteristics are strong, pungent and sometimes harsh or resiny, 127 | with elements of spiciness and a fruit character that has been described as 128 | black currant or raspberry. Bullion has become less popular with the wide 129 | availability of new bittering hops with better storage characteristics and 130 | a more neutral bittering character, but its unique flavor makes it worth considering 131 | for home and craft brewers.","countryOfOrigin":"GB","alphaAcidMin":6,"betaAcidMin":3.2,"betaAcidMax":6,"humuleneMin":12,"humuleneMax":30,"caryophylleneMin":9,"caryophylleneMax":11,"cohumuloneMin":35,"cohumuloneMax":40,"myrceneMin":45,"myrceneMax":65,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 132 | 16:07:27","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 133 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 134 | 02:41:33"}},{"id":20,"name":"California Ivanhoe","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 135 | 16:07:28"},{"id":21,"name":"Calypso","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 136 | 16:07:28"},{"id":22,"name":"Cascade","description":"Cascade was created in 137 | the United States as an open-pollinated cross between Fuggle and Serebrianker. 138 | Its instantly recognizable grapefruit, floral aroma is characteristic of many 139 | American ales. Cascade is also one of the easiest hop varieties to grow; it 140 | can grow well under less than ideal conditions or in short growing seasons, 141 | and unlike most varieties, if started from a good rhizome a Cascade can produce 142 | a good crop even in its first growing season.","countryOfOrigin":"US","alphaAcidMin":5.5,"betaAcidMin":4.5,"betaAcidMax":7,"humuleneMin":13,"humuleneMax":13,"caryophylleneMin":4.5,"caryophylleneMax":4.5,"cohumuloneMin":33,"cohumuloneMax":40,"myrceneMin":45,"myrceneMax":60,"farneseneMin":6,"farneseneMax":6,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 143 | 16:07:28","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 144 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 145 | 02:41:33"}},{"id":23,"name":"Celeia","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 146 | 16:07:28"},{"id":24,"name":"Centennial","description":"Sometimes called a 147 | super Cascade, Centennial was bred in 1974 but not released until 1990. It 148 | has a floral, citrus aroma and a clean spicy flavor; its heritage includes 149 | Brewer''s Gold, Fuggle, and East Kent Golding. Popular among craft brewers, 150 | Centennial lends its distinctive character to, among others, Sierra Nevada 151 | Celebration Ale and Sierra Nevada Bigfoot Barleywine.","countryOfOrigin":"US","alphaAcidMin":6,"betaAcidMin":3.5,"betaAcidMax":4.5,"humuleneMin":10,"humuleneMax":18,"caryophylleneMin":4,"caryophylleneMax":8,"cohumuloneMin":28,"cohumuloneMax":30,"myrceneMin":45,"myrceneMax":60,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 152 | 16:07:28","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 153 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 154 | 02:41:33"}},{"id":25,"name":"Challenger","description":"A granddaughter of 155 | Northern Brewer developed at Wye, Challenger is a classic true dual purpose 156 | hop and one of the most popular English hops of the 1980s and 1990s. It has 157 | a clean bittering from relatively high alpha acids and good aroma characteristics. 158 | It has a fine fruity aroma with spicy overtones. Like many other varieties 159 | developed at Wye, this hop is sometimes known as Wye Challenger, especially 160 | in older references. This simply indicates that it was developed at Wye, not 161 | necessarily anything about where it was grown.","countryOfOrigin":"GB","alphaAcidMin":6.5,"betaAcidMin":4,"betaAcidMax":4.5,"humuleneMin":25,"humuleneMax":32,"caryophylleneMin":8,"caryophylleneMax":10,"cohumuloneMin":20,"cohumuloneMax":30,"myrceneMin":30,"myrceneMax":42,"farneseneMin":1,"farneseneMax":3,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 162 | 16:07:28","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 163 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 164 | 02:41:33"}},{"id":26,"name":"Chinook","description":"Released in 1985, Chinook 165 | is a strong bittering hop derived from Petham Golding, one of the English 166 | Golding hops. It is used in stouts and porters for its heavy spicy aroma.","countryOfOrigin":"US","alphaAcidMin":12,"betaAcidMin":3,"betaAcidMax":4,"humuleneMin":18,"humuleneMax":25,"caryophylleneMin":9,"caryophylleneMax":11,"cohumuloneMin":29,"cohumuloneMax":35,"myrceneMin":35,"myrceneMax":40,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 167 | 16:07:28","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 168 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 169 | 02:41:33"}},{"id":27,"name":"Citra","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 170 | 16:07:28"},{"id":28,"name":"Cluster","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 171 | 16:07:28"},{"id":1970,"name":"Cobb","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 172 | 16:07:40"},{"id":29,"name":"Columbia","description":"Columbia was generally 173 | considered similar, but inferior, to its sister selection, Willamette, and 174 | is now no longer commercially grown in the United States.","countryOfOrigin":"US","alphaAcidMin":7,"betaAcidMin":3,"betaAcidMax":5.5,"humuleneMin":14,"humuleneMax":20,"caryophylleneMin":6,"caryophylleneMax":10,"cohumuloneMin":36,"cohumuloneMax":43,"myrceneMin":31,"myrceneMax":68,"farneseneMin":10,"farneseneMax":30,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 175 | 16:07:28","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 176 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 177 | 02:41:33"}},{"id":30,"name":"Columbus","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 178 | 16:07:29"},{"id":31,"name":"Columbus (Tomahawk)","description":"This high 179 | alpha acid bittering hop was developed from the Centennial hop by the HopUnion 180 | breeding program. It is a low-cohumulone hop which gives a clean but long-lasting 181 | bitterness to beer. It can also be used as a dry hop in larger American beers, 182 | such as Pliny the Elder by Russian River Brewing. Tomahawk is a registered 183 | trademark of Yakima Chief Ranches, LLC, under which they sell a hop believed 184 | to be identical to Columbus.","countryOfOrigin":"US","alphaAcidMin":14,"betaAcidMin":4.5,"betaAcidMax":5.8,"humuleneMin":15,"humuleneMax":25,"caryophylleneMin":7,"caryophylleneMax":12,"cohumuloneMin":29,"cohumuloneMax":35,"myrceneMin":25,"myrceneMax":45,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 185 | 16:07:29","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 186 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 187 | 02:41:33"}},{"id":32,"name":"Comet","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 188 | 16:07:29"},{"id":33,"name":"Crystal","description":"A triploid released in 189 | 1993 as part of a program attempting to develop an American substitute for 190 | Hallertauer Mittelfr?h, Crystal was derived primarily from Hallertauer with 191 | contributions from Cascade, Brewer''s Gold and Early Green. Also known as 192 | CJF-Hallertau. Sister hops from the same program include Liberty, Mount Hood, 193 | and Ultra. Crystal has a very mild character, clean and slightly spicy, and 194 | is generally used in lagers and pilsners.","countryOfOrigin":"US","alphaAcidMin":3.5,"betaAcidMin":4.5,"betaAcidMax":6.7,"humuleneMin":18,"humuleneMax":24,"caryophylleneMin":4,"caryophylleneMax":8,"cohumuloneMin":20,"cohumuloneMax":26,"myrceneMin":40,"myrceneMax":65,"farneseneMin":0.1,"farneseneMax":0.1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 195 | 16:07:29","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 196 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 197 | 02:41:33"}},{"id":1942,"name":"CTZ","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 198 | 16:07:40"},{"id":35,"name":"Delta","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 199 | 16:07:29"},{"id":36,"name":"East Kent Golding","description":"The premier 200 | English aroma hop, an English landrace with a lineage going back to 1790. 201 | Ideal for bittering and finishing any kind of English ales, and also works 202 | well in lagers due to its delicate, slightly spicy aroma.","countryOfOrigin":"GB","alphaAcidMin":4,"betaAcidMin":1.9,"betaAcidMax":2.8,"humuleneMin":38,"humuleneMax":45,"caryophylleneMin":12,"caryophylleneMax":16,"cohumuloneMin":28,"cohumuloneMax":32,"myrceneMin":25,"myrceneMax":25,"farneseneMin":0.4,"farneseneMax":0.4,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 203 | 16:07:29","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 204 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 205 | 02:41:33"}},{"id":37,"name":"El Dorado","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 206 | 16:07:29"},{"id":38,"name":"Eroica","description":"Eroica is a high-alpha 207 | hop derived from Brewer''s Gold, selected in Idaho in 1968. This was a very 208 | popular general purpose bittering hop with a clean bittering profile, but 209 | has gradually been replaced by Galena and is now generally no longer commercially 210 | available.","countryOfOrigin":"US","alphaAcidMin":11,"betaAcidMin":4,"betaAcidMax":5.5,"humuleneMax":1,"caryophylleneMin":7,"caryophylleneMax":12,"cohumuloneMin":36,"cohumuloneMax":42,"myrceneMin":55,"myrceneMax":65,"farneseneMax":1,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 211 | 16:07:29","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"US","name":"UNITED 212 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 213 | 02:41:33"}},{"id":39,"name":"Experimental 946","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 214 | 16:07:29"},{"id":40,"name":"Falconer''s Flight","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 215 | 16:07:30"},{"id":41,"name":"First Gold","description":"Derived from Whitbread 216 | Goldings Variety and a dwarf male, First Gold was one of the first Hedgerow 217 | hop varieties available to the home and commercial brewers. It combines good 218 | bittering properties with a woody, minty flavor and aroma that has been compared 219 | to WGV and to Fuggle. Considerable areas of First Gold are being planned and 220 | there is significant interest already from Britain''s traditional ale brewers 221 | for bittering and for late and dry hopping.","countryOfOrigin":"GB","alphaAcidMin":4,"betaAcidMin":2.3,"betaAcidMax":4.1,"humuleneMin":20,"humuleneMax":24,"caryophylleneMin":6,"caryophylleneMax":7,"cohumuloneMin":31,"cohumuloneMax":34,"myrceneMin":24,"myrceneMax":28,"farneseneMin":2,"farneseneMax":4,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 222 | 16:07:30","updateDate":"2013-06-24 16:10:37","country":{"isoCode":"GB","name":"UNITED 223 | KINGDOM","displayName":"United Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 224 | 02:41:33"}},{"id":42,"name":"French Strisserspalt","category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 225 | 16:07:30"},{"id":1984,"name":"Fuggle (American)","description":"Fuggle cultivar 226 | hops grown in the United States are not considered as desirable as the true 227 | English Fuggles, but they probably retain more of their character than most 228 | other transplanted landrace varieties. American growers developed Willamette 229 | as a similar but hardier and better-producing hops for American use. Fuggles 230 | and related varieties have been used around the world under various names, 231 | from Styrian Goldings in Slovenia to Tettnanger in the United States.","countryOfOrigin":"US","alphaAcidMin":4,"alphaAcidMax":4,"betaAcidMin":1.5,"betaAcidMax":2,"humuleneMin":20,"humuleneMax":26,"caryophylleneMin":6,"caryophylleneMax":10,"cohumuloneMin":25,"cohumuloneMax":32,"myrceneMin":40,"myrceneMax":60,"farneseneMin":4,"farneseneMax":5,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 232 | 16:10:37","country":{"isoCode":"US","name":"UNITED STATES","displayName":"United 233 | States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 02:41:33"}},{"id":1985,"name":"Fuggle 234 | (English)","description":"Fuggle is an English hop cultivar. Sometimes considered 235 | an English landrace, Fuggles were seedling selected in England in 1875. The 236 | true Fuggle (English) is sometimes considered a noble hop, and while it is 237 | sometimes considered inferior to Golding hop varieties such as the famous 238 | East Kent Goldings, Fuggle''s flavor and mild, spicy, woody aroma are deeply 239 | characteristic of English beer. Fuggle has suffered from wilts of late, and 240 | has largely been replaced by newer varieties. Fuggle provides a full British 241 | style palate and can be used alone, but is often blended with East Kent Goldings. 242 | Fuggles and related varieties have been used around the world under various 243 | names, from Styrian Goldings in Slovenia to Tettnanger in the United States.","countryOfOrigin":"GB","alphaAcidMin":3,"alphaAcidMax":3,"betaAcidMin":2,"betaAcidMax":3.1,"humuleneMin":30,"humuleneMax":39,"caryophylleneMin":9,"caryophylleneMax":14,"cohumuloneMin":25,"cohumuloneMax":30,"myrceneMin":24,"myrceneMax":28,"farneseneMin":5,"farneseneMax":7,"category":"hop","categoryDisplay":"Hops","createDate":"2013-06-24 244 | 16:10:37","country":{"isoCode":"GB","name":"UNITED KINGDOM","displayName":"United 245 | Kingdom","isoThree":"GBR","numberCode":826,"createDate":"2012-01-03 02:41:33"}}],"status":"success"}' 246 | http_version: 247 | recorded_at: Mon, 31 Mar 2014 20:13:24 GMT 248 | recorded_with: VCR 2.4.0 249 | -------------------------------------------------------------------------------- /spec/fixtures/BreweryDB_Resources_Locations/_all/fetches_all_of_the_breweries_at_once.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: http://api.brewerydb.com/v2/locations?key=API_KEY&locality=San+Francisco 6 | body: 7 | encoding: US-ASCII 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - BreweryDB Ruby Gem 0.2.3 12 | response: 13 | status: 14 | code: 200 15 | message: 16 | headers: 17 | content-type: 18 | - application/json 19 | date: 20 | - Mon, 31 Mar 2014 20:13:24 GMT 21 | server: 22 | - Apache/2.2.26 (Amazon) 23 | vary: 24 | - Accept-Encoding 25 | x-powered-by: 26 | - PHP/5.3.28 27 | x-ratelimit-limit: 28 | - Unlimited 29 | x-ratelimit-remaining: 30 | - Unlimited 31 | content-length: 32 | - '8723' 33 | connection: 34 | - Close 35 | body: 36 | encoding: UTF-8 37 | string: '{"currentPage":1,"numberOfPages":1,"totalResults":21,"data":[{"id":"wXmTDU","name":"Main 38 | Brewery","streetAddress":"563 Second Street","locality":"San Francisco","region":"California","postalCode":"94107","phone":"415-369-0900","hoursOfOperation":"Monday 39 | - Thursday: 11:30am to 12:00am\r\nFriday & Saturday: 11:30am to 1:00am\r\nSunday: 40 | 10:00am to 12:00am","latitude":37.7824175,"longitude":-122.3925921,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"brewpub","locationTypeDisplay":"Brewpub","countryIsoCode":"US","yearOpened":"2000","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 41 | 02:41:43","updateDate":"2012-09-29 13:00:01","breweryId":"EdRcIs","brewery":{"id":"EdRcIs","name":"21st 42 | Amendment Brewery","description":"The 21st Amendment Brewery offers a variety 43 | of award winning house made brews and American grilled cuisine in a comfortable 44 | loft like setting. Join us before and after Giants baseball games in our outdoor 45 | beer garden. A great location for functions and parties in our semi-private 46 | Brewers Loft. See you soon at the 21A!","website":"http:\/\/www.21st-amendment.com\/","established":"2000","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/EdRcIs\/upload_YmgSv3-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/EdRcIs\/upload_YmgSv3-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/EdRcIs\/upload_YmgSv3-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 47 | 02:41:43","updateDate":"2012-10-22 17:12:59"},"country":{"isoCode":"US","name":"UNITED 48 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 49 | 02:41:33"}},{"id":"g8pnb7","name":"Main Brewery","streetAddress":"620 Treat","locality":"San 50 | Francisco","region":"California","postalCode":"94110","phone":"(415) 341-0152","website":"http:\/\/www.southernpacificbrewing.com\/","hoursOfOperation":"Mon 51 | - Wed: 11:00 am - 12:00 am\r\nThu - Sat: 11:00 am - 2:00 am\r\nSun: 11:00 52 | am - 12:00 am","latitude":37.7601299,"longitude":-122.4140453,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 53 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2013-05-17 54 | 14:12:18","updateDate":"2013-05-17 14:12:18","breweryId":"f0wIsY","brewery":{"id":"f0wIsY","name":"Southern 55 | Pacific Brewing","description":"At the helm of Southern Pacific\u2019s 15 56 | barrel specific mechanical system is Andy French, whose clean, dry, true-to-style 57 | beers are the main features of a drinks lineup that boasts many attractions, 58 | including unique guest brews and high-caliber specialty cocktails","website":"http:\/\/www.southernpacificbrewing.com\/","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/f0wIsY\/upload_LjJkRu-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/f0wIsY\/upload_LjJkRu-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/f0wIsY\/upload_LjJkRu-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2013-05-15 59 | 23:26:26","updateDate":"2014-03-03 16:03:00"},"country":{"isoCode":"US","name":"UNITED 60 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 61 | 02:41:33"}},{"id":"OcFATq","name":"Main Brewery","streetAddress":"650 Fifth 62 | Street #403","locality":"San Francisco","region":"California","postalCode":"94107","latitude":37.7758088,"longitude":-122.3980099,"isPrimary":"Y","inPlanning":"N","isClosed":"Y","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 63 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 64 | 02:41:46","updateDate":"2012-03-21 19:08:02","breweryId":"Dcwb2m","brewery":{"id":"Dcwb2m","name":"Big 65 | Bang Brewery","isOrganic":"N","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 66 | 02:41:46","updateDate":"2012-03-21 19:06:03"},"country":{"isoCode":"US","name":"UNITED 67 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 68 | 02:41:33"}},{"id":"LXOt7C","name":"Main Brewery","streetAddress":"1326 9th 69 | Ave","locality":"San Francisco","region":"California","postalCode":"94122","phone":"415-681-0330","website":"http:\/\/www.socialkitchenandbrewery.com\/","latitude":37.763512,"longitude":-122.466204,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"brewpub","locationTypeDisplay":"Brewpub","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 70 | 02:42:08","updateDate":"2012-03-21 19:08:17","breweryId":"8ltE4s","brewery":{"id":"8ltE4s","name":"Social 71 | Kitchen & Brewery","website":"http:\/\/www.socialkitchenandbrewery.com\/","isOrganic":"N","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 72 | 02:42:08","updateDate":"2012-03-21 19:06:19"},"country":{"isoCode":"US","name":"UNITED 73 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 74 | 02:41:33"}},{"id":"2MDtOB","name":"Main Brewery","streetAddress":"1150 Howard 75 | Street","locality":"San Francisco","region":"California","postalCode":"94103","phone":"(415) 76 | 863-3940","website":"http:\/\/www.cellarmakerbrewing.com","hoursOfOperation":"Tue 77 | - Fri: 3:00 pm - 11:00 pm\r\nSat: 12:00 pm - 11:00 pm\r\nSun: 2:00 pm - 8:00 78 | pm","latitude":37.777218,"longitude":-122.410768,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 79 | Brewery","countryIsoCode":"US","yearOpened":"2013","status":"verified","statusDisplay":"Verified","createDate":"2014-02-24 80 | 21:02:33","updateDate":"2014-02-24 21:02:33","breweryId":"kSUGO5","brewery":{"id":"kSUGO5","name":"Cellarmaker 81 | Brewing Company","description":"Cellarmaker Brewing Company has been in the 82 | works for quite some time. Look for our beers to start making their way around 83 | better known beer bars and beer focused restaurants in San Francisco starting 84 | in September. \r\n\r\nWe have a tasting room in the same building as the brewery 85 | and will offer tasters, pints, and growlers. Some beers may be bottled further 86 | down the line but for now it''s all draft. The only way you can take our beer 87 | away is in the form of a growler - which by the way, is a great way to drink 88 | beer! \r\n\r\nLook for a focus of plenty of hoppy beers, belgian-style saisons, 89 | dark beers, and sour beers. We are huge fans of wine and bourbon barrel aged 90 | beers as well so it''s only natural for us to have a barrel program. Think 91 | bourbon barrels loaded with big chewy imperial stouts, excessively hopped 92 | IPAs, fruited sour beers, and funky saisons. This is what we love. This is 93 | what we are all about. We hope you are too!\r\n\r\nPlease follow along for 94 | the ride as we build San Francisco''s next great brewery.\r\n\r\nCheers!","website":"http:\/\/www.cellarmakerbrewing.com","established":"2013","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/kSUGO5\/upload_xhExEK-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/kSUGO5\/upload_xhExEK-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/kSUGO5\/upload_xhExEK-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2014-02-24 95 | 20:56:28","updateDate":"2014-02-24 21:05:11"},"country":{"isoCode":"US","name":"UNITED 96 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 97 | 02:41:33"}},{"id":"lV8gC4","name":"Main Brewery","streetAddress":"3801 18th 98 | Street","locality":"San Francisco","region":"California","postalCode":"94114","phone":"415-273-9295","website":"http:\/\/www.mateveza.com\/","hoursOfOperation":"12pm 99 | to 10pm","latitude":37.761089,"longitude":-122.428521,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 100 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 101 | 02:42:01","updateDate":"2013-08-13 11:07:24","breweryId":"QeR22V","brewery":{"id":"QeR22V","name":"Mateveza 102 | Yerba Mate Ale","description":"Jim Woods (artistic rendering left) is an avid 103 | yerba mate drinker. When not lounging around in his flowing camisa roja and 104 | matching gorra, he enjoys brewing flavorful craft beers and drinking them 105 | responsibly.\r\n\r\nIt was his love for hoppy beers and yerba mate coupled 106 | with his thirst for adventure, as evidenced by his ambitious patillas, that 107 | led him to discover MateVeza.\r\n\r\nOne day while partaking in an afternoon 108 | mate, he cracked open a pale ale that had a prominent flavor and aroma of 109 | cascade hops. Chispas flew as the flavors of yerba mate and cascade hops frolicked 110 | on his lengua, and the original perky pale ale was born.","website":"http:\/\/www.mateveza.com\/","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/QeR22V\/upload_GhALQy-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/QeR22V\/upload_GhALQy-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/QeR22V\/upload_GhALQy-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 111 | 02:42:01","updateDate":"2012-03-21 19:06:12"},"country":{"isoCode":"US","name":"UNITED 112 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 113 | 02:41:33"}},{"id":"t559gG","name":"Main Brewery","streetAddress":"1195-A Evans 114 | Avenue","locality":"San Francisco","region":"California","postalCode":"94124","phone":"415-642-3371","website":"http:\/\/www.goodbeer.com\/","hoursOfOperation":"Mon 115 | - Thu:\t9:00 am - 10:00 am\r\nFri - Sat:\t12:00 pm - 10:00 pm","latitude":37.7382569,"longitude":-122.3802492,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 116 | Brewery","countryIsoCode":"US","yearOpened":"1997","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 117 | 02:42:08","updateDate":"2012-03-21 20:05:26","breweryId":"QPe57Z","brewery":{"id":"QPe57Z","name":"Speakeasy 118 | Ales and Lagers","description":"In a typically foggy San Francisco summer 119 | in 1997, we were determined to bring our unique West Coast-style beers from 120 | the underground to the masses. Defiantly producing small batches of beer in 121 | a secret warehouse in San Francisco\u2019s long forgotten Butchertown District, 122 | we quickly gained a fiercely loyal following with bold, complex beers and 123 | striking 1920\u2019s imagery. Starting with a single, iconic beer that immortalized 124 | the spirit of the bootleggers who persevered when America\u2019s taps ran 125 | dry\u2014a bold, hoppy amber ale known as Prohibition Ale\u2014we now brew 126 | a wide array of acclaimed beers from hoppy pale ales to stouts aged in whiskey 127 | barrels. After 16 years of making great beer in the Bay Area, we have grown 128 | by leaps and bounds, yet we still produce many of our beers on the original 129 | steam-fired brewhouse that started it all.","website":"http:\/\/www.goodbeer.com\/","established":"1997","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/QPe57Z\/upload_t8ClLn-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/QPe57Z\/upload_t8ClLn-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/QPe57Z\/upload_t8ClLn-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 130 | 02:42:08","updateDate":"2013-08-09 12:26:41"},"country":{"isoCode":"US","name":"UNITED 131 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 132 | 02:41:33"}},{"id":"L9Xqwc","name":"Main Brewery","streetAddress":"2245 3rd 133 | St","locality":"San Francisco","region":"California","postalCode":"94107","phone":"415-598-8811","website":"http:\/\/www.triplevoodoobrewing.com\/","latitude":37.7611898,"longitude":-122.3885367,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 134 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 135 | 02:42:11","updateDate":"2013-11-28 16:01:51","breweryId":"GoDmMT","brewery":{"id":"GoDmMT","name":"Triple 136 | Voodoo Brewing","description":"Triple Voodoo Brewing is life to the extreme 137 | and at full volume. Born from the underground beer scene in San Francisco, 138 | we have been brewing some of the most extreme beer styles this city has seen 139 | to date! From our amazing and complex Inception Belgian Style Ale to our mind 140 | blowing 32% ABV Thermonuclear Stout that we conjured to compete for the \"Strongest 141 | Beer in the World\", our mission is to bring you an amazing high ABV craft 142 | beer line-up. Here''s the team who work around the clock 24\/7 to make all 143 | these happen.","website":"http:\/\/www.triplevoodoobrewing.com\/","established":"2010","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/GoDmMT\/upload_7DybkD-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/GoDmMT\/upload_7DybkD-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/GoDmMT\/upload_7DybkD-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 144 | 02:42:10","updateDate":"2013-12-11 12:29:30"},"country":{"isoCode":"US","name":"UNITED 145 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 146 | 02:41:33"}},{"id":"NzbBOK","name":"Main Brewery","streetAddress":"1705 Mariposa 147 | St","locality":"San Francisco","region":"California","postalCode":"94107","phone":"415-863-8350","website":"http:\/\/www.anchorbrewing.com\/","hoursOfOperation":"Two 148 | tours are available each weekday by reservation only. For tour reservations 149 | call: 415-863-8350","latitude":37.763487,"longitude":-122.401367,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 150 | Brewery","countryIsoCode":"US","yearOpened":"1896","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 151 | 02:41:44","updateDate":"2012-03-21 20:05:24","breweryId":"6PBXvz","brewery":{"id":"6PBXvz","name":"Anchor 152 | Brewing Company","description":"Anchor Brewing Company\u2019s roots date back 153 | to the California gold rush making it one of America\u2019s oldest breweries. 154 | Its Anchor Steam\u00ae Beer is San Francisco\u2019s original since 1896.\r\n\r\nIn 155 | 1965, Fritz Maytag acquired and revived the struggling brewery at a time when 156 | mass production of beer dominated and seemed unstoppable. Maytag started a 157 | revolution in beer that originated today\u2019s craft beer movement.\r\n\r\nAn 158 | undisputed icon, Anchor is America\u2019s first craft brewery where beers 159 | are handmade in our traditional copper brewhouse from an all-malt mash. At 160 | Anchor, we practice the time-honored art of classical brewing, employing state-of-the-art 161 | methods to ensure that our beers are always pure and fresh.\r\n\r\nWe know 162 | of no brewery in the world that matches our efforts to combine traditional, 163 | natural brewing with such carefully applied, modern methods of sanitation, 164 | finishing, packaging and transporting.","website":"http:\/\/www.anchorbrewing.com\/","established":"1896","mailingListUrl":"http:\/\/www.anchorbrewing.com\/connect\/contact","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/6PBXvz\/upload_GcROfI-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/6PBXvz\/upload_GcROfI-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/6PBXvz\/upload_GcROfI-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 165 | 02:41:44","updateDate":"2013-08-09 20:11:55"},"country":{"isoCode":"US","name":"UNITED 166 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 167 | 02:41:33"}},{"id":"4CFzKV","name":"Main Brewery","streetAddress":"1203 Bosworth 168 | St","locality":"San Francisco","region":"California","postalCode":"94131","phone":"415-585-8866","website":"http:\/\/www.bosworthbrewery.com\/","latitude":37.735219,"longitude":-122.441103,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 169 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 170 | 02:41:47","updateDate":"2012-03-21 19:08:03","breweryId":"B3LpJB","brewery":{"id":"B3LpJB","name":"Bosworth 171 | Brewery","website":"http:\/\/www.bosworthbrewery.com\/","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/B3LpJB\/upload_Oy3nUT-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/B3LpJB\/upload_Oy3nUT-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/B3LpJB\/upload_Oy3nUT-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 172 | 02:41:47","updateDate":"2012-03-21 19:06:16"},"country":{"isoCode":"US","name":"UNITED 173 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 174 | 02:41:33"}},{"id":"EhUsAz","name":"Main Brewery","locality":"San Francisco","region":"California","postalCode":"94108","phone":"415-744-4062","latitude":37.79179,"longitude":-122.407419,"isPrimary":"Y","inPlanning":"Y","isClosed":"N","openToPublic":"N","locationType":"micro","locationTypeDisplay":"Micro 175 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 176 | 02:42:05","updateDate":"2012-04-09 20:26:56","breweryId":"XSfRBX","brewery":{"id":"XSfRBX","name":"Pine 177 | Street Brewery","description":"When asked, \u201cWhy we started brewing?\u201d 178 | The common response back in 2009 was, \u201cWe like arts and crafts\u201d. 179 | The brewing began in a small apartment kitchen on Pine St. in San Francisco 180 | on a stove that could hardly generate a boil. During the first night, it became 181 | apparent that we could create the beer that we wanted to drink and the collective 182 | that became Pine Street Brewery (PSB) was born. That was goal from the first 183 | night of brewing\u2014it was love at first smell.\r\n\r\nPSB moved into the 184 | historic Bourne Mansion in Pacific Heights during the Spring of 2010 and called 185 | this home until the Fall of 2011. Regular weekly brewing led to lots of experimentation 186 | and ten recipes that have become part of the core beer list. During \u201cBrew 187 | Nights,\u201d friends were made, a community was fostered and a brand was 188 | started.\r\n\r\nPine Street Brewery was designed so that our products would 189 | be available for many different palates in many different communities. There 190 | is a unique Pine Street in almost every area. We intend for our beer, interpretations 191 | of classic styles, to unite people across the US, one beer at a time.\r\n\r\nOur 192 | philosophy is to provide a celebration through ales and togetherness. We are 193 | active in the community through volunteer work and partnerships with local 194 | charities.","website":"http:\/\/www.pinestreetbrewery.com\/","established":"2010","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/XSfRBX\/upload_Mhj095-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/XSfRBX\/upload_Mhj095-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/XSfRBX\/upload_Mhj095-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 195 | 02:42:05","updateDate":"2012-04-09 20:37:10"},"country":{"isoCode":"US","name":"UNITED 196 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 197 | 02:41:33"}},{"id":"FtRclf","name":"Main Brewery","streetAddress":"2325 3rd 198 | Street","extendedAddress":"STE 202","locality":"San Francisco","region":"California","postalCode":"94107","phone":"(415) 199 | 992-3438","website":"http:\/\/www.almanacbeer.com\/","latitude":37.759984,"longitude":-122.388403,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 200 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-12-02 201 | 11:03:26","updateDate":"2012-12-02 11:03:26","breweryId":"0dM1NH","brewery":{"id":"0dM1NH","name":"Almanac 202 | Beer Co","description":"Our artisanal ales are brewed in collaboration with 203 | select Northern California sustainable farms. Each limited release is a unique 204 | beer to be enjoyed with friends and savored around the seasonal table.","website":"http:\/\/www.almanacbeer.com\/","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/0dM1NH\/upload_UyVTOG-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/0dM1NH\/upload_UyVTOG-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/0dM1NH\/upload_UyVTOG-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-12-02 205 | 11:02:45","updateDate":"2012-12-02 11:04:14"},"country":{"isoCode":"US","name":"UNITED 206 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 207 | 02:41:33"}},{"id":"eXqBnO","name":"Main Brewery","locality":"San Francisco","region":"California","latitude":37.777125,"longitude":-122.419644,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 208 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 209 | 02:41:56","updateDate":"2012-03-21 19:08:09","breweryId":"4otyQ1","brewery":{"id":"4otyQ1","name":"Golden 210 | Gate Park Brewery","isOrganic":"N","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 211 | 02:41:56","updateDate":"2012-03-21 19:06:06"},"country":{"isoCode":"US","name":"UNITED 212 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 213 | 02:41:33"}},{"id":"P7Ug6t","name":"Main Brewery","streetAddress":"1000 Great 214 | Highway","locality":"San Francisco","region":"California","postalCode":"94121","phone":"415-386-8439","website":"http:\/\/www.beachchalet.com\/","latitude":37.7694097,"longitude":-122.5105452,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"brewpub","locationTypeDisplay":"Brewpub","countryIsoCode":"US","yearOpened":"1997","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 215 | 02:41:45","updateDate":"2012-03-21 20:05:24","breweryId":"rGUQ04","brewery":{"id":"rGUQ04","name":"Beach 216 | Chalet Brewery and Restaurant","description":"The Beach Chalet Brewery & Restaurant 217 | is located above the Golden Gate Park Visitor''s Center which features the 218 | amazing and historic WPA frescoes created by Lucien Labaudt in the 1930''s. 219 | The artwork captures the flavor of San Francisco in that era in a style of 220 | the Arts and Crafts movement \u2013 a must see for fans of the style and for 221 | anyone who wants a taste of the strange and incredible period in which the 222 | WPA allowed art projects like this to exist during such hard times.\r\n\r\nUpstairs 223 | you will find the Beach Chalet Brewery & Restaurant. It was developed by Gar 224 | and Lara Truppelli and Timon Malloy in 1997 after the Chalet had sat vacant 225 | for 17 years. To remodel and restore this historic building to its former 226 | glory so it could be a landmark to be enjoyed by future generations as well 227 | as to create a space for their restaurateurs\u2019 dreams, they brought Heller 228 | Manus Architects onboard to help make their dreams a reality.\r\n\r\nToday 229 | thousands of guests enjoy the Modern American Cuisine menu and hand crafted 230 | ales. The Beach Chalet offers a full bar, abundant free parking and a breathtaking 231 | ocean view. Bay Area residents and visitors find the Beach Chalet to be a 232 | wonderful San Francisco experience while visiting Golden Gate Park and Ocean 233 | Beach. Join us and find out why the Beach Chalet is your kind of place.","website":"http:\/\/www.beachchalet.com\/","established":"1997","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/rGUQ04\/upload_mrm1Fb-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/rGUQ04\/upload_mrm1Fb-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/rGUQ04\/upload_mrm1Fb-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 234 | 02:41:45","updateDate":"2012-03-21 19:06:03"},"country":{"isoCode":"US","name":"UNITED 235 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 236 | 02:41:33"}},{"id":"k8SEYZ","name":"Main Brewery","streetAddress":"694 Peralta 237 | Ave","locality":"San Francisco","region":"California","postalCode":"94110","latitude":37.741461,"longitude":-122.409038,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 238 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 239 | 02:41:56","updateDate":"2012-03-21 19:08:09","breweryId":"coUX1m","brewery":{"id":"coUX1m","name":"Golden 240 | State Brewing Co.","isOrganic":"N","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 241 | 02:41:56","updateDate":"2012-03-21 19:06:16"},"country":{"isoCode":"US","name":"UNITED 242 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 243 | 02:41:33"}},{"id":"4sxEI8","name":"Main Brewery","streetAddress":"661 Howard 244 | Street","locality":"San Francisco","region":"California","postalCode":"94105","phone":"415-974-0905","website":"http:\/\/www.thirstybear.com\/","latitude":37.7854897,"longitude":-122.3996951,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 245 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 246 | 02:42:10","updateDate":"2012-03-21 19:08:18","breweryId":"8zULxL","brewery":{"id":"8zULxL","name":"ThirstyBear 247 | Brewing Company","description":"Since my first home brew many years ago, I\u2019d 248 | been dreaming of opening a brewery. I had no idea if that dream would come 249 | true or if it did what I\u2019d call it, but I was open to naming my dream. 250 | One summer Sunday in 1991 I was reading the San Francisco Chronicle. A head 251 | line in the front section blazed into my brain: Thirsty Bear Bites Man for 252 | Cold Beer. After reading about the Bear biting Victor Kozlov\u2019s hand to 253 | get a cold beer, I knew that story would be the name of my dream. The article, 254 | neatly cut out, lived on my refrigerator door for the next five years until 255 | I gave it greater purpose by opening ThirstyBear Brewing Company. You are 256 | looking at the original cut out article. Victor Kozlov\u2019s sacrifice of 257 | his hard earned beer to the Bear has earned him immortal status in our house 258 | beer, Kozlov Stout.","website":"http:\/\/www.thirstybear.com\/","established":"1996","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/8zULxL\/upload_Nlsfj6-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/8zULxL\/upload_Nlsfj6-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/8zULxL\/upload_Nlsfj6-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 259 | 02:42:10","updateDate":"2013-04-28 14:31:11"},"country":{"isoCode":"US","name":"UNITED 260 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 261 | 02:41:33"}},{"id":"hj7N75","name":"Main Brewery","locality":"San Francisco","region":"California","phone":"(415) 262 | 937-7843","latitude":37.777125,"longitude":-122.419644,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"N","locationType":"micro","locationTypeDisplay":"Micro 263 | Brewery","countryIsoCode":"US","yearOpened":"2010","status":"verified","statusDisplay":"Verified","createDate":"2012-09-27 264 | 13:28:09","updateDate":"2012-09-27 13:28:09","breweryId":"BBw7o7","brewery":{"id":"BBw7o7","name":"Pacific 265 | Brewing Laboratory","description":"Pac Brew Lab started in a garage as a place 266 | for Patrick and Bryan to experiment with new beer flavors, styles, and brewing 267 | techniques. What started out as a place to share new creations with friends 268 | grew into a bi-monthly, totally free event with hundreds of our \u201cnew\u201d 269 | friends and great local street food vendors.\r\n \r\nPatrick and Bryan brew 270 | small batches which allows for constant beer experimentation. They have been 271 | known to create exotic beer styles such as their Hibiscus Saison, Squid Ink 272 | Black IPA, Chamomile Ale, Lemongrass IPA, and Szechwan Peppercorn Red ale, 273 | wine soaked oak aged Brown Ale. Pac Brew Lab is always on the lookout for 274 | new ingredients and inspirations that will help them create new and tantalizing 275 | yet pleasing and palatable beers for the public.","website":"http:\/\/www.pacbrewlab.com\/","established":"2010","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/BBw7o7\/upload_vI6r1D-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/BBw7o7\/upload_vI6r1D-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/BBw7o7\/upload_vI6r1D-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-09-27 276 | 12:50:28","updateDate":"2012-09-27 13:28:16"},"country":{"isoCode":"US","name":"UNITED 277 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 278 | 02:41:33"}},{"id":"o8mhnm","name":"Main Brewery","streetAddress":"1398 Haight 279 | Street","locality":"San Francisco","region":"California","postalCode":"94117","phone":"(415) 280 | 864-7468","website":"http:\/\/www.magnoliapub.com\/","hoursOfOperation":"Mon 281 | - Thu: 11:00 am - 12:00 am\r\nFri: 11:00 am - 1:00 am\r\nSat: 10:00 am - 1:00 282 | am\r\nSun: 10:00 am - 11:00 pm","latitude":37.7702334,"longitude":-122.4453252,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"brewpub","locationTypeDisplay":"Brewpub","countryIsoCode":"US","yearOpened":"1997","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 283 | 02:42:01","updateDate":"2013-08-06 22:18:16","breweryId":"ScZdj3","brewery":{"id":"ScZdj3","name":"Magnolia 284 | Gastropub and Brewery","description":"Brewery and gastropub in San Francisco''s 285 | Haight Ashbury District with a production brewery and BBQ restaurant on the 286 | way this fall in the Dogpatch neighborhood.","website":"http:\/\/www.magnoliapub.com\/","established":"1997","mailingListUrl":"http:\/\/magnoliapub.com\/brewsletter.html","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/ScZdj3\/upload_eUt0Jz-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/ScZdj3\/upload_eUt0Jz-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/ScZdj3\/upload_eUt0Jz-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 287 | 02:42:01","updateDate":"2014-03-04 12:43:54"},"country":{"isoCode":"US","name":"UNITED 288 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 289 | 02:41:33"}},{"id":"d6chX4","name":"Main Brewery","streetAddress":"Noe Valley","locality":"San 290 | Francisco","region":"California","phone":"415-244-5496","website":"http:\/\/elizabethstreetbrewery.com\/","latitude":37.74839,"longitude":-122.433487,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"micro","locationTypeDisplay":"Micro 291 | Brewery","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 292 | 02:41:53","updateDate":"2012-03-21 19:08:08","breweryId":"ngOd0N","brewery":{"id":"ngOd0N","name":"Elizabeth 293 | Street Brewery","description":"Since 2003, the residence of Alyson and Richard 294 | Brewer-Hay has been known to family and friends as The Elizabeth Street Brewery. 295 | Located in the family-oriented San Francisco neighborhood of Noe Valley, the 296 | ESB is a pub for the people, by the people.","website":"http:\/\/elizabethstreetbrewery.com\/","isOrganic":"N","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 297 | 02:41:53","updateDate":"2012-03-21 19:06:16"},"country":{"isoCode":"US","name":"UNITED 298 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 299 | 02:41:33"}},{"id":"JJzXl0","name":"Main Brewpub","streetAddress":"3801 18th 300 | Street","locality":"San Francisco","region":"California","postalCode":"94114","phone":"(415) 301 | 273-9295","website":"http:\/\/cerveceriasf.com\/","hoursOfOperation":"Tuesday 302 | through Sunday \u2013 12pm to 10pm\r\nMonday \u2013 5pm to 10pm","latitude":37.7611033,"longitude":-122.4284314,"isPrimary":"Y","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"brewpub","locationTypeDisplay":"Brewpub","countryIsoCode":"US","status":"verified","statusDisplay":"Verified","createDate":"2014-01-07 303 | 12:59:01","updateDate":"2014-01-07 12:59:01","breweryId":"vpdrzj","brewery":{"id":"vpdrzj","name":"Cervecer\u00eda 304 | de MateVeza","description":"Cervecer\u00eda de MateVeza is a cafe and small 305 | brewery dedicated to providing locally-sourced, Argentinian-style empanadas 306 | paired with creative artisanal beers.","website":"http:\/\/cerveceriasf.com\/","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/vpdrzj\/upload_m5jG8G-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/vpdrzj\/upload_m5jG8G-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/vpdrzj\/upload_m5jG8G-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2014-01-07 307 | 05:09:49","updateDate":"2014-01-07 12:57:55"},"country":{"isoCode":"US","name":"UNITED 308 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 309 | 02:41:33"}},{"id":"jivaao","name":"San Francisco","streetAddress":"912 Cole 310 | St.","extendedAddress":"#338","locality":"San Francisco","region":"California","postalCode":"94117","phone":"818-825-8765","website":"http:\/\/www.shmaltz.com\/","latitude":37.7654594,"longitude":-122.4497845,"isPrimary":"N","inPlanning":"N","isClosed":"N","openToPublic":"Y","locationType":"brewpub","locationTypeDisplay":"Brewpub","countryIsoCode":"US","yearOpened":"1996","status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 311 | 02:42:08","updateDate":"2013-11-21 17:10:48","breweryId":"hgjj29","brewery":{"id":"hgjj29","name":"Shmaltz 312 | Brewing Company","description":"Shmaltz Brewing Company is an American craft 313 | brewing company born in San Francisco, California in 1996 that handcrafts 314 | HE''BREW Beer and Coney Island Lagers. Founded as the first and still only 315 | \"Jewish-celebration beer,\" proprietor, Jeremy Cowan, moved production to 316 | New York in 2003 and now distributes in over thirty-one U.S. states and Canada. Shmaltz 317 | is known for blurring beer styles and using puns, art, history, and pop culture 318 | in every aspect of its products. Starting out as a contract brewer, third-party 319 | brewers produce their lineup using Shmaltz Brewing Company''s proprietary 320 | recipes. In 2013, Shmaltz was \u201creborn\u201d in Clifton Park, NY, opening 321 | its own 50-barrel brewhouse in a 20,000 square foot warehouse just north of 322 | the Capitol district. Taking over 100% of their production meant bringing 323 | in the Brewmaster, Paul McErlean who designed every one of their award winning 324 | recipes, as well as Bob Craven, General Manager, and two of the experienced 325 | contract brewers. Shmaltz Brewing now has a true \"home\" for its family of 326 | fermented offerings and a tasting room for fans and curious beer lovers to 327 | come join the tribe. L''Chaim!","website":"http:\/\/www.shmaltzbrewing.com\/","established":"1996","isOrganic":"N","images":{"icon":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/hgjj29\/upload_dMhdW6-icon.png","medium":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/hgjj29\/upload_dMhdW6-medium.png","large":"https:\/\/s3.amazonaws.com\/brewerydbapi\/brewery\/hgjj29\/upload_dMhdW6-large.png"},"status":"verified","statusDisplay":"Verified","createDate":"2012-01-03 328 | 02:42:08","updateDate":"2013-11-25 12:49:29"},"country":{"isoCode":"US","name":"UNITED 329 | STATES","displayName":"United States","isoThree":"USA","numberCode":840,"createDate":"2012-01-03 330 | 02:41:33"}}],"status":"success"}' 331 | http_version: 332 | recorded_at: Mon, 31 Mar 2014 20:13:24 GMT 333 | recorded_with: VCR 2.4.0 334 | --------------------------------------------------------------------------------