class Gdsh::Gdsh

Gdsh Class

Public Instance Methods

clear_screen() click to toggle source
# File lib/gdsh.rb, line 29
def clear_screen
  system('clear') || system('cls')
end
init_shell() click to toggle source
# File lib/gdsh.rb, line 33
def init_shell
  puts_banner
  authorize
  clear_screen
  puts_hint
end
prints_prompt() click to toggle source
# File lib/gdsh.rb, line 40
def prints_prompt
  print 'gdsh> '.colorize(:light_blue)
end
puts_banner() click to toggle source
# File lib/gdsh.rb, line 19
def puts_banner
  puts ''
  puts 'CLI tool to interface with Google Drive'.colorize(:green)
  puts '======================================='.colorize(:green)
end
puts_hint() click to toggle source
# File lib/gdsh.rb, line 25
def puts_hint
  puts 'Hint: type \'help\'.'.colorize(:green)
end
shell() click to toggle source

Command interpreter

# File lib/gdsh.rb, line 47
def shell
  init_shell

  loop do
    prints_prompt
    params = parsed_inputs
    command = next_command(params)
    command.new(@client, params).execute
    break if command.terminal?
  end

  write_session_info_to_file
end