auto-session-timeout 0.9 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e5608cb490be24dc64cd386667bfba91d31b2627
4
- data.tar.gz: 020ffe74bdafa7d732066739a23e7cc0e58d3ec0
5
- SHA512:
6
- metadata.gz: 91e277d948c4364d670f9db9e549fa8770d243bc8cff3ea61dc05f3ba3df378c78d135ab93098dcc7944babdca135abc896e928de847fb5b379ae2c2bc91ad77
7
- data.tar.gz: e99b135561c915cbbac6a19b5d4aa651e2508cda2e4cc3bc6516fea874d361eb1b8d281f339d1095a650908dd71bd6401749b3bdf9fd3989c99ad36ed035b39c
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YmRiNTA2ODE4NzJiMDc3Zjg2MjM1YTgzMGFmZGQ1YWI4ZjhiOTY0MA==
5
+ data.tar.gz: !binary |-
6
+ NjhjNzcyOGY0YWZlNDI2MGM1YWMzYmJjMThhZTA5ODA5NDEwZmY1Nw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZWZkZmIyNGQzNmFmNTM5Nzg5MmM4YWU4Yjg0MGFhODQ0NjdlODg5ZWFlYmVh
10
+ ZTQyYjQ5MTBiMTU5MmY3NDQyNTExNjBiZDllNWU3ZTk5ODNjNjQ1M2UxOTli
11
+ ZjI0ZTQ4N2UyZGUzZGEwNjhhN2QzZThlNWU3MDA2YzE4YjA2Mzc=
12
+ data.tar.gz: !binary |-
13
+ N2I1YzhiYzMzNTQ2YTkwMDJkZjE0OTA3MDIyM2E2NmY4NmM3N2Y0NTNkMjM5
14
+ NjE2OWIxOWYwZmUxNWE2MDYxYzYxM2M2NTY3MWVmYTcyMTAxNTBhZGZmMDQ2
15
+ YzY1YzY0MmU5YmIzNDlkYzBiOTVmYmUyYzdlYmQwOGI3ZjIyMzM=
data/.gitignore CHANGED
@@ -3,6 +3,8 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ *.sublime-project
7
+ *.sublime-workspace
6
8
  Gemfile.lock
7
9
  InstalledFiles
8
10
  _yardoc
data/README.md CHANGED
@@ -94,6 +94,7 @@ seconds. The following example checks the server every 15 seconds:
94
94
 
95
95
  * current_user must be defined
96
96
  * using Prototype vs. jQuery
97
+ * setting timeout in controller vs. user
97
98
 
98
99
  ## Contributing
99
100
 
@@ -1,7 +1,7 @@
1
1
  module Auto
2
2
  module Session
3
3
  module Timeout
4
- VERSION = "0.9"
4
+ VERSION = "0.9.1"
5
5
  end
6
6
  end
7
7
  end
@@ -6,13 +6,14 @@ module AutoSessionTimeout
6
6
  end
7
7
 
8
8
  module ClassMethods
9
- def auto_session_timeout(seconds)
9
+ def auto_session_timeout(seconds=nil)
10
10
  prepend_before_filter do |c|
11
11
  if c.session[:auto_session_expires_at] && c.session[:auto_session_expires_at] < Time.now
12
12
  c.send :reset_session
13
13
  else
14
14
  unless c.url_for(c.params).start_with?(c.send(:active_url))
15
- c.session[:auto_session_expires_at] = Time.now + seconds
15
+ offset = seconds || current_user.try(:auto_timeout)
16
+ c.session[:auto_session_expires_at] = Time.now + offset if offset && offset > 0
16
17
  end
17
18
  end
18
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Bass
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-22 00:00:00.000000000 Z
11
+ date: 2013-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
@@ -97,12 +97,12 @@ require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - '>='
100
+ - - ! '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - '>='
105
+ - - ! '>='
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []