Sha256: 8ee5cbf24e10baa9911efe92be286523ac2dd99cfba942b41f50711bfeee1b33

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

module InstallGemLocal
  class Navigation
    class << self
      def start
        options = {
          "a" => {"value" => 'remove', "display" => 'Remove old version'},
          "b" => {"value" => 'build', "display" => 'Build new version'},
          "c" => {"value" => 'install', "display" => 'Install new version'},
          "d" => {"value" => 'copy_gem', "display" => 'Copy gem to folder'},
          "e" => {"value" => 'till_install', "display" => 'Remove old version, build and install the new version'},
          "f" => {"value" => 'till_copy', "display" => 'Remove old version, build, install and copy the new version'},
          "/" => {"value" => "exit", "display" => "Exit"}
        }

        selection = Downup::Base.new(flash_message: 'Select Action', options: options).prompt

        ap selection

        case selection
        when 'remove'
          InstallGemLocal::Action.remove_gem
        when 'build'
          InstallGemLocal::Action.build_gem
        when 'install'
          InstallGemLocal::Action.install_gem
        when 'copy_gem'
          InstallGemLocal::Action.copy_gem
        when 'till_install'
          InstallGemLocal::Action.till_install
        when 'till_copy'
          InstallGemLocal::Action.till_copy
        end

      rescue StandardError => e
        ap e
        ap 'Something Wrong! Try again!'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
install_gem_local-0.1.4 lib/install_gem_local/navigation.rb