browser-timezone-rails 1.0.3 → 1.0.4

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
- SHA256:
3
- metadata.gz: ca271ca6492935baff61b7a48da71cbe319392ee52aa2d762c3f77239269d519
4
- data.tar.gz: caf5765cb0b800bdd42ef12ea58a5eb6c927d35204d50035334597b5dd11208c
2
+ SHA1:
3
+ metadata.gz: 22750aa5b1b9e419de58c2a8a6c29239b77bd74d
4
+ data.tar.gz: 7b86002f2eb920bf3955d65816a32c9ee31844df
5
5
  SHA512:
6
- metadata.gz: b33e38f76b8c67bffb03b33357a2b543f522ac57f15c284fdb0a5495c7c0eddf6f4b2f820e608b27b9ffff62c3a81d66d456f96b24dee37455d1e4350664e2be
7
- data.tar.gz: 2c0839355d1d84788db6e6968d1341d82aa67479b9b038bd7c639b788713ecb3cc4a3e5b06d36faa66f092080a63fac277e562a761ebface6d15f61b3b406075
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("../test/dummy/Rakefile", __FILE__)
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 << 'test'
35
- t.pattern = 'test/**/*_test.rb'
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
- require "browser-timezone-rails/engine"
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(:prepend_around_action, :set_time_zone)
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["browser.timezone"]
27
+ cookies['browser.timezone']
20
28
  end
21
29
  end
22
30
 
23
31
  class Railtie < Rails::Engine
24
- initializer "browser_timezone_rails.controller" do
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
@@ -1,3 +1,3 @@
1
1
  module BrowserTimezoneRails
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
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.3
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-02-09 00:00:00.000000000 Z
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.7.6
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