lib/eco/cli/config/use_cases.rb in eco-helpers-1.2.1 vs lib/eco/cli/config/use_cases.rb in eco-helpers-1.2.2
- old
+ new
@@ -46,10 +46,13 @@
end
if callback = data[:callback]
unless usecase
# identify usecase
+ params = io.params(keyed: true).merge(type: type)
+ io = io.new(**params, validate: false)
+
usecase = callback.call(*io.params)
unless usecase.is_a?(Eco::API::UseCases::UseCase)
msg = "When adding a usecase, without specifying 'case_name:', "
msg += "the block that integrates usecase for cli option '#{option_case}'"
msg += " must return an Eco::API::UseCases::UseCase object. It returns #{usecase.class}"
@@ -81,16 +84,11 @@
active(io: io).each do |usecase, data|
raise "Something went wrong when scoping active cases" unless data
processed = true
- params = io.params(keyed: true).merge(type: usecase.type)
-
- #if (!io.people || io.people.empty?) && io.class.people_required?(type)
- # params.merge!(people: core_config.people(io: io))
- #end
-
- io.new(**params)
+ params = io.params(keyed: true).merge(type: usecase.type)
+ io = io.new(**params)
if callback = data[:callback]
callback.call(*io.params)
end