Skip to content

Commit

Permalink
Version 1.1.2
Browse files Browse the repository at this point in the history
* Fixed some misspelling on feedback.
* Fixed issue in Gemfile generated. Even when you chosen --clean option, Gemfile tried to require rspec and cucumber gems, not anymore.
  • Loading branch information
damian-m-g committed Jun 5, 2015
1 parent 469209c commit 46964d4
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.1.2
-----

* Fixed some misspelling on feedback.
* Fixed issue in Gemfile generated. Even when you chosen --clean option, Gemfile tried to require rspec and cucumber gems, not anymore.

1.1.1
-----

Expand Down
2 changes: 1 addition & 1 deletion lib/cocot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
warn(trace)
end
warn('###############################################################################################')
warn('Please provide me with this message in https://github.com/IgorJorobus/cocot/issues , thank you.')
warn('Please provide me with this message at https://github.com/IgorJorobus/cocot/issues , thank you.')
warn('###############################################################################################')
end
2 changes: 1 addition & 1 deletion lib/cocot/cocot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def construir_esqueleto
@constructor_de_esqueleto = ConstructorDeEsqueleto.new
#si la siguiente acción tiene éxito devuelve true, de otra forma false, lo cual quiere decir que hubo un problema
if @constructor_de_esqueleto.construir_esqueleto(@nombre_del_proyecto)
@salida.escribir("Structure builded. Have fun developing! :)\n")
@salida.escribir("Structure built. Have fun developing! :)\n")
true
else
@salida.escribir(@constructor_de_esqueleto.explicar_inconveniente)
Expand Down
23 changes: 19 additions & 4 deletions lib/cocot/constructor_de_esqueleto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def construir_esqueleto(nombre_del_proyecto)
if !(existe_carpeta_de_mismo_nombre_que_este_proyecto_en_el_directorio_actual?)
crear_carpeta_del_proyecto()
else
@inconveniente = "Skeletal structure can't be build. There's an existing folder in the working directory called #{@nombre_del_proyecto}.\n"
@inconveniente = "Skeletal structure can't be built. There's an existing folder in the working directory called #{@nombre_del_proyecto}.\n"
return false
end
#me voy a pasar a la carpeta creada
Expand Down Expand Up @@ -107,8 +107,8 @@ def escribir_archivos
end
end
end
# por ultimo escribo el Rakefile
File.open('Rakefile', 'w+') do |archivo|
# re-escribo el Rakefile
File.open('Rakefile', 'w') do |archivo|
case ::COCOT.juzgador_de_argumentos.modo
when '--rspec-only'
archivo.write(@contenido_de_archivos[:rakefile_rspec_only])
Expand All @@ -122,14 +122,29 @@ def escribir_archivos
archivo.write(@contenido_de_archivos[:rakefile])
end
end
# re-escribo el Gemfile
File.open('Gemfile', 'w') do |archivo|
case ::COCOT.juzgador_de_argumentos.modo
when '--rspec-only'
archivo.write(@contenido_de_archivos[:gemfile_rspec_only])
when '--cucumber-only'
archivo.write(@contenido_de_archivos[:gemfile_cucumber_only])
when '--minitest-only'
archivo.write(@contenido_de_archivos[:gemfile_clean])
when '--clean'
archivo.write(@contenido_de_archivos[:gemfile_clean])
else
archivo.write(@contenido_de_archivos[:gemfile])
end
end
end

def existe_carpeta_de_mismo_nombre_que_este_proyecto_en_el_directorio_actual?
Dir.exists?("./#{@nombre_del_proyecto}")
end

def explicar_inconveniente
@inconveniente || "No hubo inconvenientes.\n"
@inconveniente || "No troubles.\n"
end

private
Expand Down
31 changes: 30 additions & 1 deletion lib/cocot/contenido_de_archivos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module COCOT; end
STR

COCOT::CONTENIDO_DE_ARCHIVOS[:'Gemfile'] = \
COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile] = \
<<STR
source 'https://rubygems.org'
Expand All @@ -41,6 +41,35 @@ module COCOT; end
gem 'bundler'
STR

COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_rspec_only] = \
<<STR
source 'https://rubygems.org'
gem 'rspec'
gem 'rake'
gem 'rdoc'
gem 'bundler'
STR

COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_cucumber_only] = \
<<STR
source 'https://rubygems.org'
gem 'cucumber'
gem 'rake'
gem 'rdoc'
gem 'bundler'
STR

COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_clean] = \
<<STR
source 'https://rubygems.org'
gem 'rake'
gem 'rdoc'
gem 'bundler'
STR

COCOT::CONTENIDO_DE_ARCHIVOS[:rakefile] = \
<<STR
#necessary for minitest tests
Expand Down
2 changes: 1 addition & 1 deletion lib/cocot/juzgador_de_argumentos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ def fue_la_ayuda_solicitada?
end

def cual_será_el_nombre_del_proyecto?
@nombre_del_proyecto || "No fue definido.\n"
@nombre_del_proyecto || "Not defined.\n"
end
end

0 comments on commit 46964d4

Please sign in to comment.