lib/nutrella/configuration.rb in nutrella-1.5.1 vs lib/nutrella/configuration.rb in nutrella-1.5.2
- old
+ new
@@ -7,20 +7,21 @@
# Knows the location and format of the configuration.
#
class Configuration
NULOGY_ORGANIZATION_ID = "542d76ac2fad4697c3e80448"
- INITIAL_CONFIGURATION = <<-YAML.strip_heredoc
+ INITIAL_CONFIGURATION = <<~YAML
# Trello Developer API Keys
key: <your developer key>
secret: <your developer secret>
token: <your developer token>
# Optional Configuration
organization: #{NULOGY_ORGANIZATION_ID}
launch_command: open $url$
- enable_trello_app: False
+ enable_trello_app: false
+ enable_logging: false
YAML
attr_reader :path, :values
def self.values(path)
@@ -33,18 +34,19 @@
load_configuration unless configuration_missing?
end
private
- def load_configuration
+ def load_configuration # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
@values = {
key: configuration.fetch("key"),
secret: configuration.fetch("secret"),
token: configuration.fetch("token"),
organization: configuration.fetch("organization", NULOGY_ORGANIZATION_ID),
launch_command: configuration.fetch("launch_command", "open $url$"),
- enable_trello_app: configuration.fetch("enable_trello_app", "False")
+ enable_trello_app: configuration.fetch("enable_trello_app", "false"),
+ enable_logging: configuration.fetch("enable_logging", "false")
}
rescue => e
abort "#{path} #{e}"
end
@@ -62,10 +64,10 @@
def write_initial_configuration
File.write(path, INITIAL_CONFIGURATION)
end
def configuration_missing_message
- <<-TEXT.strip_heredoc
+ <<~TEXT
I see that you don't have a config file '#{path}'.
So, I created one for you.
You still need to enter your Trello API keys into the config file.