class JuzgadorDeArgumentos

encoding: utf-8

Constants

ERRORES_CONOCIDOS

Attributes

full[R]
modo[R]

Public Instance Methods

cual_será_el_nombre_del_proyecto?() click to toggle source
# File lib/cocot/juzgador_de_argumentos.rb, line 65
def cual_será_el_nombre_del_proyecto?
  @nombre_del_proyecto || "Not defined.\n"
end
describime_el_error() click to toggle source
# File lib/cocot/juzgador_de_argumentos.rb, line 55
def describime_el_error
  if hubo_algun_error?
    return ERRORES_CONOCIDOS[@error_presente_en_argumentos]
  end
end
fue_la_ayuda_solicitada?() click to toggle source
# File lib/cocot/juzgador_de_argumentos.rb, line 61
def fue_la_ayuda_solicitada?
  if @ayuda_solicitada then true else false end
end
hubo_algun_error?() click to toggle source
# File lib/cocot/juzgador_de_argumentos.rb, line 51
def hubo_algun_error?
  true if @error_presente_en_argumentos
end
juzgar_argumentos(argumentos) click to toggle source

@param argumentos [Array].

# File lib/cocot/juzgador_de_argumentos.rb, line 11
def juzgar_argumentos(argumentos)
  if argumentos.length.==(0)
    @error_presente_en_argumentos = :ningun_argumento #: Symbol
  elsif argumentos.include?('--help')
    @ayuda_solicitada = true
  else
    # voy a limpiar los argumentos opciones para que me quede(n) el potencial nombre del proyecto
    if(_argumentos = argumentos.select {|i| i[0..1].!=('--')}).length == 1
      @full = \
        if argumentos.include?('--full')
          ::COCOT.salida.escribir("\"Full\" option detected.\n")
          true
        else
          false
        end
      @modo = \
        if argumentos.include?('--rspec-only')
          ::COCOT.salida.escribir("\"RSpec only\" option detected.\n")
          '--rspec-only'
        elsif argumentos.include?('--cucumber-only')
          ::COCOT.salida.escribir("\"Cucumber only\" option detected.\n")
          '--cucumber-only'
        elsif argumentos.include?('--minitest-only')
          ::COCOT.salida.escribir("\"Minitest only\" option detected.\n")
          '--minitest-only'
        elsif argumentos.include?('--clean')
          ::COCOT.salida.escribir("\"Clean\" option detected.\n")
          '--clean'
        else
          ::COCOT.salida.escribir("Attempting to make a normal instalation(RSpec and Cucumber support).\n")
          nil
        end
      @nombre_del_proyecto = _argumentos[0].strip
    else
      @error_presente_en_argumentos = :dos_o_mas_argumentos_como_nombre #: Symbol
    end
  end
end