cleverua-client_timezone_detection 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +16 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +65 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/client_timezone_detection.gemspec +65 -0
- data/js_files/jquery.cookie.js +96 -0
- data/js_files/time_zone_detection.js +8 -0
- data/lib/client_timezone_detection.rb +3 -0
- data/lib/client_timezone_detection/client_timezone_railtie.rb +24 -0
- data/lib/client_timezone_detection/controller_helpers.rb +19 -0
- data/lib/client_timezone_detection/view_helpers.rb +5 -0
- data/lib/client_timezone_detection_install.rb +8 -0
- data/test/helper.rb +18 -0
- data/test/test_time_zone_detection.rb +7 -0
- data/time_zone_detection.gemspec +63 -0
- metadata +117 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "bundler", "~> 1.0.0"
|
10
|
+
gem "jeweler", "~> 1.5.1"
|
11
|
+
end
|
data/Gemfile.lock
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Boris Babusenko
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
= Client Timezone Detection Rails plugin
|
2
|
+
|
3
|
+
* http://github.com/cleverua/client_timezone_detection
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
A Ruby On Rails gem aimed to simplify user timezone detection. It gets TZ
|
8
|
+
information from user browser, saves it in cookie and then applies the TZ in
|
9
|
+
controller. That way you always have application TZ set up for the region user is
|
10
|
+
actually in.
|
11
|
+
|
12
|
+
|
13
|
+
=== USAGE
|
14
|
+
|
15
|
+
All you have to do is to include gem's javascripts in your application layout.
|
16
|
+
Just drop the following somewhere in the page head section:
|
17
|
+
|
18
|
+
<%= javascript_include_tz_detection %>
|
19
|
+
|
20
|
+
That's all. Now using some before_filter magick the gem will have set
|
21
|
+
request's time zone to match the one received in cookies. That will be the
|
22
|
+
timezone user's browser is configured for.
|
23
|
+
|
24
|
+
== HOW TO SKIP THE TIMEZONE DETECTION:
|
25
|
+
|
26
|
+
It is sometimes necessary to skip timezone detection and setup, say you
|
27
|
+
implement a general purpose web service within your app. You can skip it in your
|
28
|
+
controller like this:
|
29
|
+
|
30
|
+
skip_before_filter :set_client_time_zone
|
31
|
+
|
32
|
+
== IMPORTANT ASSUMPTION
|
33
|
+
|
34
|
+
It assumes you use the excellent jQuery library in your application. You use it,
|
35
|
+
right? That's the assumption :)
|
36
|
+
|
37
|
+
== INSTALL:
|
38
|
+
|
39
|
+
Put this string in your Gemfile:
|
40
|
+
gem 'client_timezone_detection', :git => git://github.com/cleverua/client_timezone_detection.git
|
41
|
+
|
42
|
+
== LICENSE:
|
43
|
+
|
44
|
+
(The MIT License)
|
45
|
+
|
46
|
+
Copyright (c) 2010 CleverUA
|
47
|
+
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
49
|
+
a copy of this software and associated documentation files (the
|
50
|
+
'Software'), to deal in the Software without restriction, including
|
51
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
52
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
53
|
+
permit persons to whom the Software is furnished to do so, subject to
|
54
|
+
the following conditions:
|
55
|
+
|
56
|
+
The above copyright notice and this permission notice shall be
|
57
|
+
included in all copies or substantial portions of the Software.
|
58
|
+
|
59
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
60
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
61
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
62
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
63
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
64
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
65
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "cleverua-client_timezone_detection"
|
16
|
+
gem.homepage = "http://github.com/cleverua/client_timezone_detection"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{A rails gem aimed to simplify user timezone detection}
|
19
|
+
gem.description = %Q{The gem gets timezone information from user browser, saves it in a cookie and then applies the TZ in controller. That way you always have application TZ set up for the region user is actually in.}
|
20
|
+
gem.email = "info@cleverua.com"
|
21
|
+
gem.authors = ["Pavlo Lysov, Boris Babusenko"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rake/testtask'
|
30
|
+
Rake::TestTask.new(:test) do |test|
|
31
|
+
test.libs << 'lib' << 'test'
|
32
|
+
test.pattern = 'test/**/test_*.rb'
|
33
|
+
test.verbose = true
|
34
|
+
end
|
35
|
+
|
36
|
+
#require 'rcov/rcovtask'
|
37
|
+
#Rcov::RcovTask.new do |test|
|
38
|
+
# test.libs << 'test'
|
39
|
+
# test.pattern = 'test/**/test_*.rb'
|
40
|
+
# test.verbose = true
|
41
|
+
#end
|
42
|
+
|
43
|
+
#task :default => :test
|
44
|
+
|
45
|
+
require 'rake/rdoctask'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "client_timezone_detection #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{client_timezone_detection}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Pavlo Lysov, Boris Babusenko"]
|
12
|
+
s.date = %q{2010-12-10}
|
13
|
+
s.description = %q{See README}
|
14
|
+
s.email = %q{boris@cleverua.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"client_timezone_detection.gemspec",
|
28
|
+
"js_files/jquery.cookie.js",
|
29
|
+
"js_files/time_zone_detection.js",
|
30
|
+
"lib/client_timezone_detection.rb",
|
31
|
+
"lib/client_timezone_detection/client_timezone_railtie.rb",
|
32
|
+
"lib/client_timezone_detection/controller_helpers.rb",
|
33
|
+
"lib/client_timezone_detection/view_helpers.rb",
|
34
|
+
"lib/client_timezone_detection_install.rb",
|
35
|
+
"test/helper.rb",
|
36
|
+
"test/test_time_zone_detection.rb",
|
37
|
+
"time_zone_detection.gemspec"
|
38
|
+
]
|
39
|
+
s.homepage = %q{http://github.com/cleverua/client_timezone_detection}
|
40
|
+
s.licenses = ["MIT"]
|
41
|
+
s.require_paths = ["lib"]
|
42
|
+
s.rubygems_version = %q{1.3.6}
|
43
|
+
s.summary = %q{Gem for detection client time zone}
|
44
|
+
s.test_files = [
|
45
|
+
"test/helper.rb",
|
46
|
+
"test/test_time_zone_detection.rb"
|
47
|
+
]
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
55
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
56
|
+
else
|
57
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
58
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
59
|
+
end
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
62
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/**
|
2
|
+
* Cookie plugin
|
3
|
+
*
|
4
|
+
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
5
|
+
* Dual licensed under the MIT and GPL licenses:
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
* http://www.gnu.org/licenses/gpl.html
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Create a cookie with the given name and value and other optional parameters.
|
13
|
+
*
|
14
|
+
* @example $.cookie('the_cookie', 'the_value');
|
15
|
+
* @desc Set the value of a cookie.
|
16
|
+
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
17
|
+
* @desc Create a cookie with all available options.
|
18
|
+
* @example $.cookie('the_cookie', 'the_value');
|
19
|
+
* @desc Create a session cookie.
|
20
|
+
* @example $.cookie('the_cookie', null);
|
21
|
+
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
22
|
+
* used when the cookie was set.
|
23
|
+
*
|
24
|
+
* @param String name The name of the cookie.
|
25
|
+
* @param String value The value of the cookie.
|
26
|
+
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
27
|
+
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
28
|
+
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
29
|
+
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
30
|
+
* when the the browser exits.
|
31
|
+
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
32
|
+
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
33
|
+
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
34
|
+
* require a secure protocol (like HTTPS).
|
35
|
+
* @type undefined
|
36
|
+
*
|
37
|
+
* @name $.cookie
|
38
|
+
* @cat Plugins/Cookie
|
39
|
+
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
40
|
+
*/
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Get the value of a cookie with the given name.
|
44
|
+
*
|
45
|
+
* @example $.cookie('the_cookie');
|
46
|
+
* @desc Get the value of a cookie.
|
47
|
+
*
|
48
|
+
* @param String name The name of the cookie.
|
49
|
+
* @return The value of the cookie.
|
50
|
+
* @type String
|
51
|
+
*
|
52
|
+
* @name $.cookie
|
53
|
+
* @cat Plugins/Cookie
|
54
|
+
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
55
|
+
*/
|
56
|
+
jQuery.cookie = function(name, value, options) {
|
57
|
+
if (typeof value != 'undefined') { // name and value given, set cookie
|
58
|
+
options = options || {};
|
59
|
+
if (value === null) {
|
60
|
+
value = '';
|
61
|
+
options.expires = -1;
|
62
|
+
}
|
63
|
+
var expires = '';
|
64
|
+
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
65
|
+
var date;
|
66
|
+
if (typeof options.expires == 'number') {
|
67
|
+
date = new Date();
|
68
|
+
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
69
|
+
} else {
|
70
|
+
date = options.expires;
|
71
|
+
}
|
72
|
+
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
73
|
+
}
|
74
|
+
// CAUTION: Needed to parenthesize options.path and options.domain
|
75
|
+
// in the following expressions, otherwise they evaluate to undefined
|
76
|
+
// in the packed version for some reason...
|
77
|
+
var path = options.path ? '; path=' + (options.path) : '';
|
78
|
+
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
79
|
+
var secure = options.secure ? '; secure' : '';
|
80
|
+
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
81
|
+
} else { // only name given, get cookie
|
82
|
+
var cookieValue = null;
|
83
|
+
if (document.cookie && document.cookie != '') {
|
84
|
+
var cookies = document.cookie.split(';');
|
85
|
+
for (var i = 0; i < cookies.length; i++) {
|
86
|
+
var cookie = jQuery.trim(cookies[i]);
|
87
|
+
// Does this cookie string begin with the name we want?
|
88
|
+
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
89
|
+
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
90
|
+
break;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
return cookieValue;
|
95
|
+
}
|
96
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'client_timezone_detection'
|
3
|
+
require 'client_timezone_detection/view_helpers'
|
4
|
+
require 'client_timezone_detection/controller_helpers'
|
5
|
+
|
6
|
+
|
7
|
+
class ClientTimezoneRailtie < ::Rails::Railtie
|
8
|
+
config.to_prepare do
|
9
|
+
require 'client_timezone_detection_install'
|
10
|
+
module ClientTimezoneDetection
|
11
|
+
class << self
|
12
|
+
def enable_action_view_extensions
|
13
|
+
ActionView::Base.send(:include, ViewHelpers)
|
14
|
+
end
|
15
|
+
def enable_controller_extensions
|
16
|
+
ApplicationController.send(:include, ControllerHelpers)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
ClientTimezoneDetection.enable_action_view_extensions
|
22
|
+
ClientTimezoneDetection.enable_controller_extensions
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ControllerHelpers
|
2
|
+
def self.included(base)
|
3
|
+
base.class_eval("before_filter :set_client_time_zone")
|
4
|
+
end
|
5
|
+
|
6
|
+
private
|
7
|
+
def set_client_time_zone
|
8
|
+
Time.zone = browser_timezone.nil? ? "UTC" : browser_timezone
|
9
|
+
logger.info("--- Client Timezone set: #{Time.zone}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def browser_timezone
|
13
|
+
return nil if cookies[:tzoffset].blank?
|
14
|
+
@browser_timezone ||= begin
|
15
|
+
min = cookies[:tzoffset].to_i
|
16
|
+
ActiveSupport::TimeZone[-min.minutes]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
src_path = File.join(File.expand_path("../../", __FILE__), "js_files/.")
|
2
|
+
dest_file = ::Rails.root.join("public", "javascripts")
|
3
|
+
|
4
|
+
unless File.exist?(::Rails.root.join("public", "javascripts", "jquery.cookie.js")) && File.exist?(::Rails.root.join("public", "javascripts", "time_zone_detection.js"))
|
5
|
+
puts "Copying files required for ClientTimezoneDetection..."
|
6
|
+
FileUtils.cp_r(src_path, dest_file)
|
7
|
+
puts "ClientTimezoneDetection installed successfully"
|
8
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'time_zone_detection'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{time_zone_detection}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Pavlo Lysov, Boris Babusenko"]
|
12
|
+
s.date = %q{2010-12-10}
|
13
|
+
s.description = %q{See README}
|
14
|
+
s.email = %q{boris@cleverua.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"js_files/jquery.cookie.js",
|
28
|
+
"js_files/time_zone_detection.js",
|
29
|
+
"lib/client_timezone_detection.rb",
|
30
|
+
"lib/client_timezone_detection/client_timezone_railtie.rb",
|
31
|
+
"lib/client_timezone_detection/controller_helpers.rb",
|
32
|
+
"lib/client_timezone_detection/view_helpers.rb",
|
33
|
+
"lib/client_timezone_detection_install.rb",
|
34
|
+
"test/helper.rb",
|
35
|
+
"test/test_time_zone_detection.rb"
|
36
|
+
]
|
37
|
+
s.homepage = %q{http://github.com/cleverua/time_zone_detection}
|
38
|
+
s.licenses = ["MIT"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = %q{1.3.6}
|
41
|
+
s.summary = %q{Gem for detection client time zone}
|
42
|
+
s.test_files = [
|
43
|
+
"test/helper.rb",
|
44
|
+
"test/test_time_zone_detection.rb"
|
45
|
+
]
|
46
|
+
|
47
|
+
if s.respond_to? :specification_version then
|
48
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
49
|
+
s.specification_version = 3
|
50
|
+
|
51
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
52
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
56
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
57
|
+
end
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
60
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cleverua-client_timezone_detection
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Pavlo Lysov, Boris Babusenko
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-12-10 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: bundler
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 1.0.0
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: jeweler
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 1
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 5
|
49
|
+
- 1
|
50
|
+
version: 1.5.1
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
53
|
+
description: The gem gets timezone information from user browser, saves it in a cookie and then applies the TZ in controller. That way you always have application TZ set up for the region user is actually in.
|
54
|
+
email: info@cleverua.com
|
55
|
+
executables: []
|
56
|
+
|
57
|
+
extensions: []
|
58
|
+
|
59
|
+
extra_rdoc_files:
|
60
|
+
- LICENSE.txt
|
61
|
+
- README.rdoc
|
62
|
+
files:
|
63
|
+
- .document
|
64
|
+
- Gemfile
|
65
|
+
- Gemfile.lock
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.rdoc
|
68
|
+
- Rakefile
|
69
|
+
- VERSION
|
70
|
+
- client_timezone_detection.gemspec
|
71
|
+
- js_files/jquery.cookie.js
|
72
|
+
- js_files/time_zone_detection.js
|
73
|
+
- lib/client_timezone_detection.rb
|
74
|
+
- lib/client_timezone_detection/client_timezone_railtie.rb
|
75
|
+
- lib/client_timezone_detection/controller_helpers.rb
|
76
|
+
- lib/client_timezone_detection/view_helpers.rb
|
77
|
+
- lib/client_timezone_detection_install.rb
|
78
|
+
- test/helper.rb
|
79
|
+
- test/test_time_zone_detection.rb
|
80
|
+
- time_zone_detection.gemspec
|
81
|
+
has_rdoc: true
|
82
|
+
homepage: http://github.com/cleverua/client_timezone_detection
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
requirements: []
|
109
|
+
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 1.3.7
|
112
|
+
signing_key:
|
113
|
+
specification_version: 3
|
114
|
+
summary: A rails gem aimed to simplify user timezone detection
|
115
|
+
test_files:
|
116
|
+
- test/helper.rb
|
117
|
+
- test/test_time_zone_detection.rb
|