Sha256: 14c582d68f56ee77ae06bae42b7cca37a3b5974e990d0bebea929b947ae1374f

Contents?: true

Size: 545 Bytes

Versions: 9

Compression:

Stored size: 545 Bytes

Contents

require 'yaml'
require 'render_me_pretty'

module Forger
  class Config < Base
    include Forger::Template

    def initialize(options={})
      super
      @path = options[:path] || "#{Forger.root}/config/#{Forger.env}.yml"
    end

    @@data = nil
    def data
      return @@data if @@data

      text = RenderMePretty.result(@path, context: context)
      @@data = YAML.load(text)
    rescue Errno::ENOENT => e
      puts e.message
      puts "The #{@path} does not exist. Please double check that it exists."
      exit
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
forger-2.0.5 lib/forger/config.rb
forger-2.0.4 lib/forger/config.rb
forger-2.0.3 lib/forger/config.rb
forger-2.0.2 lib/forger/config.rb
forger-2.0.1 lib/forger/config.rb
forger-2.0.0 lib/forger/config.rb
forger-1.6.0 lib/forger/config.rb
forger-1.5.4 lib/forger/config.rb
forger-1.5.3 lib/forger/config.rb