timezone_detection 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +29 -3
- data/lib/timezone_detection/version.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,5 +1,31 @@
|
|
1
|
-
|
1
|
+
== INTRODUCTION
|
2
2
|
|
3
|
-
This
|
3
|
+
This gem used for setting client's timezone based on his/her IP.
|
4
4
|
|
5
|
-
|
5
|
+
== INSTALLATION
|
6
|
+
|
7
|
+
Write it in your Gemfile
|
8
|
+
|
9
|
+
gem "timezone_detection"
|
10
|
+
|
11
|
+
Next, execute following sequences of commands:
|
12
|
+
|
13
|
+
rails generate timezone_detection:install
|
14
|
+
|
15
|
+
rake db:migrate
|
16
|
+
|
17
|
+
This gem uses IpInfoDb web service to determine your timezone. API KEY required for dealing with site API, so you should register your own and set it in initializer file ( for this visit http://ipinfodb.com/ ):
|
18
|
+
|
19
|
+
For example: *config/initializers/my_own_timezone_initializer.rb*
|
20
|
+
|
21
|
+
TimezoneDetection.config do |cnf|
|
22
|
+
cnf.api_key = "SOME_API_KEY_PROVIDED_FROM_IP_INFO_DB_SITE"
|
23
|
+
end
|
24
|
+
|
25
|
+
== USAGE
|
26
|
+
|
27
|
+
Set before_filter in your ApplicationController or wherever you need.
|
28
|
+
|
29
|
+
before_filter :set_timezone
|
30
|
+
|
31
|
+
That's it. You are ready to go!
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timezone_detection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-08-09 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
14
|
+
description: Visit https://github.com/Bor1s/timezone-detection for more information.
|
15
15
|
email:
|
16
16
|
- boris.bbk@gmail.com
|
17
17
|
executables: []
|