lockdown 0.3.14 → 0.3.15
Sign up to get free protection for your applications and to get access to all the features.
data/History.txt
CHANGED
data/lib/lockdown/system.rb
CHANGED
@@ -216,16 +216,12 @@ module Lockdown
|
|
216
216
|
def load_controller_classes
|
217
217
|
@controller_classes = {}
|
218
218
|
|
219
|
-
|
220
|
-
load(Lockdown.project_root + "/app/controllers/application.rb")
|
221
|
-
end
|
219
|
+
maybe_load_framework_controller_parent
|
222
220
|
|
223
221
|
Dir.chdir("#{Lockdown.project_root}/app/controllers") do
|
224
222
|
Dir["**/*.rb"].sort.each do |c|
|
225
223
|
next if c == "application.rb"
|
226
|
-
|
227
|
-
load(c) unless qualified_const_defined?(klass)
|
228
|
-
@controller_classes[klass] = qualified_const_get(klass)
|
224
|
+
lockdown_load(c)
|
229
225
|
end
|
230
226
|
end
|
231
227
|
end
|
@@ -242,6 +238,25 @@ module Lockdown
|
|
242
238
|
end
|
243
239
|
end
|
244
240
|
|
241
|
+
def maybe_load_framework_controller_parent
|
242
|
+
if Lockdown.rails_app?
|
243
|
+
Dependencies.require_or_load("application.rb")
|
244
|
+
else
|
245
|
+
#just default to Merb for now as the only alternative
|
246
|
+
load("application.rb") unless const_defined?("Application")
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
def lockdown_load(file)
|
251
|
+
klass = controller_class_name_from_file(file)
|
252
|
+
if Lockdown.rails_app?
|
253
|
+
Dependencies.require_or_load(file)
|
254
|
+
else
|
255
|
+
load(file) unless qualified_const_defined?(klass)
|
256
|
+
end
|
257
|
+
@controller_classes[klass] = qualified_const_get(klass)
|
258
|
+
end
|
259
|
+
|
245
260
|
def qualified_const_defined?(klass)
|
246
261
|
if klass =~ /::/
|
247
262
|
namespace, klass = klass.split("::")
|
data/lib/lockdown/version.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
<%= flash[:notice] if flash[:notice] %>
|
2
|
+
<%= flash[:error] if flash[:error] %>
|
3
|
+
|
1
4
|
<% form_tag sessions_path do -%>
|
2
5
|
<p><label for="login">Login</label><br/>
|
3
6
|
<%= text_field_tag 'login' %></p>
|
@@ -6,4 +9,4 @@
|
|
6
9
|
<%= password_field_tag 'password' %></p>
|
7
10
|
|
8
11
|
<p><%= submit_tag 'Log in' %></p>
|
9
|
-
<% end -%>
|
12
|
+
<% end -%>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lockdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Stone
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-03 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|