which_time 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f00512fbef059ff379c8b1dc92224b0656a727c
4
- data.tar.gz: 9a50402cb2c8f2b54fff344c43531b2426dd27e8
3
+ metadata.gz: 3979b846b87f8685c2affed89b036eae71f061fa
4
+ data.tar.gz: 13674a268709d7cf271ceb272eca3210365a3f50
5
5
  SHA512:
6
- metadata.gz: 3ceb6ad9556aca9df7719d68fe6fd7dbcba2aeaaf73db07acaa0e0f7a759742b88ce2541222ae8cf830dd93d72d8bd126a8a8bb4cb738d01f0e662d5cb883ad7
7
- data.tar.gz: ef53db6dc43da37e49d41e81dce3429d583b5eec6b016c24c933996b51420bd8b44a99d26e4a3babdd28cac7f1bf821ef20136da653c19615721daebfd27ebed
6
+ metadata.gz: ad43a30259e1a5170156fff38a0a954deb53769685a3c790dd1777d79fe1439ad6f73078b373e8d852bee29de35dd4ada6c7af31d6ab77af63bdf6cd7ad1362a
7
+ data.tar.gz: 1c241ec910dcfa1d239598662845f6470fbcc93d72036a5b74d6ed7a19eff26f1a238a9ab3e18e8b277a274afe5df5416eac7899a8e31a856b69408bc209e1b5
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log2
23
+ .DS_Store
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
- Add this line to your application's Gemfile:
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
- Or install it yourself as:
20
+ Manually:
16
21
 
17
- $ gem install which_time
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/[my-github-username]/which_time/fork )
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`)
@@ -1,3 +1,3 @@
1
1
  class WhichTime
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
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
- TZInfo::Timezone.get(timezone).local_to_utc Time.at(@timestamp)
22
+ Time.at(@timestamp).in_time_zone timezone
23
23
  end
24
24
 
25
25
  def self.in address, api_key, time=Time.new
@@ -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.utc(2015, 7, 5, 9, 10) }
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
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
24
  spec.add_development_dependency "tzinfo"
25
+ spec.add_development_dependency "activesupport", ">= 3.0"
25
26
  end
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.1
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: