cocot 1.1.0 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c6d11981088f683d5398b64fc35339c81552693c
4
- data.tar.gz: 2ffdc092d790b105ff3576f011cfd95471516ddd
2
+ SHA256:
3
+ metadata.gz: 18326c4e38be9932967307b934c50b3435ae7493dbc9e218aec9e718162fcd31
4
+ data.tar.gz: f8503980ec73d3d46c287a1d07dd0d2dc38d8e4cddb2056292aaadf686755729
5
5
  SHA512:
6
- metadata.gz: ecdeae1041490af69e40828cc5bada0034c5148c80a88523469007f3b3b63a4b6eb8f3a2d60cd0b8197f0de682fa68ebc296f0a8a2b510f08dca344423edb25e
7
- data.tar.gz: 9f906a104cc78fc023f1b91b4a25c7c88f5572dc3d97bdd5d42a25d034a77c107abd51e1b244603bdb110c27f9e71de8467927bc8b5592e0eb6d8ecf546e2166
6
+ metadata.gz: 8a9262a832159fdb4a51952c163623e1b2fb7e15da7028dcc648f80aaa2f7c287e9fa5bb4e6c2f8dda688c7f5423a7d731d14f8ce445142cd8f823b3cc9705f0
7
+ data.tar.gz: f66a630082bec589a5b5c96b54224ed878cb2b5aeb72e980b6eb764d7b1b254a3f5c97fbdaa8e19bb8c7137e4911ce34a96590d9bd2dfc9a641c138a2d97bd2c
data/Changelog.md CHANGED
@@ -1,3 +1,35 @@
1
+ 1.1.4
2
+ -----
3
+
4
+ * Gemfiles requirement for ruby version was updated to "~>3.0".
5
+ * Requires of the bundler gem were dropped from Gemfiles since now it's bundled into Ruby standard libraries.
6
+ * Requires of the rake gem were dropped from Gemfiles since now it's bundled into Ruby standard libraries.
7
+ * Version "0.1.0" in the CHANGELOG was replaced for "Unreleased".
8
+ * Added "Usage" and "Contact" info to the README template.
9
+
10
+ 1.1.3
11
+ -----
12
+
13
+ * ReadMe.md is no longer an empty file. Now it contains a title: the project name upcased.
14
+ * ReadMe.md is now README.md to get adapted to VCS conventions.
15
+ * 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.
16
+ * Changelog.md is now CHANGELOG.md to get adapted to VCS conventions.
17
+ * License.md is now LICENSE.md to get adapted to VCS conventions.
18
+ * 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.
19
+ * The Gemfile got updated to separate what is :development dependencies from the :production dependencies. It also replaced rdoc for yard as documenting system dependency.
20
+ * 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.
21
+
22
+ 1.1.2
23
+ -----
24
+
25
+ * Fixed some misspelling on feedback.
26
+ * Fixed issue in Gemfile generated. Even when you chosen --clean option, Gemfile tried to require rspec and cucumber gems, not anymore.
27
+
28
+ 1.1.1
29
+ -----
30
+
31
+ * Changed :rdoc rake task in Rakefile generated. Documentation now output properly: ignoring cucumber, rspec and minitest code; also ignoring irrelevant folders such as "bin", "data", "doc", "ext" and "share". The only files looked for RDoc on main working directory are "Changelog.md", "License.md" and "ReadMe.md". "ReadMe.md" is now settled as the main content to show when you open "index.html" RDoc generated file.
32
+
1
33
  1.1.0
2
34
  -----
3
35
  * Changed LICENSE.md
data/License.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 cocot
1
+ Copyright (c) 2018 cocot
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
@@ -11,4 +11,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
11
11
  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
12
12
  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
13
13
  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/ReadMe.md CHANGED
