rack-locale_memorable 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa0c01424f46339976170cf682e5bfa2dc9d9fa7d07dd43f8a879364b0aad2b3
|
4
|
+
data.tar.gz: 15f3723e2480bf0383cc10f34c5fe317006ecde186f89ec25846db244e69194c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b18e7390e5a87613d9b67f4373587ea38b412396698f1f25f3f5cebb6b094d637616b13177733bb9c1e2968c534763953f7490ff1eea4915ebc9eca9fd067d8e
|
7
|
+
data.tar.gz: ed28ed315f1f27d1e6f6780a7ab2117a848cff1f609247baf806189d995eacc56c397890c524abf28438dbd4a9e482b4a006dcea8205268c5b0379faa417d9ad
|
data/CHANGELOG.md
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
module Rack
|
4
4
|
class LocaleMemorable
|
5
5
|
class Response < Rack::Response
|
6
|
-
def remember_locale(explicit_locale, key:, lifetime:
|
6
|
+
def remember_locale(explicit_locale, key:, lifetime: 31536000, domain: nil, path: '/', http_only: true, secure: true)
|
7
7
|
set_cookie key, {
|
8
8
|
value: explicit_locale,
|
9
|
-
expires: lifetime.
|
9
|
+
expires: Time.at(Time.now.to_i + lifetime.to_i),
|
10
10
|
domain: domain,
|
11
11
|
path: path,
|
12
12
|
http_only: http_only,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'active_support/core_ext'
|
3
|
+
require 'i18n'
|
5
4
|
require 'http/accept'
|
6
5
|
require 'rack'
|
7
6
|
|
@@ -20,7 +19,7 @@ module Rack
|
|
20
19
|
env['rack.locale'] = I18n.locale.to_s
|
21
20
|
status, headers, body = @app.call(env)
|
22
21
|
response = Response.new body, status, headers
|
23
|
-
if request.explicit_locale
|
22
|
+
if request.explicit_locale
|
24
23
|
response.remember_locale request.explicit_locale, key: @cookie_key, **@cookie_options
|
25
24
|
end
|
26
25
|
response.finish
|
@@ -32,7 +32,6 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency 'rack'
|
33
33
|
spec.add_dependency 'i18n'
|
34
34
|
spec.add_dependency 'http-accept'
|
35
|
-
spec.add_dependency 'activesupport'
|
36
35
|
spec.add_development_dependency 'rake'
|
37
36
|
spec.add_development_dependency 'rspec'
|
38
37
|
spec.add_development_dependency 'simplecov'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-locale_memorable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: activesupport
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rake
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|