lib/phenomenal_rails.rb in phenomenal_rails-1.0.0 vs lib/phenomenal_rails.rb in phenomenal_rails-1.1.0
- old
+ new
@@ -1,11 +1,13 @@
require "phenomenal"
require "phenomenal_rails/context"
+require "phenomenal_rails/feature"
require "phenomenal_rails/middleware"
require "phenomenal_rails/engine"
require "singleton"
require "phenomenal_rails/resolver"
+require "phenomenal_rails/path_set"
# Set default context as persistent
phen_default_context.persistent=true
module PhenomenalRails
@@ -13,10 +15,19 @@
if Dir.exist? path
Dir.entries(path).each do |entry|
if entry!="." && entry !=".."
filepath=File.join(path,entry)
if File.file?(filepath) && entry.match(/.*\.rb/)
+ if !Rails.configuration.cache_classes &&
+ (path.match(/.*\/controllers/) ||
+ path.match(/.*\/models/) ||
+ path.match(/.*\/helpers/))
+ begin
+ entry.gsub(/.rb/,"").camelize.constantize
+ rescue
+ end
+ end
load filepath
elsif File.directory?(filepath)
load_dir(filepath)
end
end
@@ -35,9 +46,9 @@
phen_forget_context(context)
end
end
end
if !Rails.configuration.cache_classes
- PhenomenalRails.load_dir("#{Rails.root}/app/contexts")
+ PhenomenalRails.load_dir("#{Rails.root}/phenomenal")
end
end
end