lib/daemonic/configuration.rb in daemonic-0.0.1 vs lib/daemonic/configuration.rb in daemonic-0.0.2

- old
+ new

@@ -4,14 +4,14 @@ module Daemonic class Configuration Invalid = Class.new(ArgumentError) - attr_reader :eventual_config, :args + attr_reader :eventual_config, :given_options - def initialize(args, pwd) - @args = args + def initialize(given_options, pwd) + @given_options = given_options @pwd = pwd @eventual_config = {} end def command @@ -32,13 +32,13 @@ def reload @eventual_config = {} @logger = nil load_options defaults - load_options command_line_options + load_options given_options load_options config_file_options if config_file - load_options command_line_options + load_options given_options logger.debug { to_h.inspect } validate end def working_dir @@ -88,13 +88,9 @@ def load_options(options) options.each do |key, value| self[key] = value end - end - - def command_line_options - CLI.parse(args) end def config_file_options contents = File.open(config_file, 'r:utf-8').read args = Shellwords.split(contents)