auto-session-timeout 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +41 -0
- data/CHANGELOG +4 -0
- data/Gemfile +3 -0
- data/README.md +3 -1
- data/auto-session-timeout.gemspec +5 -5
- data/lib/auto/session/timeout/version.rb +1 -1
- data/lib/auto_session_timeout_helper.rb +0 -1
- data/test/auto_session_timeout_helper_test.rb +7 -23
- metadata +37 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc498b02e7b05cbf09f3af63eb7f83617970fa76287e7beb522e2b676df6c6a0
|
4
|
+
data.tar.gz: fad257ffc2872343879ab12346d6d029c5df75e3ec7eb0913e61f441afa5250b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58db2799f2c39e9f4107bbdd21b95a563786e5e1bed28670ff0f0d04d86596c0690846a8d07c71b92804d584a40704295539b06115e52eb538a4f5693f20152a
|
7
|
+
data.tar.gz: 0ba4a07545611dd012b465e9f21eb6768de9dd588ef4c9bb2c1815bc3253bab062c360443b088c5083cfc524b0e563193edaa86307ba00f8078f4d9064eaabb6
|
data/.travis.yml
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
cache: bundler
|
4
|
+
before_install:
|
5
|
+
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
6
|
+
- gem install bundler -v '< 2'
|
7
|
+
rvm:
|
8
|
+
- 2.4.9
|
9
|
+
- 2.5.7
|
10
|
+
- 2.6.5
|
11
|
+
- 2.7.0
|
12
|
+
- ruby-head
|
13
|
+
env:
|
14
|
+
- RAILS_VERSION='~> 3.2'
|
15
|
+
- RAILS_VERSION='~> 4.0'
|
16
|
+
- RAILS_VERSION='~> 4.1'
|
17
|
+
- RAILS_VERSION='~> 4.2'
|
18
|
+
- RAILS_VERSION='~> 5.0'
|
19
|
+
- RAILS_VERSION='~> 5.1'
|
20
|
+
- RAILS_VERSION='~> 5.2'
|
21
|
+
jobs:
|
22
|
+
exclude:
|
23
|
+
- rvm: 2.7.0
|
24
|
+
env: RAILS_VERSION='~> 3.2'
|
25
|
+
- rvm: 2.7.0
|
26
|
+
env: RAILS_VERSION='~> 4.0'
|
27
|
+
- rvm: 2.7.0
|
28
|
+
env: RAILS_VERSION='~> 4.1'
|
29
|
+
- rvm: 2.7.0
|
30
|
+
env: RAILS_VERSION='~> 4.2'
|
31
|
+
- rvm: ruby-head
|
32
|
+
env: RAILS_VERSION='~> 3.2'
|
33
|
+
- rvm: ruby-head
|
34
|
+
env: RAILS_VERSION='~> 4.0'
|
35
|
+
- rvm: ruby-head
|
36
|
+
env: RAILS_VERSION='~> 4.1'
|
37
|
+
- rvm: ruby-head
|
38
|
+
env: RAILS_VERSION='~> 4.2'
|
39
|
+
allow_failures:
|
40
|
+
- rvm: ruby-head
|
41
|
+
fast_finish: true
|
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
[![Build Status](https://travis-ci.com/pelargir/auto-session-timeout.svg?branch=master)](https://travis-ci.com/pelargir/auto-session-timeout)
|
2
|
+
|
3
|
+
# Auto::Session::Timeout
|
2
4
|
|
3
5
|
Provides automatic session timeout in a Rails application. Very easy
|
4
6
|
to install and configure. Have you ever wanted to force your users
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Auto::Session::Timeout::VERSION
|
9
9
|
spec.authors = ["Matthew Bass"]
|
10
10
|
spec.email = ["pelargir@gmail.com"]
|
11
|
-
spec.description = %q{
|
11
|
+
spec.description = %q{Automatic session timeout in Rails}
|
12
12
|
spec.summary = %q{Provides automatic session timeout in a Rails application.}
|
13
13
|
spec.homepage = "http://github.com/pelargir/auto-session-timeout"
|
14
14
|
spec.license = "MIT"
|
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
22
|
-
spec.add_development_dependency "
|
23
|
-
spec.add_development_dependency "
|
24
|
-
spec.add_development_dependency "
|
21
|
+
spec.add_dependency "actionpack", [">= 3.2", "< 7"]
|
22
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
23
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
24
|
+
spec.add_development_dependency "minitest", [">= 4.2", "< 6"]
|
25
25
|
end
|
@@ -16,38 +16,22 @@ describe AutoSessionTimeoutHelper do
|
|
16
16
|
|
17
17
|
describe "#auto_session_timeout_js" do
|
18
18
|
it "returns correct JS" do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
request.onload = function (event) {
|
24
|
-
var status = event.target.status;
|
25
|
-
var response = event.target.response;
|
26
|
-
if (status === 200 && (response === false || response === 'false' || response === null)) {
|
27
|
-
window.location.href = '/timeout';
|
28
|
-
}
|
29
|
-
};
|
30
|
-
request.open('GET', '/active', true);
|
31
|
-
request.responseType = 'json';
|
32
|
-
request.send();
|
33
|
-
setTimeout(PeriodicalQuery, (60 * 1000));
|
34
|
-
}
|
35
|
-
setTimeout(PeriodicalQuery, (60 * 1000));
|
36
|
-
|
37
|
-
//]]>
|
38
|
-
</script>", subject.auto_session_timeout_js
|
19
|
+
js = subject.auto_session_timeout_js
|
20
|
+
assert js.include?("window.location.href = '/timeout'")
|
21
|
+
assert js.include?("request.open('GET', '/active', true)")
|
22
|
+
assert js.include?("setTimeout(PeriodicalQuery, (60 * 1000))")
|
39
23
|
end
|
40
24
|
|
41
25
|
it "uses custom frequency when given" do
|
42
|
-
assert_match
|
26
|
+
assert_match %r{120}, subject.auto_session_timeout_js(frequency: 120)
|
43
27
|
end
|
44
28
|
|
45
29
|
it "uses 60 when custom frequency is nil" do
|
46
|
-
assert_match
|
30
|
+
assert_match %r{60}, subject.auto_session_timeout_js(frequency: nil)
|
47
31
|
end
|
48
32
|
|
49
33
|
it "accepts attributes" do
|
50
|
-
assert_match
|
34
|
+
assert_match %r{data-turbolinks-eval="false"}, subject.auto_session_timeout_js(attributes: { 'data-turbolinks-eval': 'false' })
|
51
35
|
end
|
52
36
|
end
|
53
37
|
|
metadata
CHANGED
@@ -1,72 +1,84 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto-session-timeout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Bass
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: actionpack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
|
19
|
+
version: '3.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7'
|
23
|
+
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
29
|
+
version: '3.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
34
|
+
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
39
|
+
version: '2.0'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
46
|
+
version: '2.0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
48
|
+
name: rake
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '13.0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '13.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
62
|
+
name: minitest
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
|
-
- - "
|
65
|
+
- - ">="
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
67
|
+
version: '4.2'
|
68
|
+
- - "<"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '6'
|
62
71
|
type: :development
|
63
72
|
prerelease: false
|
64
73
|
version_requirements: !ruby/object:Gem::Requirement
|
65
74
|
requirements:
|
66
|
-
- - "
|
75
|
+
- - ">="
|
67
76
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
69
|
-
|
77
|
+
version: '4.2'
|
78
|
+
- - "<"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '6'
|
81
|
+
description: Automatic session timeout in Rails
|
70
82
|
email:
|
71
83
|
- pelargir@gmail.com
|
72
84
|
executables: []
|
@@ -74,6 +86,7 @@ extensions: []
|
|
74
86
|
extra_rdoc_files: []
|
75
87
|
files:
|
76
88
|
- ".gitignore"
|
89
|
+
- ".travis.yml"
|
77
90
|
- CHANGELOG
|
78
91
|
- Gemfile
|
79
92
|
- LICENSE.txt
|
@@ -92,7 +105,7 @@ homepage: http://github.com/pelargir/auto-session-timeout
|
|
92
105
|
licenses:
|
93
106
|
- MIT
|
94
107
|
metadata: {}
|
95
|
-
post_install_message:
|
108
|
+
post_install_message:
|
96
109
|
rdoc_options: []
|
97
110
|
require_paths:
|
98
111
|
- lib
|
@@ -107,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
120
|
- !ruby/object:Gem::Version
|
108
121
|
version: '0'
|
109
122
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
111
|
-
signing_key:
|
123
|
+
rubygems_version: 3.1.4
|
124
|
+
signing_key:
|
112
125
|
specification_version: 4
|
113
126
|
summary: Provides automatic session timeout in a Rails application.
|
114
127
|
test_files:
|