rate_beer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e99b34421fce5318a0b1385002b174ac156b2b4b
4
- data.tar.gz: b8338d4682bc2f7128c8d17a958407a52cd2b3e7
3
+ metadata.gz: fc7fb54079b5be92d2a873f94b6786b425a904b8
4
+ data.tar.gz: c367fb6dfca44beb665066ff5ee1e971ef080fca
5
5
  SHA512:
6
- metadata.gz: d24a55e950209e4d2f0d4fa675d8842c5cf5b63b4ee130141c9f2bbccd6ba4d9ff32dd56cece279ccd8bab6922e489c17279d988ad02b4e75c7533d71008a432
7
- data.tar.gz: 3bb5d7541fdb4e6e2541e017c1af93d3a741e9f57cd9ba32d73bb2966f071c4d852d14b410142324d3e4e42ed213de9c92933b865a8fd767d40861981ef4fe30
6
+ metadata.gz: f003685d6b9da9c011d77683ff8550b2868d1c2418c2ff1e32ae825fe40bd1fa035c72e4aeb2bba33f234ee05a09421749c6dd2e936f143f61e93f528ce46115
7
+ data.tar.gz: 0aa9ddb090fd1169561caf2eb6195c6f44a32b77ab03c77eccc84b5749f15fe43224107c146a371e490c753ffc7cdf33107561926a65e7e9f0416379579b230d
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # RateBeer
2
2
 
3
- TODO: Write a gem description
3
+ Rate Beer
4
+ To work with Rate Beer API, you need to obtain a developer key from Rate Beer. More information: http://www.ratebeer.com/json/ratebeerapi.asp
4
5
 
5
6
  ## Installation
6
7
 
@@ -16,9 +17,30 @@ Or install it yourself as:
16
17
 
17
18
  $ gem install rate_beer
18
19
 
20
+
19
21
  ## Usage
20
22
 
21
- TODO: Write usage instructions here
23
+ Configuration
24
+
25
+ ```ruby
26
+ RateBeer.configure do |config|
27
+ config.api_key = "YOUR_DEVELOPER_KEY"
28
+ end
29
+ ```
30
+
31
+ You can also pass api key directly to the client:
32
+
33
+ ```ruby
34
+ client = RateBeer::Client.new(api_key: "YOUR_DEVELOPER_KEY")
35
+ ```
36
+
37
+ Now you can use the api like this:
38
+
39
+ ```ruby
40
+ # pass beer id as an argument
41
+ reviews = client.beer_reviews("162170")
42
+ ```
43
+ as a result you will get array with Hashie::Mash hashies.
22
44
 
23
45
  ## Contributing
24
46
 
@@ -29,7 +29,7 @@ module RateBeer
29
29
  end
30
30
 
31
31
  def beer_info_by_id(beer_id)
32
- response = self.class.get("/bff.asp?bd=#{beer_id}&k=#{api_key}")
32
+ response = self.class.get("/bff.asp?bd=#{beer_id}&k=#{api_key}&vg=1")
33
33
  parsed_response(response)
34
34
  end
35
35
 
@@ -1,3 +1,3 @@
1
1
  module RateBeer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -70,7 +70,7 @@ describe RateBeer::Client do
70
70
 
71
71
  describe "#beer_info_by_id" do
72
72
  before do
73
- stub_request(:get, "http://ratebeer.com/json/bff.asp?bd=12345&k=secret123").
73
+ stub_request(:get, "http://ratebeer.com/json/bff.asp?bd=12345&k=secret123&vg=1").
74
74
  to_return(:status => 200, :body => response_by_beer_id, :headers => {})
75
75
  end
76
76
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rate_beer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Māris Cīlītis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-02 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -119,4 +119,3 @@ test_files:
119
119
  - spec/rate_beer/configuration_spec.rb
120
120
  - spec/rate_beer/rate_beer_spec.rb
121
121
  - spec/support/responses.rb
122
- has_rdoc: