lib/geordi/settings.rb in geordi-4.1.1 vs lib/geordi/settings.rb in geordi-4.2.0

- old
+ new

@@ -6,11 +6,11 @@ module Geordi class Settings GLOBAL_SETTINGS_FILE_NAME = Util.testing? ? './tmp/global_settings.yml'.freeze : File.join(ENV['HOME'], '.config/geordi/global.yml').freeze LOCAL_SETTINGS_FILE_NAME = Util.testing? ? './tmp/local_settings.yml'.freeze : './.geordi.yml'.freeze - ALLOWED_GLOBAL_SETTINGS = %w[ pivotal_tracker_api_key ].freeze + ALLOWED_GLOBAL_SETTINGS = %w[ pivotal_tracker_api_key auto_update_chromedriver ].freeze ALLOWED_LOCAL_SETTINGS = %w[ use_vnc pivotal_tracker_project_ids ].freeze def initialize read_settings end @@ -23,10 +23,19 @@ def pivotal_tracker_api_key=(value) @global_settings['pivotal_tracker_api_key'] = value save_global_settings end + def auto_update_chromedriver + @global_settings["auto_update_chromedriver"] || false + end + + def auto_update_chromedriver=(value) + @global_settings['auto_update_chromedriver'] = value + save_global_settings + end + # Local settings # They should not be changed by geordi to avoid unexpected diffs, therefore # there are no setters for these settings def use_vnc? @local_settings.fetch('use_vnc', true) @@ -127,10 +136,10 @@ end def inquire_pt_api_key Geordi::Interaction.warn 'Your settings are missing or invalid.' Geordi::Interaction.warn "Please configure your Pivotal Tracker access." - token = Geordi::Interaction.prompt 'Your API key:' + token = Geordi::Interaction.prompt('Your API key:').to_s # Just be sure self.pivotal_tracker_api_key = token puts token end