snapuser 0.2.2 → 0.2.3
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 +4 -4
- data/app/helpers/sessions_helper.rb +7 -7
- data/lib/snapuser/engine.rb +1 -5
- data/lib/snapuser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b28152b0612e54b47332e5335d320ec6bd4853
|
4
|
+
data.tar.gz: 36e09e1cdf885abed8f60610f207e0727eb27c0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: defcf2f4b048436c5b7af8c9931a45b3d5ce085814add681a95cae9f1b10ee7834cf1b5a7db3d9677d2c791829282a4a8da283ab1a21da7d572c4552220300fb
|
7
|
+
data.tar.gz: 6ef5cd371edd14ca75da7b4e5ba90f98d48d0776ff33df17de2b51f01720721ec30b256112fd3e3a3090505b3afb003c74a61dc6d21643c2b0507cdc5ec7b48a
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module SessionsHelper
|
2
2
|
|
3
3
|
# Sign in a user with a cookie (remove on browser close)
|
4
|
-
#
|
4
|
+
#
|
5
5
|
# * *Args* :
|
6
6
|
# - a user to sign in
|
7
7
|
# * *Returns* :
|
@@ -16,7 +16,7 @@ module SessionsHelper
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# Provid the user currently signed in.
|
19
|
-
#
|
19
|
+
#
|
20
20
|
# * *Returns* :
|
21
21
|
# - the user currently signed in
|
22
22
|
def current_user
|
@@ -25,7 +25,7 @@ module SessionsHelper
|
|
25
25
|
|
26
26
|
|
27
27
|
# Check if there is a user signed in.
|
28
|
-
#
|
28
|
+
#
|
29
29
|
# * *Returns* :
|
30
30
|
# - true or false
|
31
31
|
def signed_in?
|
@@ -39,9 +39,9 @@ module SessionsHelper
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# Store the current url in session's variable
|
42
|
-
#
|
42
|
+
#
|
43
43
|
# * *Args* :
|
44
|
-
#
|
44
|
+
#
|
45
45
|
# * *Returns* :
|
46
46
|
#
|
47
47
|
def store_location
|
@@ -49,7 +49,7 @@ module SessionsHelper
|
|
49
49
|
end
|
50
50
|
|
51
51
|
# Redirect the user to the stored url or the default one provided
|
52
|
-
#
|
52
|
+
#
|
53
53
|
# * *Args* :
|
54
54
|
# - default path to redirect to
|
55
55
|
# * *Returns* :
|
@@ -74,4 +74,4 @@ module SessionsHelper
|
|
74
74
|
redirect_to login_path, error: t("snapuser.errors.unconnected") unless signed_in?
|
75
75
|
end
|
76
76
|
|
77
|
-
end
|
77
|
+
end
|
data/lib/snapuser/engine.rb
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
module Snapuser
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
-
require
|
3
|
+
require "snaptable"
|
4
4
|
|
5
5
|
initializer "Snapuser.append_migrations" do |app|
|
6
6
|
config.paths["db/migrate"].expanded.each do |expanded_path|
|
7
7
|
app.config.paths["db/migrate"] << expanded_path
|
8
8
|
end
|
9
9
|
end
|
10
|
-
|
11
|
-
initializer 'Snapuser.action_controller' do |app|
|
12
|
-
ActionController::Base.send :include, SessionsHelper
|
13
|
-
end
|
14
10
|
end
|
15
11
|
end
|
data/lib/snapuser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snapuser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khcr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|