Sha256: 9af705c6a103d29156b197716c6497f94939d44bb25c2470c6798bd2fd98095d

Contents?: true

Size: 405 Bytes

Versions: 4

Compression:

Stored size: 405 Bytes

Contents

# require 'nicht/exceptions'

module Nicht
  class Settings
    FILENAME = '~/.nichtrc'.freeze

    def initialize(path)
      @path = File.expand_path path
    end

    def valid?
      raise Nicht::SettingsNotFound unless File.exist? @path
      projects_path = File.expand_path(File.read(@path))
      raise Nicht::SettingsNotValid unless File.exist? projects_path
      projects_path
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nicht-0.1.4 lib/nicht/settings.rb
nicht-0.1.3 lib/nicht/settings.rb
nicht-0.1.2 lib/nicht/settings.rb
nicht-0.1.1 lib/nicht/settings.rb