which_time 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +10 -5
- data/lib/which_time/version.rb +1 -1
- data/lib/which_time.rb +2 -2
- data/spec/which_time_spec.rb +1 -1
- data/which_time.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3979b846b87f8685c2affed89b036eae71f061fa
|
4
|
+
data.tar.gz: 13674a268709d7cf271ceb272eca3210365a3f50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad43a30259e1a5170156fff38a0a954deb53769685a3c790dd1777d79fe1439ad6f73078b373e8d852bee29de35dd4ada6c7af31d6ab77af63bdf6cd7ad1362a
|
7
|
+
data.tar.gz: 1c241ec910dcfa1d239598662845f6470fbcc93d72036a5b74d6ed7a19eff26f1a238a9ab3e18e8b277a274afe5df5416eac7899a8e31a856b69408bc209e1b5
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
# WhichTime
|
2
2
|
|
3
|
-
Gem which gives you a simple way to find local time (timezone) of some place/address/city/country.
|
3
|
+
Gem which gives you a simple way to find local time (timezone) of some place/address/city/region/country.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
1. Create google app for your project to use Google API.
|
8
|
+
2. Enable ```Geocoding API``` and ```TimeZone API``` access for your google app.
|
9
|
+
3. Get API_KEY from settings of your google app
|
10
|
+
(something like ```"AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE"```).
|
11
|
+
4. Set up your google app for work (in development mode usage of API is limited: only 2500 requests per day)
|
12
|
+
5. Add this line to your application's Gemfile:
|
8
13
|
|
9
14
|
gem 'which_time'
|
10
15
|
|
@@ -12,9 +17,9 @@ And then execute:
|
|
12
17
|
|
13
18
|
$ bundle
|
14
19
|
|
15
|
-
|
20
|
+
Manually:
|
16
21
|
|
17
|
-
|
22
|
+
gem install which_time
|
18
23
|
|
19
24
|
## Usage
|
20
25
|
|
@@ -65,7 +70,7 @@ WhichTime.new( somewhere, google_api_key ).coordinates
|
|
65
70
|
|
66
71
|
## Contributing
|
67
72
|
|
68
|
-
1. Fork it ( https://github.com/
|
73
|
+
1. Fork it ( https://github.com/bmalets/which_time/fork )
|
69
74
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
70
75
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
76
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/which_time/version.rb
CHANGED
data/lib/which_time.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
%W( which_time/version net/http uri net/http json tzinfo).each{ |lib| require lib }
|
1
|
+
%W( which_time/version net/http uri net/http json tzinfo active_support/time).each{ |lib| require lib }
|
2
2
|
|
3
3
|
class WhichTime
|
4
4
|
|
@@ -19,7 +19,7 @@ class WhichTime
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def time
|
22
|
-
|
22
|
+
Time.at(@timestamp).in_time_zone timezone
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.in address, api_key, time=Time.new
|
data/spec/which_time_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe WhichTime do
|
|
4
4
|
|
5
5
|
let(:address) { "Kyiv, str. Khmelnitskogo 3, pub 'Naturlih'" }
|
6
6
|
let(:api_key) { "AIzaSyCqfXRRJ1d8mCS_I0Kcs4XnaZ9KYRUrJVE" }
|
7
|
-
let(:sometime) { Time.
|
7
|
+
let(:sometime) { Time.new(2015, 7, 5, 9, 10) }
|
8
8
|
|
9
9
|
let(:whichtime) { WhichTime.new( address, api_key, sometime ) }
|
10
10
|
|
data/which_time.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: which_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bmalets
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activesupport
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
69
83
|
description: " this gem provides a possibility to search local time by street/place_name/city/region/country
|
70
84
|
e.g. "
|
71
85
|
email:
|