browser-timezone-rails 0.2.00 → 1.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 +1 -2
- data/app/assets/javascripts/browser_timezone_rails/set_time_zone.js +4 -0
- data/lib/browser-timezone-rails.rb +5 -9
- data/lib/browser-timezone-rails/version.rb +1 -1
- metadata +6 -20
- data/app/assets/javascripts/browser_timezone_rails/set_time_zone.js.coffee +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40589a73cbc1b4387bcd606102119ff8f977b510
|
4
|
+
data.tar.gz: e8518f3d8c4b99aa25e3187b17e27552f1d28fe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed8df349538e6d199e380dc979ca5820dabd5fe0a1045041cf7fffad21ca06f3794e6062db589ebbc45ecba8a75ff053c5dbf8176b096c9a4aaaa5bbcbbf1c4a
|
7
|
+
data.tar.gz: 1d1a59ff1d91d345168f6b93731896630512f0668a1a0b1dcc6873d7b51e2001cdc231580eaea64cfab40f2d4c477f4d7b57429be0a72e3f2b2d8efa68675c6d
|
data/README.md
CHANGED
@@ -15,8 +15,7 @@ gem 'browser-timezone-rails'
|
|
15
15
|
|
16
16
|
Make sure you have each of the following entries in your application.js:
|
17
17
|
```
|
18
|
-
//= require
|
19
|
-
//= require jquery.cookie
|
18
|
+
//= require js.cookie
|
20
19
|
//= require jstz
|
21
20
|
//= require browser_timezone_rails/set_time_zone
|
22
21
|
```
|
@@ -1,22 +1,18 @@
|
|
1
1
|
require "browser-timezone-rails/engine"
|
2
|
-
require '
|
3
|
-
require 'jquery-cookie-rails'
|
2
|
+
require 'js_cookie_rails'
|
4
3
|
require 'jstz-rails'
|
5
4
|
|
6
5
|
module BrowserTimezoneRails
|
7
6
|
module TimezoneControllerSetup
|
8
7
|
def self.included(base)
|
9
|
-
base.send(:
|
8
|
+
base.send(:prepend_around_action, :set_time_zone)
|
10
9
|
end
|
11
10
|
|
12
11
|
private
|
13
12
|
|
14
|
-
def set_time_zone
|
15
|
-
|
16
|
-
Time.
|
17
|
-
yield
|
18
|
-
ensure
|
19
|
-
Time.zone = old_time_zone
|
13
|
+
def set_time_zone(&action)
|
14
|
+
# Use existing methods to simplify filter
|
15
|
+
Time.use_zone(browser_timezone.presence || Time.zone, &action)
|
20
16
|
end
|
21
17
|
|
22
18
|
def browser_timezone
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser-timezone-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0
|
4
|
+
version: '1.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kbaum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: js_cookie_rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,21 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: jstz-rails
|
42
|
+
name: jstz-rails3-plus
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - ">="
|
@@ -132,7 +118,7 @@ files:
|
|
132
118
|
- MIT-LICENSE
|
133
119
|
- README.md
|
134
120
|
- Rakefile
|
135
|
-
- app/assets/javascripts/browser_timezone_rails/set_time_zone.js
|
121
|
+
- app/assets/javascripts/browser_timezone_rails/set_time_zone.js
|
136
122
|
- app/controllers/browser_timezone_rails/application_controller.rb
|
137
123
|
- config/routes.rb
|
138
124
|
- lib/browser-timezone-rails.rb
|
@@ -157,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
143
|
version: '0'
|
158
144
|
requirements: []
|
159
145
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.4.
|
146
|
+
rubygems_version: 2.4.8
|
161
147
|
signing_key:
|
162
148
|
specification_version: 4
|
163
149
|
summary: Sets the browser timezone within rails
|