class LazyNavigator::Opener

Constants

ACCEPT
STANDART_MSG
WEATHER

Public Class Methods

lead(path:, ide: nil, command: STANDART_MSG) click to toggle source
# File lib/entities/opener.rb, line 8
def lead(path:, ide: nil, command: STANDART_MSG)
  ask_question
  return unless yes?

  Dir.chdir(path) do
    system "gnome-terminal -- sh -c '#{command};#{WEATHER}; bash'"
    system ide if ide
  end
end

Private Class Methods

ask_question() click to toggle source
# File lib/entities/opener.rb, line 24
def ask_question
  puts ('continue last project? '.cyan + "#{'y'.green}/#{'n'.magenta}".blink.bold).italic
end
yes?() click to toggle source
# File lib/entities/opener.rb, line 20
def yes?
  gets.chomp.downcase == ACCEPT
end