Sha256: 40c3b9478550a169e98c16306d3de80cb8e4ef62bf8a7cbf0d1d45b2d6347ab7

Contents?: true

Size: 665 Bytes

Versions: 4

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

require 'socket'

module Chamber
module Integrations
module Sinatra
  def self.registered(app)
    app.configure do |inner_app|
      env  = inner_app.environment || ENV['RACK_ENV']
      root = inner_app.root

      if defined?(Padrino)
        env  = Padrino.env  if Padrino.respond_to?(:env)
        root = Padrino.root if Padrino.respond_to?(:root)
      end

      Chamber.load(
                    basepath:   root,
                    namespaces: {
                      environment: -> { env },
                      hostname:    -> { Socket.gethostname },
                    },
                  )
    end
  end
end
end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chamber-2.12.3 lib/chamber/integrations/sinatra.rb
chamber-2.12.2 lib/chamber/integrations/sinatra.rb
chamber-2.12.1 lib/chamber/integrations/sinatra.rb
chamber-2.12.0 lib/chamber/integrations/sinatra.rb