Sha256: 9398fc983e0f297fa5c306dd71db7ac5e23fa6034537798d79f15e0436575f5a

Contents?: true

Size: 419 Bytes

Versions: 3

Compression:

Stored size: 419 Bytes

Contents

require 'parseconfig'

module Rebuild
  class Config
    def initialize()
      cfg_file = File.join( Dir.home, '.rbld', 'rebuild.conf' )

      if File.exist?( cfg_file )
        cfg = ParseConfig.new( cfg_file )
        rname = cfg['REMOTE_NAME']
        @remote = rname ? cfg["REMOTE_#{rname}"] : nil
      end
    end

    def remote!
      raise 'Remote not defined' unless @remote
      @remote
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rbld-1.0.2 cli/lib/rbld_config.rb
rbld-1.0.1 cli/lib/rbld_config.rb
rbld-1.0.0 cli/lib/rbld_config.rb