Class: Nicht::Settings
- Inherits:
-
Object
- Object
- Nicht::Settings
- Defined in:
- lib/nicht/settings.rb
Constant Summary collapse
- FILENAME =
'~/.nichtrc'.freeze
Instance Method Summary collapse
- #get_path ⇒ Object
-
#initialize(path) ⇒ Settings
constructor
A new instance of Settings.
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. path end |
Instance Method Details
#get_path ⇒ Object
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.(File.read(@path)) raise Nicht::SettingsNotValid unless File.exist? projects_path projects_path end |