Sha256: c6c9c6be94818b3f95dd6c859b69cf2aa1fdc27bc2f1a1354635062f84dacc3e

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

require 'yaml'

module Bcupgrade
  class ConfigFile
    def initialize
      @file = File.join(ENV['HOME'], '.bcupgrade')
    end

    def load
      if File.exist?(@file)
        YAML.load_file(@file)
      else
        { 'ignore' => [''] }
      end
    end

    def ignored_casks
      load['ignore'].map { |e| e ? e : '' }
    rescue StandardError
      ['']
    end

    def list_ignored_casks
      ignored_casks.join(' ')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bcupgrade-0.9.3 lib/bcupgrade/config_file.rb