@@ -1,104 +1,98 @@
1
- cocot
2
- =====
3
-
4
- Sometimes you have a good 'no-rails' idea, and say for yourself: "what a good idea!", what mostly of the time is followed by "okay, but...I can't, I'm in many proyects and I had to create all the folder and files stuff, have to check out the file convention arragment, will take me 10 minutes, so no". You are lazy and you know it. We are great builders of tools which make our life easy, **cocot** is one of those. **cocot** is a very simple tool that puts you to work in one second, you just have to tell him which will be the name of your proyect and it's done, it creates you the structure of your **BDD/TDD/"free of tests"** proyect.
5
-
6
- It supposes that you...
7
- -----------------------
8
-
9
- may use **RSpec** and/or **Cucumber** and/or **minitest** for **BDD** developing, so it creates the conventional files and folders for work with.
10
-
11
- How can I install it?
12
- -----------------
13
-
14
- By rubygems with `gem install cocot`.
15
-
16
- How can I use it?
17
- -----------------
18
-
19
- `cocot NameOfTheProyect` or `cocot "name of the proyect"`. Will build the skeleton in the current working directory, so be aware of be positioned where you want your proyect to be.
20
-
21
- Gemfile
22
- -------
23
-
24
- If you don't have **RSpec** and **Cucumber** installed on your system(or want to update them) and want to use them you can do it by calling `bundle install` standing on the main folder of your proyect created by **cocot**. If you neither have **bundler** you will need to install it by calling `gem install bundler`.
25
-
26
- Rakefile
27
- --------
28
-
29
- **cocot** packs few pre-defined **rake** tasks on standard mode:
30
-
31
- * `rake cucumber` : same like `cucumber`
32
- * `rake cucumber_wip` : same like `cucumber --format progress --color --wip --tags @wip:3`, specially for order
33
- * `rake spec` : same like `spec --color`
34
- * `rake test` : run minitest tests
35
- * `rake rdoc` : same like `rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output`, create a doc folder with **RDoc** documentation
36
-
37
- If you pass some option(see below) to the program, the rake task list may be reduced.
38
-
39
- Options
40
- -------
41
-
42
- Version 1.1.0 introduces few nice options:
43
-
44
- * **--full** Builds these extra-folders: "share", "ext" and "data". If your project is kind of big, you may use them for order.
45
-
46
- Next ones can be played as solo optionally in conjunction with the above one:
47
-
48
- * **--rspec-only** Builds the standard skeleton minus the folders and files related to Cucumber.
49
- * **--cucumber-only** Builds the standard skeleton minus the folders and files related to RSpec.
50
- * **--minitest-only** Builds the standard skeleton without the support for RSpec and Cucumber and adds the folder "test" with the purpose of placing minitest tests there.
51
- * **--clean** Builds the standard skeleton without the support for RSpec and Cucumber. This option may be fine for very small projects, which will have no unit testing at all.
52
-
53
- Standard skeleton
54
- -----------------
55
-
56
- By default **cocot** builds support for **RSpec** and **Cucumber**:
57
-
58
- <pre>
59
- bin\
60
- | proyect*
61
- doc\
62
- features\
63
- | step_definitions\
64
- | support\
65
- | | env.rb
66
- lib\
67
- | proyect*\
68
- | proyect*.rb
69
- spec\
70
- | proyect*\
71
- | spec_helper.rb
72
- Changelog.md
73
- Gemfile
74
- Gemfile.lock
75
- License.md
76
- Rakefile
77
- ReadMe.md
78
- </pre>
79
-
80
- *proyect is replaced by the name of your proyect
81
-
82
-
83
- NOTES
84
- -----
85
-
86
- Only tested on Windows. Should work in most operative systems.
87
-
88
- License
89
- -------
90
-
91
- Copyright (c) 2015 cocot
92
-
93
- Permission is hereby granted, free of charge, to any person obtaining a copy of
94
- this software and associated documentation files (the "Software"), to deal in
95
- the Software with the rights to use, copy, modify, merge, publish and distribute.
96
- This software can not be sold, can't get money from it. In case you want to
97
- distribute it around please mention the author.
98
-
99
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
101
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
102
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
103
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
104
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ cocot
2
+ =====
3
+
4
+ Sometimes you have a good 'no-rails' idea, and say for yourself: "what a good idea!", what mostly of the time is followed by "okay, but...I can't, I'm in many proyects and I had to create all the folder and files stuff, have to check out the file convention arragment, will take me 10 minutes, so no". You are lazy and you know it. We are great builders of tools which make our life easy, **cocot** is one of those. **cocot** is a very simple tool that puts you to work in one second, you just have to tell him which will be the name of your proyect and it's done, it creates you the structure of your **BDD/TDD/"free of tests"** proyect.
5
+
6
+ It supposes that you...
7
+ -----------------------
8
+
9
+ may use **RSpec** and/or **Cucumber** and/or **minitest** for **BDD/TDD** developing, so it creates the conventional files and folders for work with.
10
+
11
+ How can I install it?
12
+ -----------------
13
+
14
+ By rubygems with `gem install cocot`.
15
+
16
+ How can I use it?
17
+ -----------------
18
+
19
+ `cocot NameOfTheProyect` or `cocot "name of the proyect"`. Will build the skeleton in the current working directory, so be aware of be positioned where you want your proyect to be.
20
+
21
+ Gemfile
22
+ -------
23
+
24
+ If you don't have **RSpec** and **Cucumber** installed on your system(or want to update them) and want to use them you can do it by calling `bundle install` standing on the main folder of your proyect created by **cocot**. If you neither have **bundler** you will need to install it by calling `gem install bundler`.
25
+
26
+ Rakefile
27
+ --------
28
+
29
+ **cocot** packs few pre-defined **rake** tasks on standard mode:
30
+
31
+ * `rake cucumber` : same like `cucumber`
32
+ * `rake cucumber_wip` : same like `cucumber --format progress --color --wip --tags @wip:3`, specially for order
33
+ * `rake spec` : same like `spec --color`
34
+ * `rake test` : run minitest tests
35
+ * `rake yard` : same like `yardoc`, create a doc folder with **Yard** documentation
36
+
37
+ If you pass some option(see below) to the program, the rake task list may be reduced.
38
+
39
+ Options
40
+ -------
41
+
42
+ Version 1.1.0 introduced few nice options:
43
+
44
+ * **--full** Builds these extra-folders: "share", "ext" and "data". If your project is kind of big, you may use them for order.
45
+
46
+ Next ones can be played as solo optionally in conjunction with the above one:
47
+
48
+ * **--rspec-only** Builds the standard skeleton minus the folders and files related to Cucumber.
49
+ * **--cucumber-only** Builds the standard skeleton minus the folders and files related to RSpec.
50
+ * **--minitest-only** Builds the standard skeleton without the support for RSpec and Cucumber and adds the folder "test" with the purpose of placing minitest tests there.
51
+ * **--clean** Builds the standard skeleton without the support for RSpec and Cucumber. This option may be fine for very small projects, which will have no unit testing at all.
52
+
53
+ Standard skeleton
54
+ -----------------
55
+
56
+ By default **cocot** builds support for **RSpec** and **Cucumber**:
57
+
58
+ <pre>
59
+ bin\
60
+ | proyect*
61
+ doc\
62
+ features\
63
+ | step_definitions\
64
+ | support\
65
+ | | env.rb
66
+ lib\
67
+ | proyect*\
68
+ | proyect*.rb
69
+ spec\
70
+ | proyect*\
71
+ | spec_helper.rb
72
+ CHANGELOG.md
73
+ Gemfile
74
+ Gemfile.lock
75
+ LICENSE.md
76
+ Rakefile
77
+ README.md
78
+ </pre>
79
+
80
+ *proyect is replaced by the name of your proyect
81
+
82
+ License
83
+ -------
84
+
85
+ Copyright (c) 2018 cocot
86
+
87
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
88
+ this software and associated documentation files (the "Software"), to deal in
89
+ the Software with the rights to use, copy, modify, merge, publish and distribute.
90
+ This software can not be sold, can't get money from it. In case you want to
91
+ distribute it around please mention the author.
92
+
93
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
95
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
96
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
97
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
98
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,108 +1,168 @@
1
- {:bin/proyectI"H#!/usr/bin/env ruby
1
+ {:bin/proyectI"H#!/usr/bin/env ruby
2
2
 
3
3
  require_relative '../lib/name_of_the_proyect'
4
- :ET:features/support/env.rbI"�#if you respect the convention of a Ruby proyect layout then the next lines are fixed
4
+ :ET:features/support/env.rbI"�# if you respect the convention of a Ruby proyect layout then the next lines are fixed
5
5
  $LOAD_PATH << File.expand_path('../../../lib', __FILE__)
6
6
  require 'name_of_the_proyect'
7
7
  ;T:lib/proyect.rbI"
8
8
  ;T:spec/spec_helper.rbI"%require 'name_of_the_proyect'
9
9
 
10
10
 
11
- ;T: GemfileI"csource 'https://rubygems.org'
11
+ ;T: gemfileI"�# ruby '~>2.0'
12
12
 
13
- gem 'rspec'
14
- gem 'cucumber'
15
- gem 'rake'
16
- gem 'rdoc'
17
- gem 'bundler'
18
- ;T:
13
+ source 'https://rubygems.org'
14
+
15
+ group :development do
16
+ gem 'rspec'
17
+ gem 'cucumber'
18
+ gem 'rake'
19
+ gem 'bundler'
20
+ gem 'yard'
21
+ end
22
+
23
+ group :production do
24
+
25
+ end
26
+ ;T:gemfile_rspec_onlyI"�# ruby '~>2.0'
27
+
28
+ source 'https://rubygems.org'
29
+
30
+ group :development do
31
+ gem 'rspec'
32
+ gem 'rake'
33
+ gem 'bundler'
34
+ gem 'yard'
35
+ end
36
+
37
+ group :production do
38
+
39
+ end
40
+ ;T:gemfile_cucumber_onlyI"�# ruby '~>2.0'
41
+
42
+ source 'https://rubygems.org'
43
+
44
+ group :development do
45
+ gem 'cucumber'
46
+ gem 'rake'
47
+ gem 'bundler'
48
+ gem 'yard'
49
+ end
50
+
51
+ group :production do
52
+
53
+ end
54
+ ;T:gemfile_cleanI"�# ruby '~>2.0'
55
+
56
+ source 'https://rubygems.org'
57
+
58
+ group :development do
59
+ gem 'rake'
60
+ gem 'bundler'
61
+ gem 'yard'
62
+ end
63
+
64
+ group :production do
65
+
66
+ end
67
+ ;T:
19
68
  require 'rake/testtask'
20
- #necessary for cucumber tests
69
+ # necessary for cucumber tests
21
70
  require 'cucumber/rake/task'
22
- #necessary for rspec tests
71
+ # necessary for rspec tests
23
72
  require 'rspec/core/rake_task'
73
+ # necessary for yardoc task
74
+ require 'yard'
24
75
 
25
76
  #################TASKS#######################
26
77
 
27
- #to execute minitest tests with `rake test`
78
+ # to execute minitest tests with `rake test`
28
79
  Rake::TestTask.new do |t|
29
- #search recursively under the folder test for files called test*. You may have to create the folder manually.
80
+ # search recursively under the folder test for files called test*. You may have to create the folder manually.
30
81
  t.pattern = 'test/**/test*.rb'
31
82
  end
32
83
 
33
- #to execute cucumber tests with `rake cucumber`
84
+ # to execute cucumber tests with `rake cucumber`
34
85
  Cucumber::Rake::Task.new
35
86
 
36
- #to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
37
- #remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
87
+ # to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
88
+ # remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
38
89
  desc 'Executes cucumber wip'
39
90
  task :cucumber_wip do
40
91
  system('cucumber --format progress --color --wip --tags @wip:3')
41
92
  end
42
93
 
43
- #to execute all RSpec tests with `rake spec`
94
+ # to execute all RSpec tests with `rake spec`
44
95
  RSpec::Core::RakeTask.new do |t|
45
- #opciones de rspec a correr
96
+ # rspec options to run
46
97
  t.rspec_opts = ['--color']
47
98
  end
48
99
 
49
- desc 'to generate RDoc documentation'
50
- task :rdoc do
51
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
52
- end
53
- ;T:rakefile_rspec_onlyI"#necessary for rspec tests
100
+ # generate yard documentation
101
+ YARD::Rake::YardocTask.new {|t|}
102
+ ;T:rakefile_rspec_onlyI"_# necessary for rspec tests
54
103
  require 'rspec/core/rake_task'
104
+ # necessary for yardoc task
105
+ require 'yard'
55
106
 
56
107
  #################TASKS#######################
57
108
 
58
- #to execute all RSpec tests with `rake spec`
109
+ # to execute all RSpec tests with `rake spec`
59
110
  RSpec::Core::RakeTask.new do |t|
60
- #opciones de rspec a correr
111
+ # rspec options to run
61
112
  t.rspec_opts = ['--color']
62
113
  end
63
114
 
64
- desc 'to generate RDoc documentation'
65
- task :rdoc do
66
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
67
- end
68
- ;T:rakefile_cucumber_onlyI"�#necessary for cucumber tests
115
+ # generate yard documentation
116
+ YARD::Rake::YardocTask.new {|t|}
117
+ ;T:rakefile_cucumber_onlyI"�# necessary for cucumber tests
69
118
  require 'cucumber/rake/task'
119
+ # necessary for yardoc task
120
+ require 'yard'
70
121
 
71
122
  #################TASKS#######################
72
123
 
73
- #to execute cucumber tests with `rake cucumber`
124
+ # to execute cucumber tests with `rake cucumber`
74
125
  Cucumber::Rake::Task.new
75
126
 
76
- #to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
77
- #remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
127
+ # to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
128
+ # remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
78
129
  desc 'Executes cucumber wip'
79
130
  task :cucumber_wip do
80
131
  system('cucumber --format progress --color --wip --tags @wip:3')
81
132
  end
82
133
 
83
- desc 'to generate RDoc documentation'
84
- task :rdoc do
85
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
86
- end
87
- ;T:rakefile_minitest_onlyI"�#necessary for minitest tests
134
+ # generate yard documentation
135
+ YARD::Rake::YardocTask.new {|t|}
136
+ ;T:rakefile_minitest_onlyI"�# necessary for minitest tests
88
137
  require 'rake/testtask'
138
+ # necessary for yardoc task
139
+ require 'yard'
89
140
 
90
141
  #################TASKS#######################
91
142
 
92
- #to execute minitest tests with `rake test`
143
+ # to execute minitest tests with `rake test`
93
144
  Rake::TestTask.new do |t|
94
- #search recursively under the folder test for files called test*. You may have to create the folder manually.
145
+ # search recursively under the folder test for files called test*. You may have to create the folder manually.
95
146
  t.pattern = 'test/**/test*.rb'
96
147
  end
97
148
 
98
- desc 'to generate RDoc documentation'
99
- task :rdoc do
100
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
101
- end
102
- ;T:rakefile_cleanI"�#################TASKS#######################
149
+ # generate yard documentation
150
+ YARD::Rake::YardocTask.new {|t|}
151
+ ;T:rakefile_cleanI"�# necessary for yardoc task
152
+ require 'yard'
103
153
 
104
- desc 'to generate RDoc documentation'
105
- task :rdoc do
106
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
107
- end
154
+ #################TASKS#######################
155
+
156
+ # generate yard documentation
157
+ YARD::Rake::YardocTask.new {|t|}
158
+ ;TI"README.md;TI"## name_of_the_project_upcased
159
+ ;TI"CHANGELOG.md;TI"D# Changelog
160
+ All notable changes to this project will be documented in this file.
161
+
162
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
163
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
164
+
165
+ ## [0.1.0] - current_date
166
+ ### Added
167
+ - Pristine version.
108
168
  ;T
data/lib/cocot/cocot.rb CHANGED
@@ -47,7 +47,7 @@ class Cocot
47
47
  @constructor_de_esqueleto = ConstructorDeEsqueleto.new
48
48
  #si la siguiente acción tiene éxito devuelve true, de otra forma false, lo cual quiere decir que hubo un problema
49
49
  if @constructor_de_esqueleto.construir_esqueleto(@nombre_del_proyecto)
50
- @salida.escribir("Structure builded. Have fun developing! :)\n")
50
+ @salida.escribir("Structure built. Have fun developing! :)\n")
51
51
  true
52
52
  else
53
53
  @salida.escribir(@constructor_de_esqueleto.explicar_inconveniente)
@@ -11,7 +11,7 @@ class ConstructorDeEsqueleto
11
11
  SUBCARPETAS_CUCUMBER = %w{features features/support features/step_definitions}
12
12
  SUBCARPETAS_MINITEST = %w{test}
13
13
  SUBCARPETAS_FULL = %w{data share ext}
14
- ARCHIVOS = %w{Changelog.md Gemfile Gemfile.lock License.md Rakefile ReadMe.md bin/proyect lib/proyect.rb}
14
+ ARCHIVOS = %w{CHANGELOG.md Gemfile Gemfile.lock LICENSE.md Rakefile README.md bin/proyect lib/proyect.rb}
15
15
  ARCHIVOS_RSPEC = %w{spec/spec_helper.rb}
16
16
  ARCHIVOS_CUCUMBER = %w{features/support/env.rb}
17
17
 
@@ -21,7 +21,7 @@ class ConstructorDeEsqueleto
21
21
  if !(existe_carpeta_de_mismo_nombre_que_este_proyecto_en_el_directorio_actual?)
22
22
  crear_carpeta_del_proyecto()
23
23
  else
24
- @inconveniente = "Skeletal structure can't be build. There's an existing folder in the working directory called #{@nombre_del_proyecto}.\n"
24
+ @inconveniente = "Skeletal structure can't be built. There's an existing folder in the working directory called #{@nombre_del_proyecto}.\n"
25
25
  return false
26
26
  end
27
27
  #me voy a pasar a la carpeta creada
@@ -58,7 +58,6 @@ class ConstructorDeEsqueleto
58
58
  when nil
59
59
  crear_subcarpetas!(SUBCARPETAS_RSPEC)
60
60
  crear_subcarpetas!(SUBCARPETAS_CUCUMBER)
61
- else
62
61
  end
63
62
  # chequeo si el usuario quiere las carpetas extras
64
63
  if ::COCOT.juzgador_de_argumentos.full then crear_subcarpetas!(SUBCARPETAS_FULL) end
@@ -103,12 +102,15 @@ class ConstructorDeEsqueleto
103
102
  if(File.exist?(_nombre_del_archivo))
104
103
  # existe, lo escribo
105
104
  File.open(_nombre_del_archivo, 'w+') do |archivo|
106
- archivo.write(contenido.gsub('name_of_the_proyect', @nombre_del_proyecto))
105
+ content_to_write = contenido.gsub('name_of_the_proyect', @nombre_del_proyecto)
106
+ content_to_write.gsub!('name_of_the_project_upcased', @nombre_del_proyecto.upcase)
107
+ content_to_write.gsub!('current_date', Time.now.strftime('%Y-%m-%d'))
108
+ archivo.write(content_to_write)
107
109
  end
108
110
  end
109
111
  end
110
- # por ultimo escribo el Rakefile
111
- File.open('Rakefile', 'w+') do |archivo|
112
+ # re-escribo el Rakefile
113
+ File.open('Rakefile', 'w') do |archivo|
112
114
  case ::COCOT.juzgador_de_argumentos.modo
113
115
  when '--rspec-only'
114
116
  archivo.write(@contenido_de_archivos[:rakefile_rspec_only])
@@ -122,6 +124,21 @@ class ConstructorDeEsqueleto
122
124
  archivo.write(@contenido_de_archivos[:rakefile])
123
125
  end
124
126
  end
127
+ # re-escribo el Gemfile
128
+ File.open('Gemfile', 'w') do |archivo|
129
+ case ::COCOT.juzgador_de_argumentos.modo
130
+ when '--rspec-only'
131
+ archivo.write(@contenido_de_archivos[:gemfile_rspec_only])
132
+ when '--cucumber-only'
133
+ archivo.write(@contenido_de_archivos[:gemfile_cucumber_only])
134
+ when '--minitest-only'
135
+ archivo.write(@contenido_de_archivos[:gemfile_clean])
136
+ when '--clean'
137
+ archivo.write(@contenido_de_archivos[:gemfile_clean])
138
+ else
139
+ archivo.write(@contenido_de_archivos[:gemfile])
140
+ end
141
+ end
125
142
  end
126
143
 
127
144
  def existe_carpeta_de_mismo_nombre_que_este_proyecto_en_el_directorio_actual?
@@ -129,7 +146,7 @@ class ConstructorDeEsqueleto
129
146
  end
130
147
 
131
148
  def explicar_inconveniente
132
- @inconveniente || "No hubo inconvenientes.\n"
149
+ @inconveniente || "No troubles.\n"
133
150
  end
134
151
 
135
152
  private
@@ -13,7 +13,7 @@ STR
13
13
 
14
14
  COCOT::CONTENIDO_DE_ARCHIVOS[:'features/support/env.rb'] = \
15
15
  <<STR
16
- #if you respect the convention of a Ruby proyect layout then the next lines are fixed
16
+ # if you respect the convention of a Ruby proyect layout then the next lines are fixed
17
17
  $LOAD_PATH << File.expand_path('../../../lib', __FILE__)
18
18
  require 'name_of_the_proyect'
19
19
  STR
@@ -30,123 +30,209 @@ require 'name_of_the_proyect'
30
30
 
31
31
  STR
32
32
 
33
- COCOT::CONTENIDO_DE_ARCHIVOS[:'Gemfile'] = \
33
+ COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile] = \
34
34
  <<STR
35
+ # ruby '~>3.0'
36
+
37
+ source 'https://rubygems.org'
38
+
39
+ group :development do
40
+ gem 'rspec'
41
+ gem 'cucumber'
42
+ gem 'rake'
43
+ gem 'yard'
44
+ end
45
+
46
+ group :production do
47
+
48
+ end
49
+ STR
50
+
51
+ COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_rspec_only] = \
52
+ <<STR
53
+ # ruby '~>3.0'
54
+
55
+ source 'https://rubygems.org'
56
+
57
+ group :development do
58
+ gem 'rspec'
59
+ gem 'rake'
60
+ gem 'yard'
61
+ end
62
+
63
+ group :production do
64
+
65
+ end
66
+ STR
67
+
68
+ COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_cucumber_only] = \
69
+ <<STR
70
+ # ruby '~>3.0'
71
+
35
72
  source 'https://rubygems.org'
