diff --git a/app/marley.rb b/app/marley.rb index 8d74a57..ac673f5 100644 --- a/app/marley.rb +++ b/app/marley.rb @@ -12,11 +12,15 @@ require 'akismetor' require 'githubber' +def load_or_require(file) + (Sinatra::Application.environment == :development) ? load(file) : require(file) +end + %w{ configuration post comment -}.each { |f| require File.join(File.dirname(__FILE__), 'lib', f) } +}.each { |f| load_or_require File.join(File.dirname(__FILE__), 'lib', "#{f}.rb") } # -----------------------------------------------------------------------------