Sha256: 349cd91a9985e63efa59db511665469739ed5dc45097f0a2f1017199be18e289

Contents?: true

Size: 409 Bytes

Versions: 23

Compression:

Stored size: 409 Bytes

Contents

require 'erb'
require 'yaml'

class Ridgepole::Config
  def self.load(config, env = 'development')
    config = if File.exist?(config)
               yaml = ERB.new(File.read(config)).result
               YAML.load(yaml)
             else
               YAML.load(ERB.new(config).result)
             end

    if config.has_key?(env.to_s)
      config.fetch(env.to_s)
    else
      config
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ridgepole-0.5.3.beta lib/ridgepole/cli/config.rb
ridgepole-0.5.2 lib/ridgepole/cli/config.rb
ridgepole-0.5.2.beta6 lib/ridgepole/cli/config.rb
ridgepole-0.5.2.beta5 lib/ridgepole/cli/config.rb
ridgepole-0.5.2.beta4 lib/ridgepole/cli/config.rb
ridgepole-0.5.2.beta3 lib/ridgepole/cli/config.rb
ridgepole-0.5.2.beta2 lib/ridgepole/cli/config.rb
ridgepole-0.5.2.beta lib/ridgepole/cli/config.rb
ridgepole-0.5.1 lib/ridgepole/cli/config.rb
ridgepole-0.5.1.beta3 lib/ridgepole/cli/config.rb
ridgepole-0.5.1.beta2 lib/ridgepole/cli/config.rb
ridgepole-0.5.1.beta lib/ridgepole/cli/config.rb
ridgepole-0.5.0 lib/ridgepole/cli/config.rb
ridgepole-0.5.0.beta lib/ridgepole/cli/config.rb
ridgepole-0.4.12 lib/ridgepole/cli/config.rb
ridgepole-0.4.11.beta lib/ridgepole/cli/config.rb
ridgepole-0.4.10 lib/ridgepole/cli/config.rb
ridgepole-0.4.10.beta lib/ridgepole/cli/config.rb
ridgepole-0.4.9 lib/ridgepole/cli/config.rb
ridgepole-0.4.8 lib/ridgepole/cli/config.rb