bootswatch_rails 3.1.1.11 → 3.1.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bootswatch_rails/version.rb +1 -1
- data/lib/generators/bootswatch_rails/install/install_generator.rb +19 -29
- data/lib/generators/bootswatch_rails/sorcery/sorcery_generator.rb +16 -0
- data/lib/generators/bootswatch_rails/sorcery/templates/sorcery.de.yml +1 -0
- data/lib/generators/bootswatch_rails/sorcery/templates/users_controller.rb +1 -0
- 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: 277159fe829dec481e3483ba9ced4cbf462ba513
|
4
|
+
data.tar.gz: 55876bfef80f2fdae6b697864ed8f2937464643a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 334f1abb47c528e096fce1b6aa91fa0aab95220c4996339636a7306c174ea61aaa8cda2dc9b04fb31a1c349924144edc3c31685a359b1429b0fa2b9cad7f5401
|
7
|
+
data.tar.gz: a5ebf20d243bf52b69cd060420c34bef4d885f89cecdb360635c1950dd532643e78308f7649467802cf777c6f0641c6d18a60ba57d27828b555d6c0553423cdf
|
@@ -8,37 +8,28 @@ module BootswatchRails
|
|
8
8
|
|
9
9
|
def update_javascripts
|
10
10
|
return unless options.bootstrap?
|
11
|
-
|
12
|
-
|
13
|
-
"\n//= require bootstrap"
|
14
|
-
end
|
15
|
-
end
|
11
|
+
file = "app/assets/javascripts/application.js"
|
12
|
+
inject_into_file file, "\n//= require bootstrap", after: /require jquery_ujs$/
|
16
13
|
end
|
17
14
|
|
18
15
|
def update_application_controller
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
""
|
37
|
-
]
|
38
|
-
inject_into_file file, before: /^end$/ do
|
39
|
-
lines.join("\n")
|
40
|
-
end
|
41
|
-
end
|
16
|
+
file = "app/controllers/application_controller.rb"
|
17
|
+
inject_into_file file, "\n\n private", after: /protect_from_forgery.*$/
|
18
|
+
lines = [
|
19
|
+
"",
|
20
|
+
" def default_theme",
|
21
|
+
" BootswatchRails::THEMES[BootswatchRails::DEFAULT].to_s",
|
22
|
+
" end",
|
23
|
+
" helper_method :default_theme",
|
24
|
+
"",
|
25
|
+
" def current_theme",
|
26
|
+
" @current_theme = current_user.theme if current_user.present?",
|
27
|
+
" @current_theme ||= default_theme",
|
28
|
+
" end",
|
29
|
+
" helper_method :current_theme",
|
30
|
+
""
|
31
|
+
]
|
32
|
+
inject_into_file file, lines.join("\n"), before: /^end$/
|
42
33
|
end
|
43
34
|
|
44
35
|
def copy_directories
|
@@ -49,4 +40,3 @@ module BootswatchRails
|
|
49
40
|
end
|
50
41
|
end
|
51
42
|
end
|
52
|
-
|
@@ -78,6 +78,8 @@ module BootswatchRails
|
|
78
78
|
] if reset_password?
|
79
79
|
lines << [
|
80
80
|
" end",
|
81
|
+
"get '/login' => '#{table_name}#log_in', as: :login",
|
82
|
+
"get '/logout' => '#{table_name}#log_out', as: :logout",
|
81
83
|
""
|
82
84
|
]
|
83
85
|
route lines.join("\n")
|
@@ -93,6 +95,20 @@ module BootswatchRails
|
|
93
95
|
end
|
94
96
|
end
|
95
97
|
|
98
|
+
def update_application_controller
|
99
|
+
file = "app/controllers/application_controller.rb"
|
100
|
+
inject_into_class file, "ApplicationController", " before_filter :require_login\n\n"
|
101
|
+
inject_into_file file, "\n\n private", after: /protect_from_forgery.*$/
|
102
|
+
lines = [
|
103
|
+
"",
|
104
|
+
" def not_authenticated",
|
105
|
+
" redirect_to login_path, alert: t('sorcery.required')",
|
106
|
+
" end",
|
107
|
+
""
|
108
|
+
]
|
109
|
+
inject_into_file file, lines.join("\n"), before: /^end$/
|
110
|
+
end
|
111
|
+
|
96
112
|
protected
|
97
113
|
|
98
114
|
def user_activation?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootswatch_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.1.
|
4
|
+
version: 3.1.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volker Wiegand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|