timezonedb-client 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/timezonedb/client.rb +2 -1
- data/lib/timezonedb/client/version.rb +1 -1
- data/spec/timezonedb/client_spec.rb +1 -1
- data/timezonedb-client.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c271ef10800e475f01ae783a655d5af321275f26
|
4
|
+
data.tar.gz: eb0397d50b0fa6e9bfd735650c08b48c51fc25c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1081fedc500f3b2a4e7286b45673ef331ed9e20dfb5626e8c81fc7caec025604942544bbe78df17bbbdb403041aa55e42c78519bcc5c243ed2e18a5a31a58907
|
7
|
+
data.tar.gz: 623f3b92ba1b47de9d860bb573c3f1259216c57bc120797e3b5843ff05ec4dcf4f56f6d6ab96f861d6b7ece30d5941995441608f0e48dac0e037bcc6386672ef
|
data/README.md
CHANGED
@@ -54,12 +54,12 @@ tz.zone_name
|
|
54
54
|
=> "Europe/Madrid"
|
55
55
|
```
|
56
56
|
|
57
|
-
If you have premium API access, add `true` as a parameter when instantiating
|
57
|
+
If you have premium API access, add `premium: true` as a parameter when instantiating
|
58
58
|
the Timezonedb client, otherwise it will use the free plan endpoint.
|
59
59
|
|
60
60
|
```
|
61
61
|
# will call vip.timezonedb.com instead of api.timezonedb.com
|
62
|
-
client = Timezonedb::Client.new(api_key, true)
|
62
|
+
client = Timezonedb::Client.new(api_key, premium: true)
|
63
63
|
```
|
64
64
|
|
65
65
|
## Contributing
|
data/lib/timezonedb/client.rb
CHANGED
@@ -25,8 +25,9 @@ module Timezonedb
|
|
25
25
|
FREE_URL = 'http://api.timezonedb.com'
|
26
26
|
PREMIUM_URL = 'http://vip.timezonedb.com'
|
27
27
|
|
28
|
-
def initialize(api_key,
|
28
|
+
def initialize(api_key, options = {})
|
29
29
|
@api_key = api_key
|
30
|
+
premium = options[:premium]
|
30
31
|
@url = premium ? PREMIUM_URL : FREE_URL
|
31
32
|
end
|
32
33
|
|
@@ -148,7 +148,7 @@ describe Timezonedb::Client do
|
|
148
148
|
context 'when premium plan' do
|
149
149
|
let(:url) { 'http://vip.timezonedb.com' }
|
150
150
|
|
151
|
-
subject { Timezonedb::Client.new(api_key, true).search_by_coords(latitude, longitude) }
|
151
|
+
subject { Timezonedb::Client.new(api_key, premium: true).search_by_coords(latitude, longitude) }
|
152
152
|
|
153
153
|
context 'and successful request' do
|
154
154
|
let(:response_body) { correct_response_body.to_json }
|
data/timezonedb-client.gemspec
CHANGED
@@ -21,7 +21,7 @@ require 'timezonedb/client/version'
|
|
21
21
|
Gem::Specification.new do |s|
|
22
22
|
s.name = 'timezonedb-client'
|
23
23
|
s.version = Timezonedb::Client::VERSION
|
24
|
-
s.date = '2016-
|
24
|
+
s.date = '2016-02-03'
|
25
25
|
s.summary = 'Timezonedb Client'
|
26
26
|
s.description = 'A client for accessing the timezonedb.com API'
|
27
27
|
s.authors = ['Kostis Dadamis', 'Emili Parreno']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timezonedb-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kostis Dadamis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|