36
73
 
37
- gem 'rspec'
38
- gem 'cucumber'
39
- gem 'rake'
40
- gem 'rdoc'
41
- gem 'bundler'
74
+ group :development do
75
+ gem 'cucumber'
76
+ gem 'rake'
77
+ gem 'yard'
78
+ end
79
+
80
+ group :production do
81
+
82
+ end
83
+ STR
84
+
85
+ COCOT::CONTENIDO_DE_ARCHIVOS[:gemfile_clean] = \
86
+ <<STR
87
+ # ruby '~>3.0'
88
+
89
+ source 'https://rubygems.org'
90
+
91
+ group :development do
92
+ gem 'rake'
93
+ gem 'yard'
94
+ end
95
+
96
+ group :production do
97
+
98
+ end
42
99
  STR
43
100
 
44
101
  COCOT::CONTENIDO_DE_ARCHIVOS[:rakefile] = \
45
102
  <<STR
46
- #necessary for minitest tests
103
+ # necessary for minitest tests
47
104
  require 'rake/testtask'
48
- #necessary for cucumber tests
105
+ # necessary for cucumber tests
49
106
  require 'cucumber/rake/task'
50
- #necessary for rspec tests
107
+ # necessary for rspec tests
51
108
  require 'rspec/core/rake_task'
