Module: Dsu::Support::CommandHookable::ClassMethods

Defined in:
lib/dsu/support/command_hookable.rb

Instance Method Summary collapse

Instance Method Details



36
37
38
39
40
41
# File 'lib/dsu/support/command_hookable.rb', line 36

def display_dsu_footer
  puts apply_theme('_' * 35, theme_color: color_theme.dsu_footer)
  # TODO: I18n.
  puts apply_theme("dsu | Version: #{Dsu::VERSION} | Theme: #{color_theme.theme_name}",
    theme_color: color_theme.dsu_footer)
end

#display_dsu_headerObject



29
30
31
32
33
34
# File 'lib/dsu/support/command_hookable.rb', line 29

def display_dsu_header
  if Dsu.env.screen_shot_mode?
    puts apply_theme('Running screen shot mode!', theme_color: color_theme.warning)
    puts "#{Dsu.env.screen_shot_prompt} dsu #{ARGV.join(' ')}"
  end
end

#start(args = ARGV, options = {}) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/dsu/support/command_hookable.rb', line 20

def start(args = ARGV, options = {})
  display_dsu_header unless suspend_header?(args, options)
  stderror = Services::StderrRedirectorService.call do
    super
  end
  display_errors_if(stderror)
  display_dsu_footer
end