class InstallGemLocal::Action

Public Class Methods

till_copy() click to toggle source
# File lib/install_gem_local/action.rb, line 18
def till_copy
  till_install
  copy_gem
end
till_install() click to toggle source
# File lib/install_gem_local/action.rb, line 12
def till_install
  remove_gem
  build_gem
  install_gem
end

Private Class Methods

file_names() click to toggle source
# File lib/install_gem_local/action.rb, line 29
def file_names
  file = tty_command.run('find -type f -name "*.gem"')
  file.entries
end
multiple_version_selection(include_all: false, title_interpol: '') click to toggle source
# File lib/install_gem_local/action.rb, line 34
def multiple_version_selection(include_all: false, title_interpol: '')
  options =
    include_all ? { '*' => { 'value' => 'all', 'display' => 'All Versions' } } : {}
  file_names.each_with_index do |file_name, index|
    options[('a'..'z').to_a[index]] = { 'value' => file_name, 'display' => file_name }
  end
  options['/'] = { 'value' => 'exit', 'display' => 'Exit' }
  InstallGemLocal::Helper.prompt_options(
    flash_message: InstallGemLocal::Helper.flash_message(title: "Choose Version #{title_interpol}"),
    options: options
  )
end
tty_command() click to toggle source
# File lib/install_gem_local/action.rb, line 25
def tty_command
  @tty_command ||= TTY::Command.new(uuid: false, printer: :quiet)
end