109
+ # necessary for yardoc task
110
+ require 'yard'
52
111
 
53
112
  #################TASKS#######################
54
113
 
55
- #to execute minitest tests with `rake test`
114
+ # to execute minitest tests with `rake test`
56
115
  Rake::TestTask.new do |t|
57
- #search recursively under the folder test for files called test*. You may have to create the folder manually.
116
+ # search recursively under the folder test for files called test*. You may have to create the folder manually.
58
117
  t.pattern = 'test/**/test*.rb'
59
118
  end
60
119
 
61
- #to execute cucumber tests with `rake cucumber`
120
+ # to execute cucumber tests with `rake cucumber`
62
121
  Cucumber::Rake::Task.new
63
122
 
64
- #to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
65
- #remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
123
+ # to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
124
+ # remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
66
125
  desc 'Executes cucumber wip'
67
126
  task :cucumber_wip do
68
127
  system('cucumber --format progress --color --wip --tags @wip:3')
69
128
  end
70
129
 
71
- #to execute all RSpec tests with `rake spec`
130
+ # to execute all RSpec tests with `rake spec`
72
131
  RSpec::Core::RakeTask.new do |t|
73
- #opciones de rspec a correr
132
+ # rspec options to run
74
133
  t.rspec_opts = ['--color']
