session-check 0.0.3 → 0.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.
@@ -1,15 +1,17 @@
1
+ require 'devise'
2
+
1
3
  module SessionCheckHelper
2
4
 
3
5
  def session_check
4
6
  "<script>
5
7
  var session_time_left = #{Devise.timeout_in};
6
- var session_check = function(){
7
- session_time_left = session_time_left - 10;
8
- if (session_time_left < 0){
9
- window.location = '/users/sign_in';
10
- }
11
- setTimeout(session_check, 10000);
12
- }
8
+ var session_check = function(){
9
+ session_time_left = session_time_left - 10;
10
+ if (session_time_left < 0){
11
+ window.location = '/users/sign_in';
12
+ }
13
+ setTimeout(session_check, 10000);
14
+ }
13
15
  setTimeout(session_check, 10000);
14
16
  $.ajaxSetup({
15
17
  complete: function(xhr) {
@@ -1,5 +1,5 @@
1
1
  module Session
2
2
  module Check
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
data/lib/session/check.rb CHANGED
@@ -4,10 +4,7 @@ module Session
4
4
  module Check
5
5
  class Engine < ::Rails::Engine
6
6
  initializer "session-check.loader" do
7
- ActiveSupport.on_load(:action_controller) do
8
- include SessionCheckHelper
9
- helper_method :session_check
10
- end
7
+ # Loads the helper
11
8
  end
12
9
  end
13
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: session-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: