lib/eco/cli/config.rb in eco-helpers-2.5.10 vs lib/eco/cli/config.rb in eco-helpers-2.6.0

- old
+ new

@@ -21,23 +21,23 @@ @opions_set.tap do |opts_set| yield(opts_set, options) if block_given? end end - def input(default_option: nil) + def input(default_option: nil, &block) @input ||= Eco::CLI::Config::Input.new(core_config: self, default_option: default_option) if block_given? - @input.define(&Proc.new) + @input.define(&block) self else @input end end - def people(io: nil) + def people(io: nil, &block) if block_given? - @people_load = Proc.new + @people_load = block self else raise "There is no definition on how to load people" unless instance_variable_defined?(:@people_load) && @people_load unless io && io.is_a?(Eco::API::UseCases::BaseIO) raise "You need to provide Eco::API::UseCases::BaseIO object. Given: #{io.class}" @@ -66,10 +66,9 @@ @usecases ||= Eco::CLI::Config::UseCases.new(core_config: self) @usecases.tap do |cases| yield(cases) if block_given? end end - end end end require_relative 'config/help'