Sha256: 93bdec53e4a1740ad4ed07726cc87b0ef8583b6bca48003aaf52948783e7cc17

Contents?: true

Size: 484 Bytes

Versions: 8

Compression:

Stored size: 484 Bytes

Contents

module Rasti
  class App
    class Settings
      class << self

        def load(environment, options={})
          load_file File.join(Dir.pwd, "#{environment}.yml"), options
        end

        def load_file(filename, options={})
          Hash::Accessible.new(evaluate(File.read(filename), options)).deep_freeze
        end

        private

        def evaluate(yml, options={})
          YAML.load ERB.new(yml).result_with_hash(options)
        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rasti-app-11.0.0 lib/rasti/app/settings.rb
rasti-app-10.0.1 lib/rasti/app/settings.rb
rasti-app-10.0.0 lib/rasti/app/settings.rb
rasti-app-9.0.0 lib/rasti/app/settings.rb
rasti-app-8.0.1 lib/rasti/app/settings.rb
rasti-app-8.0.0 lib/rasti/app/settings.rb
rasti-app-7.1.1 lib/rasti/app/settings.rb
rasti-app-7.1.0 lib/rasti/app/settings.rb