rails-automaticlogout 0.1.1 → 0.1.2

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
2
  SHA1:
3
- metadata.gz: 755f81a5ef6277ff52d72f91f1d4f4fcf1c2ba68
4
- data.tar.gz: c93b1eeefd9e9570a012ea8cc7dcad8c100281b1
3
+ metadata.gz: 1d6b3a146fbaf9ece4dbe08f80adea0dab8dfe61
4
+ data.tar.gz: 1b05682f106f64a2891242e3629bdaed02037554
5
5
  SHA512:
6
- metadata.gz: 2b2c5813145e6843f857059277ee27567fca9e86a3bb3ef33478f8710a180069e9a64adda6361f5fe751ba2de68703d71f25f1b0d3ff9725aeeeafbdd401657f
7
- data.tar.gz: 2a313869e0f8bb3c453077371fe6a5b852d6872003585ffe7c5c539f1a88fc90cd98fc958eda442a21c009c32b6e957a79a71dbbe28f254b765563ed256379b5
6
+ metadata.gz: 7461b5d9189a3ce7e4f8130ae57a2d683a1d23e92b0c408f78d4b4267607b86ef0689afb8afb73d9407a10cf288c03e025d21cbfe6526dd90d52d52249c930bf
7
+ data.tar.gz: f40ca58f174fb995140f2467292cc99e9093e2a8f3023a6a86944d2a9a043c81bf07cb25e21baa31455222f467c8e3f62be9e9ee1399a4c0b4b3de2065baef80
data/.gitignore CHANGED
@@ -7,5 +7,6 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .DS_Store
10
11
 
11
12
  *.gem
data/README.md CHANGED
@@ -14,7 +14,7 @@ Provides automatic session timeout in a Rails application. Very easy to install
14
14
  Rails Automatic Logout works only Rails 4. You can add it to your Gemfile with:
15
15
 
16
16
  ```ruby
17
- gem 'rails-automaticlogout'
17
+ gem 'rails-automaticlogout', '~> 0.1'
18
18
  ```
19
19
 
20
20
  Then run bundle install
@@ -59,6 +59,12 @@ class ApplicationController < ActionController::Base
59
59
  end
60
60
  ```
61
61
 
62
+ ### Configure Javascript
63
+ Add in your application.js this require
64
+
65
+ ```javascript
66
+ //= require automatic_logout
67
+ ```
62
68
  ### Configure View (OPTIONAL)
63
69
 
64
70
  Use Helper in your view, for show regressive timer. Add this in your file application.html.erb
@@ -22,7 +22,7 @@ AutomaticLogout.destroySession = function(){
22
22
  }
23
23
 
24
24
  /**
25
- * Method regressive time based in session auto expired at
25
+ * Method regressive time based in session auto expired at.
26
26
  * @param {[type]} date_session [description]
27
27
  * @return {[type]} [description]
28
28
  */
@@ -48,9 +48,9 @@ AutomaticLogout.regressiveTimer = function(){;
48
48
  diff_in_seconds = (timeout_in_seconds - now_in_seconds).toFixed(0);
49
49
 
50
50
  if (diff_in_seconds <= 0){
51
- if (confirm(data_message)){
51
+ alertify.alert(data_message, function () {
52
52
  AutomaticLogout.destroySession();
53
- }
53
+ });
54
54
  }else{
55
55
  var seconds_float = (target_date - current_date) / 1000,
56
56
  date_format = AutomaticLogout.parseDate(seconds_float);
@@ -129,9 +129,9 @@ AutomaticLogout.ajaxSessionTimeout = function(){
129
129
  var now_time = (new Date().getTime());
130
130
 
131
131
  if ((response_timeout < now_time) === true){
132
- if (confirm(data.message)){
132
+ alertify.alert(data_message, function () {
133
133
  window.location.href = '/destroy_automatic_logout';
134
- }
134
+ });
135
135
  }
136
136
  }, (data.seconds / 2) * 1000) // utiliza o mesmo valor em seconds que a pessoa irá ficar logado
137
137
  }
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module AutomaticLogout
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "actionpack", "~> 3.2"
24
+ spec.add_dependency "alertify-rails", "~> 0.2.0"
24
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-automaticlogout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thadeu Esteves Jr
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-13 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: alertify-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.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.2.0
55
69
  description: Provides automatic session timeout in a Rails application.
56
70
  email:
57
71
  - tadeuu@gmail.com
@@ -94,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
108
  version: '0'
95
109
  requirements: []
96
110
  rubyforge_project:
97
- rubygems_version: 2.6.8
111
+ rubygems_version: 2.5.1
98
112
  signing_key:
99
113
  specification_version: 4
100
114
  summary: Provides automatic session timeout in a Rails application.