lib/app_slice/rails.rb in bradgessler-app-slice-0.2.3 vs lib/app_slice/rails.rb in bradgessler-app-slice-0.2.4

- old
+ new

@@ -1,13 +1,14 @@ require File.join(File.dirname(__FILE__), %w[.. app_slice]) require File.join(File.dirname(__FILE__), %w[rails initializer]) +require File.join(File.dirname(__FILE__), %w[rails file]) module AppSlice module Rails class << self def init! - ::Rails.public_path = File.join(root, 'public') + ::Rails.public_path = public_path ::ActionController::Routing::Routes.add_configuration_file File.join(config_path, 'routes.rb') # Update frameworks with view_paths [::ActionController, ::ActionMailer].each do |framework| framework::Base.send(:view_paths).unshift(view_path) end @@ -22,9 +23,13 @@ end end def environment_path File.join(config_path, 'environments', "#{RAILS_ENV}.rb") + end + + def public_path + File.join(root, 'public') end def root_environment_path File.join(config_path, 'environment.rb') end