lockdown 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.3.9 2008-05-01
2
+ * Modify: changed controller_classes from array to hash to speed up access
3
+
1
4
  == 0.3.8 2008-05-01
2
5
  * Fixed: corrected class loader to ensure ObjectSpace is used only once
3
6
 
@@ -180,15 +180,12 @@ module Lockdown
180
180
  end
181
181
 
182
182
  def fetch_controller_class(str)
183
- @controller_classes.each do |klass|
184
- return klass if klass.name == controller_class_name(str)
185
- end
183
+ @controller_classes[controller_class_name(str)]
186
184
  end
187
185
 
188
186
  protected
189
187
 
190
188
  def set_defaults
191
- @controller_classes = []
192
189
  load_controller_classes
193
190
 
194
191
  @permissions = {}
@@ -217,6 +214,8 @@ module Lockdown
217
214
  end
218
215
 
219
216
  def load_controller_classes
217
+ @controller_classes = {}
218
+
220
219
  unless const_defined?("Application")
221
220
  require(Lockdown.project_root + "/app/controllers/application.rb")
222
221
  end
@@ -226,7 +225,7 @@ module Lockdown
226
225
  next if c == "application.rb"
227
226
  klass = controller_class_name_from_file(c)
228
227
  require(c) unless qualified_const_defined?(klass)
229
- @controller_classes.push( qualified_const_get(klass) )
228
+ @controller_classes[klass] = qualified_const_get(klass)
230
229
  end
231
230
  end
232
231
  end
@@ -2,7 +2,7 @@ module Lockdown #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- TINY = 8
5
+ TINY = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  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.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone