diff --git a/lib/figaro/sinatra.rb b/lib/figaro/sinatra.rb new file mode 100644 index 0000000..eb14505 --- /dev/null +++ b/lib/figaro/sinatra.rb @@ -0,0 +1,9 @@ +begin + require 'sinatra' +rescue LoadError +else + require 'figaro' + require 'figaro/sinatra/sinatra_app' + Figaro.adapter = Figaro::SinatraApp + Figaro.load +end diff --git a/lib/figaro/sinatra/sinatra_app.rb b/lib/figaro/sinatra/sinatra_app.rb new file mode 100644 index 0000000..37ef754 --- /dev/null +++ b/lib/figaro/sinatra/sinatra_app.rb @@ -0,0 +1,15 @@ + +module Figaro + class SinatraApp < Figaro::Application + private + + def default_path + File.join("config", "application.yml") + end + + def default_environment + ENV['RACK_ENV'] + end + + end +end