Sha256: 92b01993ad0c6b8c856b86fabeb89312fc6c68d5dd5016c406610366211c34d5
Contents?: true
Size: 1.09 KB
Versions: 12
Compression:
Stored size: 1.09 KB
Contents
module Meroku module CLI # A session is what is created when user executes the meroku command class Session include Meroku::CLI include Meroku::CLI::Help def initialize(args) processed = process_user_login_command(args.join(' ')) || process_user_other_command(args.join(' ')) || process_admin_command(args.join(' ')) puts "Unknown command #{args.join(' ')}\n\n#{help}" unless processed exit 1 unless processed end def process_user_login_command(arguments) case arguments when /\Asignup/ signup when 'logout' logout when 'login' login end end def process_user_other_command(arguments) case arguments when 'create' create when 'keys:add' keys_add end end def process_admin_command(arguments) case arguments when 'infrastructure spawn' spawn when 'infrastructure despawn' despawn end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems