bread 0.0.9 → 0.0.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e0567dbd708872910d121e4862169f7a4d922a6
|
4
|
+
data.tar.gz: 38d6e735242580195a9a43c6e8db8498db1e3079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae7e121cdd68ec2beec830e6561200b433cd119f525bb05bf6fcc821030473137a2e1cd59a9eb82b1f87e0a46f97fc7ff1ac293f835be9adf0f3c86d394b3932
|
7
|
+
data.tar.gz: ed026fd34dfa1ab1bc6276b72f3a9070f87c7ade0cb641a94e78729b80efdebb5df0145a1f12ae216c59a8cf9e2d92c80dc796ff71bee7b9b48f63845a142b75
|
@@ -5,6 +5,7 @@ module Bread
|
|
5
5
|
|
6
6
|
def initialize
|
7
7
|
@controllers = {}
|
8
|
+
add_devise_support
|
8
9
|
end
|
9
10
|
|
10
11
|
def controller(controller_path, options={}, &block)
|
@@ -19,7 +20,23 @@ module Bread
|
|
19
20
|
end
|
20
21
|
|
21
22
|
|
23
|
+
private
|
22
24
|
|
25
|
+
def add_devise_support
|
26
|
+
return if !defined? Devise
|
27
|
+
|
28
|
+
controller 'devise/sessions' do
|
29
|
+
actions(:new) { crumbs :@root, :@devise_sign_in }
|
30
|
+
end
|
31
|
+
controller 'devise/registrations' do
|
32
|
+
actions(:new) { crumbs :@root, :@devise_sign_up }
|
33
|
+
actions(:edit) { crumbs :@root, :@devise_edit_user }
|
34
|
+
end
|
35
|
+
controller 'devise/passwords' do
|
36
|
+
actions(:new) { crumbs :@root, :@devise_sign_in, :@devise_remember }
|
37
|
+
actions(:edit) { crumbs :@root, :@devise_sign_in, :@devise_remember }
|
38
|
+
end
|
39
|
+
end
|
23
40
|
|
24
41
|
end
|
25
42
|
end
|
@@ -5,6 +5,7 @@ module Bread
|
|
5
5
|
|
6
6
|
def initialize
|
7
7
|
@crumb_blocks = {}
|
8
|
+
add_devise_support
|
8
9
|
end
|
9
10
|
|
10
11
|
def crumb(token, &block)
|
@@ -19,6 +20,18 @@ module Bread
|
|
19
20
|
|
20
21
|
|
21
22
|
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def add_devise_support
|
27
|
+
return if !defined? Devise
|
28
|
+
|
29
|
+
crumb(:@devise_sign_in) { to "Sign In", h.new_user_session_path }
|
30
|
+
crumb(:@devise_sign_up) { to "Sign Up", h.new_user_registration_path }
|
31
|
+
crumb(:@devise_edit_user) { to "Edit Profile", h.edit_user_registration_path }
|
32
|
+
crumb(:@devise_remember) { to "Forgot Password", h.new_user_password_path }
|
33
|
+
end
|
34
|
+
|
22
35
|
end
|
23
36
|
end
|
24
37
|
end
|
data/lib/bread/version.rb
CHANGED
@@ -15,18 +15,4 @@ Bread.actions.config do
|
|
15
15
|
actions(:edit) { crumbs :@photos, :@photo, :@edit_photo }
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
#devise
|
20
|
-
controller 'devise/sessions' do
|
21
|
-
actions(:new) { crumbs :@root, :@devise_sign_in }
|
22
|
-
end
|
23
|
-
controller 'devise/registrations' do
|
24
|
-
actions(:new) { crumbs :@root, :@devise_sign_up }
|
25
|
-
actions(:edit) { crumbs :@root, :@devise_edit_user }
|
26
|
-
end
|
27
|
-
controller 'devise/passwords' do
|
28
|
-
actions(:new) { crumbs :@root, :@devise_sign_in, :@devise_remember }
|
29
|
-
actions(:edit) { crumbs :@root, :@devise_sign_in, :@devise_remember }
|
30
|
-
end
|
31
|
-
|
32
18
|
end
|
@@ -19,11 +19,7 @@ Bread.crumbs.config do
|
|
19
19
|
crumb(:@edit_photo) { to "Edit", h.edit_product_product_photo_path }
|
20
20
|
crumb(:@photo) { to @product_photo.unchanged_name, h.product_product_photo_path }
|
21
21
|
|
22
|
-
|
23
|
-
crumb(:@devise_sign_in) { to "Sign In", h.new_user_session_path }
|
24
|
-
crumb(:@devise_sign_up) { to "Sign Up", h.new_user_registration_path }
|
25
|
-
crumb(:@devise_edit_user) { to "Edit Profile", h.edit_user_registration_path }
|
26
|
-
crumb(:@devise_remember) { to "Forgot Password", h.new_user_password_path }
|
22
|
+
|
27
23
|
|
28
24
|
|
29
25
|
end
|