From bb6af8c603390d9bef5cd37154f7066cdc79e0fe Mon Sep 17 00:00:00 2001 From: IgorJorobus Date: Thu, 27 Sep 2018 01:33:00 -0300 Subject: [PATCH] Version 1.1.3 * ReadMe.md is no longer an empty file. Now it contains a title: the project name upcased. * ReadMe.md is now README.md to get adapted to VCS conventions. * Changelog.md is no longer an empty file. Now it has references to "Keep a CHANGELOG" file conventions and you're expected to get adapted to write good and consistent CHANGELOG files following that guideline. * Changelog.md is now CHANGELOG.md to get adapted to VCS conventions. * License.md is now LICENSE.md to get adapted to VCS conventions. * RDoc is pretty much dead and ugly compared to Yard on these days. Yard is supposed to be used now as documenting system. Because of that, it's now included inside any Gemfile as a :development dependency. The RDoc main rake task is now replaced by yard's main rake task. * The Gemfile got updated to separate what is :development dependencies from the :production dependencies. It also replaced rdoc for yard as documenting system dependency. * Better in-code comments. Before everything looked like #comment, now it contains a space before the first comment character, such as the Ruby conventions suggest. --- Changelog.md | 12 ++ Rakefile | 5 + ReadMe.md | 18 +-- data/contenido_de_archivos.cocot | 158 ++++++++++++++++-------- lib/cocot/constructor_de_esqueleto.rb | 8 +- lib/cocot/contenido_de_archivos.rb | 165 +++++++++++++++++--------- 6 files changed, 245 insertions(+), 121 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9c1d5b4..8f05d02 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,15 @@ +1.1.3 +----- + +* ReadMe.md is no longer an empty file. Now it contains a title: the project name upcased. +* ReadMe.md is now README.md to get adapted to VCS conventions. +* Changelog.md is no longer an empty file. Now it has references to "Keep a CHANGELOG" file conventions and you're expected to get adapted to write good and consistent CHANGELOG files following that guideline. +* Changelog.md is now CHANGELOG.md to get adapted to VCS conventions. +* License.md is now LICENSE.md to get adapted to VCS conventions. +* RDoc is pretty much dead and ugly compared to Yard on these days. Yard is supposed to be used now as documenting system. Because of that, it's now included inside any Gemfile as a :development dependency. The RDoc main rake task is now replaced by yard's main rake task. +* The Gemfile got updated to separate what is :development dependencies from the :production dependencies. It also replaced rdoc for yard as documenting system dependency. +* Better in-code comments. Before everything looked like #comment, now it contains a space before the first comment character, such as the Ruby conventions suggest. + 1.1.2 ----- diff --git a/Rakefile b/Rakefile index a7392d0..7e0431d 100644 --- a/Rakefile +++ b/Rakefile @@ -39,4 +39,9 @@ desc 'Genera data/contenido_de_archivos.cocot' task :generar_contenido_de_archivos do require_relative('lib/cocot/salvador_de_contenidos') SalvadorDeContenidos.new.salvar_contenido_de_archivos +end + +desc 'Build gem' +task :build_gem do + system('gem build cocot.gemspec') end \ No newline at end of file diff --git a/ReadMe.md b/ReadMe.md index 69d7c6a..d3ad52d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -32,14 +32,14 @@ Rakefile * `rake cucumber_wip` : same like `cucumber --format progress --color --wip --tags @wip:3`, specially for order * `rake spec` : same like `spec --color` * `rake test` : run minitest tests -* `rake rdoc` : same like `rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output`, create a doc folder with **RDoc** documentation +* `rake yard` : same like `yardoc`, create a doc folder with **Yard** documentation If you pass some option(see below) to the program, the rake task list may be reduced. Options ------- -Version 1.1.0 introduces few nice options: +Version 1.1.0 introduced few nice options: * **--full** Builds these extra-folders: "share", "ext" and "data". If your project is kind of big, you may use them for order. @@ -69,26 +69,20 @@ Standard skeleton spec\ | proyect*\ | spec_helper.rb - Changelog.md + CHANGELOG.md Gemfile Gemfile.lock - License.md + LICENSE.md Rakefile - ReadMe.md + README.md *proyect is replaced by the name of your proyect - -Notes ------ - - Only tested on Windows. Should work in most operative systems. - License ------- -Copyright (c) 2015 cocot +Copyright (c) 2018 cocot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/data/contenido_de_archivos.cocot b/data/contenido_de_archivos.cocot index 55d8bb9..a5455ab 100644 --- a/data/contenido_de_archivos.cocot +++ b/data/contenido_de_archivos.cocot @@ -1,108 +1,168 @@ -{:bin/proyectI"H#!/usr/bin/env ruby +{:bin/proyectI"H#!/usr/bin/env ruby require_relative '../lib/name_of_the_proyect' -:ET:features/support/env.rbI"#if you respect the convention of a Ruby proyect layout then the next lines are fixed +:ET:features/support/env.rbI"# if you respect the convention of a Ruby proyect layout then the next lines are fixed $LOAD_PATH << File.expand_path('../../../lib', __FILE__) require 'name_of_the_proyect' ;T:lib/proyect.rbI" ;T:spec/spec_helper.rbI"%require 'name_of_the_proyect' -;T: GemfileI"csource 'https://rubygems.org' +;T: gemfileI"# ruby '~>2.0' -gem 'rspec' -gem 'cucumber' -gem 'rake' -gem 'rdoc' -gem 'bundler' -;T: rakefileI"C#necessary for minitest tests +source 'https://rubygems.org' + +group :development do + gem 'rspec' + gem 'cucumber' + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end +;T:gemfile_rspec_onlyI"# ruby '~>2.0' + +source 'https://rubygems.org' + +group :development do + gem 'rspec' + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end +;T:gemfile_cucumber_onlyI"# ruby '~>2.0' + +source 'https://rubygems.org' + +group :development do + gem 'cucumber' + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end +;T:gemfile_cleanI"# ruby '~>2.0' + +source 'https://rubygems.org' + +group :development do + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end +;T: rakefileI"]# necessary for minitest tests require 'rake/testtask' -#necessary for cucumber tests +# necessary for cucumber tests require 'cucumber/rake/task' -#necessary for rspec tests +# necessary for rspec tests require 'rspec/core/rake_task' +# necessary for yardoc task +require 'yard' #################TASKS####################### -#to execute minitest tests with `rake test` +# to execute minitest tests with `rake test` Rake::TestTask.new do |t| - #search recursively under the folder test for files called test*. You may have to create the folder manually. + # search recursively under the folder test for files called test*. You may have to create the folder manually. t.pattern = 'test/**/test*.rb' end -#to execute cucumber tests with `rake cucumber` +# to execute cucumber tests with `rake cucumber` Cucumber::Rake::Task.new -#to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios -#remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature +# to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios +# remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature desc 'Executes cucumber wip' task :cucumber_wip do system('cucumber --format progress --color --wip --tags @wip:3') end -#to execute all RSpec tests with `rake spec` +# to execute all RSpec tests with `rake spec` RSpec::Core::RakeTask.new do |t| - #opciones de rspec a correr + # rspec options to run t.rspec_opts = ['--color'] end -desc 'to generate RDoc documentation' -task :rdoc do - system('rdoc --all --tab-width=1 --force-output --main="ReadMe.md" --exclude="bin" --exclude="data" --exclude="ext" --exclude="share" --exclude="doc" --exclude="features" --exclude="spec" --exclude="cocot.gemspec" --exclude="Gemfile" --exclude="Gemfile.lock" --exclude="Rakefile"') -end -;T:rakefile_rspec_onlyI"7#necessary for rspec tests +# generate yard documentation +YARD::Rake::YardocTask.new {|t|} +;T:rakefile_rspec_onlyI"_# necessary for rspec tests require 'rspec/core/rake_task' +# necessary for yardoc task +require 'yard' #################TASKS####################### -#to execute all RSpec tests with `rake spec` +# to execute all RSpec tests with `rake spec` RSpec::Core::RakeTask.new do |t| - #opciones de rspec a correr + # rspec options to run t.rspec_opts = ['--color'] end -desc 'to generate RDoc documentation' -task :rdoc do - system('rdoc --all --tab-width=1 --force-output --main="ReadMe.md" --exclude="bin" --exclude="data" --exclude="ext" --exclude="share" --exclude="doc" --exclude="spec" --exclude="cocot.gemspec" --exclude="Gemfile" --exclude="Gemfile.lock" --exclude="Rakefile"') -end -;T:rakefile_cucumber_onlyI"X#necessary for cucumber tests +# generate yard documentation +YARD::Rake::YardocTask.new {|t|} +;T:rakefile_cucumber_onlyI"# necessary for cucumber tests require 'cucumber/rake/task' +# necessary for yardoc task +require 'yard' #################TASKS####################### -#to execute cucumber tests with `rake cucumber` +# to execute cucumber tests with `rake cucumber` Cucumber::Rake::Task.new -#to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios -#remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature +# to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios +# remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature desc 'Executes cucumber wip' task :cucumber_wip do system('cucumber --format progress --color --wip --tags @wip:3') end -desc 'to generate RDoc documentation' -task :rdoc do - system('rdoc --all --tab-width=1 --force-output --main="ReadMe.md" --exclude="bin" --exclude="data" --exclude="ext" --exclude="share" --exclude="doc" --exclude="features" --exclude="cocot.gemspec" --exclude="Gemfile" --exclude="Gemfile.lock" --exclude="Rakefile"') -end -;T:rakefile_minitest_onlyI"#necessary for minitest tests +# generate yard documentation +YARD::Rake::YardocTask.new {|t|} +;T:rakefile_minitest_onlyI"# necessary for minitest tests require 'rake/testtask' +# necessary for yardoc task +require 'yard' #################TASKS####################### -#to execute minitest tests with `rake test` +# to execute minitest tests with `rake test` Rake::TestTask.new do |t| - #search recursively under the folder test for files called test*. You may have to create the folder manually. + # search recursively under the folder test for files called test*. You may have to create the folder manually. t.pattern = 'test/**/test*.rb' end -desc 'to generate RDoc documentation' -task :rdoc do - system('rdoc --all --tab-width=1 --force-output --main="ReadMe.md" --exclude="bin" --exclude="data" --exclude="ext" --exclude="share" --exclude="doc" --exclude="test" --exclude="cocot.gemspec" --exclude="Gemfile" --exclude="Gemfile.lock" --exclude="Rakefile"') -end -;T:rakefile_cleanI"]#################TASKS####################### +# generate yard documentation +YARD::Rake::YardocTask.new {|t|} +;T:rakefile_cleanI"# necessary for yardoc task +require 'yard' -desc 'to generate RDoc documentation' -task :rdoc do - system('rdoc --all --tab-width=1 --force-output --main="ReadMe.md" --exclude="bin" --exclude="data" --exclude="ext" --exclude="share" --exclude="doc" --exclude="cocot.gemspec" --exclude="Gemfile" --exclude="Gemfile.lock" --exclude="Rakefile"') -end +#################TASKS####################### + +# generate yard documentation +YARD::Rake::YardocTask.new {|t|} +;TI"README.md;TI"## name_of_the_project_upcased +;TI"CHANGELOG.md;TI"D# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.0] - current_date +### Added +- Pristine version. ;T \ No newline at end of file diff --git a/lib/cocot/constructor_de_esqueleto.rb b/lib/cocot/constructor_de_esqueleto.rb index 06af2de..db7352f 100644 --- a/lib/cocot/constructor_de_esqueleto.rb +++ b/lib/cocot/constructor_de_esqueleto.rb @@ -11,7 +11,7 @@ class ConstructorDeEsqueleto SUBCARPETAS_CUCUMBER = %w{features features/support features/step_definitions} SUBCARPETAS_MINITEST = %w{test} SUBCARPETAS_FULL = %w{data share ext} - ARCHIVOS = %w{Changelog.md Gemfile Gemfile.lock License.md Rakefile ReadMe.md bin/proyect lib/proyect.rb} + ARCHIVOS = %w{CHANGELOG.md Gemfile Gemfile.lock LICENSE.md Rakefile README.md bin/proyect lib/proyect.rb} ARCHIVOS_RSPEC = %w{spec/spec_helper.rb} ARCHIVOS_CUCUMBER = %w{features/support/env.rb} @@ -58,7 +58,6 @@ def crear_subcarpetas when nil crear_subcarpetas!(SUBCARPETAS_RSPEC) crear_subcarpetas!(SUBCARPETAS_CUCUMBER) - else end # chequeo si el usuario quiere las carpetas extras if ::COCOT.juzgador_de_argumentos.full then crear_subcarpetas!(SUBCARPETAS_FULL) end @@ -103,7 +102,10 @@ def escribir_archivos if(File.exist?(_nombre_del_archivo)) # existe, lo escribo File.open(_nombre_del_archivo, 'w+') do |archivo| - archivo.write(contenido.gsub('name_of_the_proyect', @nombre_del_proyecto)) + content_to_write = contenido.gsub('name_of_the_proyect', @nombre_del_proyecto) + content_to_write.gsub!('name_of_the_project_upcased', @nombre_del_proyecto.upcase) + content_to_write.gsub!('current_date', Time.now.strftime('%Y-%m-%d')) + archivo.write(content_to_write) end end end diff --git a/lib/cocot/contenido_de_archivos.rb b/lib/cocot/contenido_de_archivos.rb index b36025d..ef7b7fd 100644 --- a/lib/cocot/contenido_de_archivos.rb +++ b/lib/cocot/contenido_de_archivos.rb @@ -13,7 +13,7 @@ module COCOT; end COCOT::CONTENIDO_DE_ARCHIVOS[:'features/support/env.rb'] = \ <2.0' + source 'https://rubygems.org' -gem 'rspec' -gem 'cucumber' -gem 'rake' -gem 'rdoc' -gem 'bundler' +group :development do + gem 'rspec' + gem 'cucumber' + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end STR COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_rspec_only] = \ <2.0' + source 'https://rubygems.org' -gem 'rspec' -gem 'rake' -gem 'rdoc' -gem 'bundler' +group :development do + gem 'rspec' + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end STR COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_cucumber_only] = \ <2.0' + source 'https://rubygems.org' -gem 'cucumber' -gem 'rake' -gem 'rdoc' -gem 'bundler' +group :development do + gem 'cucumber' + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end STR COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_clean] = \ <2.0' + source 'https://rubygems.org' -gem 'rake' -gem 'rdoc' -gem 'bundler' +group :development do + gem 'rake' + gem 'bundler' + gem 'yard' +end + +group :production do + +end STR COCOT::CONTENIDO_DE_ARCHIVOS[:rakefile] = \ <