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 +4 -4
- data/README.md +24 -2
- data/lib/rate_beer/client.rb +1 -1
- data/lib/rate_beer/version.rb +1 -1
- data/spec/rate_beer/client_spec.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc7fb54079b5be92d2a873f94b6786b425a904b8
|
4
|
+
data.tar.gz: c367fb6dfca44beb665066ff5ee1e971ef080fca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f003685d6b9da9c011d77683ff8550b2868d1c2418c2ff1e32ae825fe40bd1fa035c72e4aeb2bba33f234ee05a09421749c6dd2e936f143f61e93f528ce46115
|
7
|
+
data.tar.gz: 0aa9ddb090fd1169561caf2eb6195c6f44a32b77ab03c77eccc84b5749f15fe43224107c146a371e490c753ffc7cdf33107561926a65e7e9f0416379579b230d
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# RateBeer
|
2
2
|
|
3
|
-
|
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
|
-
|
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
|
|
data/lib/rate_beer/client.rb
CHANGED
data/lib/rate_beer/version.rb
CHANGED
@@ -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.
|
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-
|
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:
|