75
134
  end
76
135
 
77
- desc 'to generate RDoc documentation'
78
- task :rdoc do
79
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
80
- end
136
+ # generate yard documentation
137
+ YARD::Rake::YardocTask.new {|t|}
81
138
  STR
82
139
 
83
140
  COCOT::CONTENIDO_DE_ARCHIVOS[:rakefile_rspec_only] = \
84
141
  <<STR
85
- #necessary for rspec tests
142
+ # necessary for rspec tests
86
143
  require 'rspec/core/rake_task'
144
+ # necessary for yardoc task
145
+ require 'yard'
87
146
 
88
147
  #################TASKS#######################
89
148
 
90
- #to execute all RSpec tests with `rake spec`
149
+ # to execute all RSpec tests with `rake spec`
91
150
  RSpec::Core::RakeTask.new do |t|
92
- #opciones de rspec a correr
151
+ # rspec options to run
93
152
  t.rspec_opts = ['--color']
94
153
  end
95
154
 
96
- desc 'to generate RDoc documentation'
97
- task :rdoc do
98
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
99
- end
155
+ # generate yard documentation
156
+ YARD::Rake::YardocTask.new {|t|}
100
157
  STR
101
158
 
102
159
  COCOT::CONTENIDO_DE_ARCHIVOS[:rakefile_cucumber_only] = \
