Class: Pcli::Services::App

Inherits:
Object
  • Object
show all
Defined in:
lib/pcli/services/app.rb

Instance Method Summary collapse

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pcli/services/app.rb', line 11

def run
  result = nil
  prev_space = false
  steps.all.each.with_index do |step, i|
    break if result&.halt? && !step.ensured?

    output.puts if i.positive? && step.spaced? && !prev_space

    result = step.run(result)

    if i < steps.all.count - 1 && step.spaced?
      prev_space = true
      output.puts
    else
      prev_space = false
    end
  end
end