browser-timezone-rails 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +3 -3
- data/lib/browser-timezone-rails.rb +12 -4
- data/lib/browser-timezone-rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 22750aa5b1b9e419de58c2a8a6c29239b77bd74d
|
4
|
+
data.tar.gz: 7b86002f2eb920bf3955d65816a32c9ee31844df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ddf9be32db4385bf88ec53a4ed4147da7fe75903068e07f145180d588dbcac49cb5adc1d1a7449bea78c087a0e42981011cd077d32f019528a5dcb8e3f0265
|
7
|
+
data.tar.gz: e95b30c11c0f191b5848ed8333fdd0a0b4a88ecc64333d78bf734465be220e166efe224ac836d744d0c268e75a65330c624d5094510c7be9a2ba55d591ce9a72
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
21
|
end
|
22
22
|
|
23
|
-
APP_RAKEFILE = File.expand_path("../
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
24
|
load 'rails/tasks/engine.rake'
|
25
25
|
|
26
26
|
|
@@ -31,8 +31,8 @@ require 'rake/testtask'
|
|
31
31
|
|
32
32
|
Rake::TestTask.new(:test) do |t|
|
33
33
|
t.libs << 'lib'
|
34
|
-
t.libs << '
|
35
|
-
t.pattern = '
|
34
|
+
t.libs << 'spec'
|
35
|
+
t.pattern = 'spec/**/*_spec.rb'
|
36
36
|
t.verbose = false
|
37
37
|
end
|
38
38
|
|
@@ -1,11 +1,19 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'browser-timezone-rails/engine'
|
2
4
|
require 'js_cookie_rails'
|
3
5
|
require 'jstz-rails'
|
4
6
|
|
5
7
|
module BrowserTimezoneRails
|
8
|
+
PREPEND_METHOD = if Rails::VERSION::MAJOR == 3 || (Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2)
|
9
|
+
:prepend_around_filter
|
10
|
+
else
|
11
|
+
:prepend_around_action
|
12
|
+
end
|
13
|
+
|
6
14
|
module TimezoneControllerSetup
|
7
15
|
def self.included(base)
|
8
|
-
base.send(
|
16
|
+
base.send(PREPEND_METHOD, :set_time_zone)
|
9
17
|
end
|
10
18
|
|
11
19
|
private
|
@@ -16,12 +24,12 @@ module BrowserTimezoneRails
|
|
16
24
|
end
|
17
25
|
|
18
26
|
def browser_timezone
|
19
|
-
cookies[
|
27
|
+
cookies['browser.timezone']
|
20
28
|
end
|
21
29
|
end
|
22
30
|
|
23
31
|
class Railtie < Rails::Engine
|
24
|
-
initializer
|
32
|
+
initializer 'browser_timezone_rails.controller' do
|
25
33
|
ActiveSupport.on_load(:action_controller) do
|
26
34
|
if self == ActionController::Base
|
27
35
|
include BrowserTimezoneRails::TimezoneControllerSetup
|
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: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kbaum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.5.2.3
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Sets the browser timezone within rails
|