103
160
  <<STR
104
- #necessary for cucumber tests
161
+ # necessary for cucumber tests
105
162
  require 'cucumber/rake/task'
163
+ # necessary for yardoc task
164
+ require 'yard'
106
165
 
107
166
  #################TASKS#######################
108
167
 
109
- #to execute cucumber tests with `rake cucumber`
168
+ # to execute cucumber tests with `rake cucumber`
110
169
  Cucumber::Rake::Task.new
111
170
 
112
- #to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
113
- #remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
171
+ # to execute cucumber wip(work in progress) with 'rake cucumber_wip'. It will kick you if you are working in more than 3 scenarios
172
+ # remember to tag each wip scenarios with @wip above the Scenario keyword in the implicit *.feature
114
173
  desc 'Executes cucumber wip'
115
174
  task :cucumber_wip do
116
175
  system('cucumber --format progress --color --wip --tags @wip:3')
117
176
  end
118
177
 
119
- desc 'to generate RDoc documentation'
120
- task :rdoc do
121
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
122
- end
178
+ # generate yard documentation
179
+ YARD::Rake::YardocTask.new {|t|}
123
180
  STR
124
181
 
125
182
  COCOT::CONTENIDO_DE_ARCHIVOS[:rakefile_minitest_only] = \
126
183
  <<STR
