Class: Nicht::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/nicht/settings.rb

Constant Summary collapse

FILENAME =
'~/.nichtrc'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Settings

Returns a new instance of Settings.



5
6
7
# File 'lib/nicht/settings.rb', line 5

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

Instance Method Details

#get_pathObject



9
10
11
12
13
14
# File 'lib/nicht/settings.rb', line 9

def get_path
  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