class AssistedWorkflow::Output
a helper class to provide custom shell print methods
Public Class Methods
new(shell)
click to toggle source
Calls superclass method
# File lib/assisted_workflow/output.rb, line 5 def initialize(shell) super @shell = shell end
Public Instance Methods
next_command(title, commands) { |_commands| ... }
click to toggle source
# File lib/assisted_workflow/output.rb, line 40 def next_command(title, commands, &block) say title, :green _commands = Array(commands) yield(_commands) if block_given? _commands.each do |command| print_wrapped command, :indent => 2 end end
print_stories(title, stories, options = {})
click to toggle source
prints as table with stories data
# File lib/assisted_workflow/output.rb, line 25 def print_stories(title, stories, options = {}) print_title title rows = stories.map do |story| [story.id, story.current_state, story.owners_str, story.name] end print_table(rows) end
print_story(story)
click to toggle source
# File lib/assisted_workflow/output.rb, line 33 def print_story(story) say "-" * 40 print_wrapped story.name.to_s, :indent => 2 print_wrapped story.description.to_s, :indent => 2 say "-" * 40 end
print_title(title)
click to toggle source
prints a highlighted title section
# File lib/assisted_workflow/output.rb, line 18 def print_title(title) say "-" * title.length, :green say title.upcase, :green say "-" * title.length, :green end
say_comment(comment)
click to toggle source
prints a wrapped gray line, showing as comments between log lines
# File lib/assisted_workflow/output.rb, line 11 def say_comment(comment) @shell.padding = 4 say comment, [:black, :bold] @shell.padding = 0 end