module InfinumSetup::Program::Helpers

Public Instance Methods

execute(cmd) click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 38
def execute(cmd)
  prompt.warn cmd if options.verbose
  puts `#{cmd}`
end
execute_command(cmd = command) click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 30
def execute_command(cmd = command)
  options.simulate ? simulate(cmd) : execute(cmd)
end
install_question() click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 26
def install_question
  "Install #{name}"
end
prompt_installing() click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 8
def prompt_installing
  prompt.ok "#{name} -- Installing"
end
prompt_post_install_comment() click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 12
def prompt_post_install_comment
  prompt.say("#{name} -- #{post_install_comment}", color: :cyan) if post_install_comment
end
prompt_pre_install_comment() click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 4
def prompt_pre_install_comment
  prompt.say("#{name} -- #{pre_install_comment}", color: :cyan) if pre_install_comment
end
simulate(cmd) click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 34
def simulate(cmd)
  prompt.warn "#{name} -- #{cmd}"
end
skip_install?() click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 22
def skip_install?
  !mandatory? && options.interactive && !prompt.yes?(install_question)
end
will_install?() click to toggle source
# File lib/infinum_setup/program/helpers.rb, line 16
def will_install?
  mandatory? ||
    (!mandatory? && options.interactive) ||
    (!mandatory? && !options.interactive && install_if_not_interactive?)
end