127
- #necessary for minitest tests
184
+ # necessary for minitest tests
128
185
  require 'rake/testtask'
186
+ # necessary for yardoc task
187
+ require 'yard'
129
188
 
130
189
  #################TASKS#######################
131
190
 
132
- #to execute minitest tests with `rake test`
191
+ # to execute minitest tests with `rake test`
133
192
  Rake::TestTask.new do |t|
134
- #search recursively under the folder test for files called test*. You may have to create the folder manually.
193
+ # search recursively under the folder test for files called test*. You may have to create the folder manually.
135
194
  t.pattern = 'test/**/test*.rb'
136
195
  end
137
196
 
138
- desc 'to generate RDoc documentation'
139
- task :rdoc do
140
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
141
- end
197
+ # generate yard documentation
198
+ YARD::Rake::YardocTask.new {|t|}
142
199
  STR
143
200
 
144
201
  COCOT::CONTENIDO_DE_ARCHIVOS[:rakefile_clean] = \
145
202
  <<STR
203
+ # necessary for yardoc task
204
+ require 'yard'
205
+
146
206
  #################TASKS#######################
147
207
 
148
- desc 'to generate RDoc documentation'
149
- task :rdoc do
150
- system('rdoc --all --tab-width=1 --format=darkfish --op=doc --force-output')
151
- end
208
+ # generate yard documentation
209
+ YARD::Rake::YardocTask.new {|t|}
210
+ STR
211
+
212
+ COCOT::CONTENIDO_DE_ARCHIVOS['README.md'] = \
213
+ <<STR
214
+ # name_of_the_project_upcased
215
+
216
+
217
+
218
+ # Usage
219
+
220
+
221
+
222
+ # Contact
223
+
224
+
225
+ STR
226
+
227
+ COCOT::CONTENIDO_DE_ARCHIVOS['CHANGELOG.md'] = \
228
+ <<STR
229
+ # Changelog
230
+ All notable changes to this project will be documented in this file.
231
+
232
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
233
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
234
+
235
+ ## [Unreleased] - current_date
236
+ ### Added
237
+ - Pristine version.
152
238
  STR
