Class: Lighthouse::CLI::Config
- Inherits:
-
Object
- Object
- Lighthouse::CLI::Config
- Defined in:
- lib/lighthouse/cli/config.rb
Class Method Summary collapse
Class Method Details
.save(settings) ⇒ Object
17 18 19 |
# File 'lib/lighthouse/cli/config.rb', line 17 def self.save(settings) File.open("#{File.expand_path('../../../../config/config.yml', __FILE__)}", "w+") {|f| f.write(settings.to_yaml) } end |
.set_api_key(api_key) ⇒ Object
5 6 7 8 9 |
# File 'lib/lighthouse/cli/config.rb', line 5 def self.set_api_key(api_key) settings = CLI_CONFIG settings["api_key"] = api_key save(settings) end |
.set_current_project(project) ⇒ Object
11 12 13 14 15 |
# File 'lib/lighthouse/cli/config.rb', line 11 def self.set_current_project(project) settings = CLI_CONFIG settings["current_project"] = project save(settings) end |