Sha256: 914090f4427132fe820dfa7305fa5d37de2f3bf8d0299561d70bbbb1bf962019

Contents?: true

Size: 366 Bytes

Versions: 11

Compression:

Stored size: 366 Bytes

Contents

class Freighthop::Config
  def self.exist?
    file.exist?
  end

  def self.file
    Freighthop.host_root.join('.freighthop.json')
  end

  def self.config
    @config ||= JSON.parse(file.read)
  end

  def self.fetch(*args)
    config.fetch(*args)
  end

  def self.write(config_hash)
    file.open('w') { |f| f.puts(JSON.pretty_generate(config_hash)) }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
freighthop-0.6.1 lib/freighthop/config.rb
freighthop-0.6.0 lib/freighthop/config.rb
freighthop-0.5.2 lib/freighthop/config.rb
freighthop-0.5.1 lib/freighthop/config.rb
freighthop-0.5.0 lib/freighthop/config.rb
freighthop-0.4.1 lib/freighthop/config.rb
freighthop-0.4.0 lib/freighthop/config.rb
freighthop-0.3.3 lib/freighthop/config.rb
freighthop-0.3.2 lib/freighthop/config.rb
freighthop-0.3.1 lib/freighthop/config.rb
freighthop-0.3.0 lib/freighthop/config.rb