Sha256: 7af033562c51b20461496a67ab0c029b91abc6a4e2dd5a969a692e7238d83675

Contents?: true

Size: 422 Bytes

Versions: 15

Compression:

Stored size: 422 Bytes

Contents

# frozen_string_literal: true

class Fcom::ConfigFileOptions
  prepend MemoWise

  def initialize
    @options =
      if config_file_exists?
        YAML.load_file(config_file_path)
      else
        {}
      end
  end

  def repo
    @options['repo']
  end

  private

  memo_wise \
  def config_file_path
    "#{ENV.fetch('PWD')}/.fcom.yml"
  end

  def config_file_exists?
    File.exist?(config_file_path)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fcom-0.14.1 lib/fcom/config_file_options.rb
fcom-0.14.0 lib/fcom/config_file_options.rb
fcom-0.13.0 lib/fcom/config_file_options.rb
fcom-0.12.1 lib/fcom/config_file_options.rb
fcom-0.12.0 lib/fcom/config_file_options.rb
fcom-0.11.0 lib/fcom/config_file_options.rb
fcom-0.10.0 lib/fcom/config_file_options.rb
fcom-0.9.0 lib/fcom/config_file_options.rb
fcom-0.8.0 lib/fcom/config_file_options.rb
fcom-0.7.1 lib/fcom/config_file_options.rb
fcom-0.7.0 lib/fcom/config_file_options.rb
fcom-0.6.0 lib/fcom/config_file_options.rb
fcom-0.5.1 lib/fcom/config_file_options.rb
fcom-0.5.0 lib/fcom/config_file_options.rb
fcom-0.4.3 lib/fcom/config_file_options.rb