Sha256: 75abf9ce634a06309ab3836e6e59bf8e44d1d49452e01b38b366063e94b106de

Contents?: true

Size: 625 Bytes

Versions: 15

Compression:

Stored size: 625 Bytes

Contents

require "config/rack/reloader"

module Config
  # provide helper to register within your Sinatra app
  #
  # set :root, File.dirname(__FILE__)
  # register Config
  #
  def self.registered(app)
    app.configure do |inner_app|

      env = inner_app.environment || ENV["RACK_ENV"]
      root = inner_app.root

      # use Padrino settings if applicable
      if defined?(Padrino)
        env = Padrino.env
        root = Padrino.root
      end

      Config.load_and_set_settings(Config.setting_files(File.join(root, 'config'), env))

      inner_app.use(::Config::Rack::Reloader) if inner_app.development?
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
ef-config-1.4.1 lib/config/integrations/sinatra.rb
config-1.6.1 lib/config/integrations/sinatra.rb
config-1.6.0 lib/config/integrations/sinatra.rb
config-1.5.1 lib/config/integrations/sinatra.rb
config-1.5.0 lib/config/integrations/sinatra.rb
config-1.4.0 lib/config/integrations/sinatra.rb
config-1.3.0 lib/config/integrations/sinatra.rb
config-1.2.1 lib/config/integrations/sinatra.rb
config-1.2.0 lib/config/integrations/sinatra.rb
config-1.1.1 lib/config/integrations/sinatra.rb
config-1.1.0 lib/config/integrations/sinatra.rb
config-1.0.0 lib/config/integration/sinatra.rb
config-1.0.0.beta3 lib/config/integration/sinatra.rb
config-1.0.0.beta2 lib/config/integration/sinatra.rb
config-1.0.0.beta1 lib/config/integration/sinatra.rb