vendor/gems/bones-2.4.2/lib/bones/app.rb
# Parse the desired user command and run that command object.
#
Parse the desired user command and run that command object.
Parse the desired user command and run that command object .
def run( args )
    cmd_str = args.shift
    cmd = case cmd_str
      when 'create';    CreateCommand.new(@out, @err)
      when 'update';    UpdateCommand.new(@out, @err)
      when 'freeze';    FreezeCommand.new(@out, @err)
      when 'unfreeze';  UnfreezeCommand.new(@out, @err)
      when 'info';      InfoCommand.new(@out, @err)
      when nil, '-h', '--help'
        help
      when '-v', '--version'
        @out.puts "Mr Bones #{::Bones::VERSION}"
        nil
      else
        raise "Unknown command #{cmd_str.inspect}"
      end
    cmd.run args if cmd
  rescue StandardError => err
    @err.puts "ERROR:  While executing bones ... (#{err.class})"
    @err.puts "    #{err.to_s}"
    exit 1
  end
def run ( args ) cmd_str = args . shift cmd = case cmd_str when 'create' ; CreateCommand . new ( @out , @err ) when 'update' ; UpdateCommand . new ( @out , @err ) when 'freeze' ; FreezeCommand . new ( @out , @err ) when 'unfreeze' ; UnfreezeCommand . new ( @out , @err ) when 'info' ; InfoCommand . new ( @out , @err ) when nil , '-h' , '--help' help when '-v' , '--version' @out . puts "Mr Bones #{::Bones::VERSION}" nil else raise "Unknown command #{cmd_str.inspect}" end cmd . run args if cmd rescue StandardError => err @err . puts "ERROR:  While executing bones ... (#{err.class})" @err . puts "    #{err.to_s}" exit 1 end
Parse the desired user command and run that command object.
Parse the desired user command and run that command object .
args