added options.rb where (for now only) RACK_ENV is defined

This commit is contained in:
Gwenhael Le Moine 2014-07-27 22:09:23 +02:00
parent 9f2ea4913d
commit 52e8f2fd92
3 changed files with 6 additions and 1 deletions

2
app.rb
View file

@ -2,7 +2,7 @@
require 'json'
Bundler.require( :default, :development ) # require tout les gems définis dans Gemfile
Bundler.require( :default, ENV[ 'RACK_ENV' ].to_sym ) # require tout les gems définis dans Gemfile
require_relative './lib/ledger'

View file

@ -1,11 +1,13 @@
# encoding: utf-8
require_relative 'config/options'
require_relative './app'
configure :development do
Sinatra::Application.reset!
use Rack::Reloader
end
use Rack::Rewrite do
rewrite %r{^/(.*(css|js|ttf|woff|html|png|jpg|jpeg|gif)$)}, '/app/$1'
end

3
config/options.rb Normal file
View file

@ -0,0 +1,3 @@
# encoding: utf-8
ENV[ 'RACK_ENV' ] = 'development'