@@ -63,6 +63,6 @@ class JuzgadorDeArgumentos
63
63
  end
64
64
 
65
65
  def cual_será_el_nombre_del_proyecto?
66
- @nombre_del_proyecto || "No fue definido.\n"
66
+ @nombre_del_proyecto || "Not defined.\n"
67
67
  end
68
68
  end
data/lib/cocot.rb CHANGED
@@ -25,6 +25,6 @@ rescue => e
25
25
  warn(trace)
26
26
  end
27
27
  warn('###############################################################################################')
28
- warn('Please provide me with this message in https://github.com/IgorJorobus/cocot/issues , thank you.')
28
+ warn('Please provide me with this message at https://github.com/IgorJorobus/cocot/issues , thank you.')
29
29
  warn('###############################################################################################')
30
30
  end
metadata CHANGED
@@ -1,20 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damián M. González
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-12 00:00:00.000000000 Z
11
+ date: 2022-01-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Skeleton builder of a new proyect which could be developed with BDD/TDD.
14
14
  This application build the folders and files needed to start developing fast a new
15
15
  proyect potentially BDD/TDD oriented. For that, it's supposed that will be used
16
- Cucumber and/or RSpec(perhaps also minitest). This have no relationship with Rails.
17
- email:
16
+ Cucumber and/or RSpec(perhaps also minitest).
17
+ email: jorobuslab@gmail.com
18
18
  executables:
19
19
  - cocot
20
20
  extensions: []
@@ -44,7 +44,7 @@ files:
44
44
  - spec/spec_helper.rb
45
45
  homepage: https://github.com/IgorJorobus/cocot
46
46
  licenses:
47
- - cocot
47
+ - MIT
48
48
  metadata: {}
49
49
  post_install_message: You can start to skeletonize your new proyect now!
50
50
  rdoc_options: []
@@ -61,9 +61,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubyforge_project:
65
- rubygems_version: 2.2.3
66
- signing_key:
64
+ rubygems_version: 3.1.2
65
+ signing_key:
67
66
  specification_version: 4
68
67
  summary: Skeleton builder of a new proyect which could be developed with BDD/TDD.
69
68
  test_files: []