Commit 63227bd0 by Robert Raposa Committed by GitHub

Merge pull request #220 from edx/robrap/fix-rebuild

TNL-6118: Fix rebuild by loading app.rb in Rakefile
parents a2763a98 488e7fdb
...@@ -4,9 +4,6 @@ require 'bundler' ...@@ -4,9 +4,6 @@ require 'bundler'
Bundler.setup Bundler.setup
Bundler.require Bundler.require
application_yaml = ERB.new(File.read('config/application.yml')).result()
begin begin
require 'rspec/core/rake_task' require 'rspec/core/rake_task'
...@@ -17,28 +14,13 @@ rescue LoadError ...@@ -17,28 +14,13 @@ rescue LoadError
# no rspec available # no rspec available
end end
Tire.configure do
url YAML.load(application_yaml)['elasticsearch_server']
end
LOG = Logger.new(STDERR) LOG = Logger.new(STDERR)
desc 'Load the environment' desc 'Load the environment'
task :environment do task :environment do
environment = ENV['SINATRA_ENV'] || 'development' # Load all of app.rb, because it is too easy to introduce bugs otherwise where Rake
Sinatra::Base.environment = environment # does not have a fix or config that is added to app.rb.
Mongoid.load!('config/mongoid.yml') require File.dirname(__FILE__) + '/app.rb'
Mongoid.logger.level = Logger::INFO
module CommentService
class << self;
attr_accessor :config;
end
end
CommentService.config = YAML.load(application_yaml)
Dir[File.dirname(__FILE__) + '/lib/**/*.rb'].each { |file| require file }
Dir[File.dirname(__FILE__) + '/models/*.rb'].each { |file| require file }
end end
Dir.glob('lib/tasks/*.rake').each { |r| import r } Dir.glob('lib/tasks/*.rake').each { |r| import r }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment