Skip to content

Commit

Permalink
Allow re-loading lib files in :development environment
Browse files Browse the repository at this point in the history
  • Loading branch information
karmi committed Apr 13, 2009
1 parent 233c857 commit 402b30b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/marley.rb
Expand Up @@ -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") }

# -----------------------------------------------------------------------------

Expand Down

0 comments on commit 402b30b

Please sign in to comment.