lib/simba/base_app/config/boot.rb in simba-0.0.3 vs lib/simba/base_app/config/boot.rb in simba-0.0.4
- old
+ new
@@ -1,21 +1,27 @@
require "rubygems"
require "bundler"
-#require "bundle gems"
+require "yaml"
+
+# require "bundle gems"
ENV["RACK_ENV"] ||= "development"
Bundler.require(:default, ENV["RACK_ENV"].to_sym)
+
# init database
-DB = Sequel.sqlite("./db/#{ENV["RACK_ENV"]}.db")
+DB = Sequel.connect(YAML.load_file("./config/database.yml")["default"]["url"])
+
# init sinatra
set :sessions, true
set :root, File.expand_path(".")
set :views, settings.root + "/app/views"
+
# sinatra reloader
if development?
require "sinatra/reloader"
also_reload "lib/**/*.rb", "app/{models,helpers}/**/*.rb"
end
+
# assetpack support
assets do
serve "/js", :from => "app/assets/js"
serve "/css", :from => "app/assets/css"
serve "/img", :from => "app/assets/img"
@@ -24,9 +30,10 @@
js_compression :uglify
js :application, ["/js/*.js"]
css :application, ["/css/*.css"]
end
-# require sinatra files
+
+# require project files
Dir.glob "./{lib,app/models,app/helpers,app/controllers}/**/*.rb" do |f|
require f
end