kata 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,211 +1,83 @@
1
- # Kata
2
-
3
- A kata is defined as an exercise in programming which helps hone your skills
4
- through practice and repetition. Authoring katas is done in blogs but you can't
5
- really test yourself. This gem provides a DSL to author the kata and administer
6
- it as a test providing feedback for evaluation. It also provides basic github
7
- repo setup so that you can chart solution progress over time.
8
-
9
- ## Authoring a Kata
1
+ ## Kata
10
2
 
11
- The inspiration for this gem came from my friend Nick Hengeveld
3
+ A kata is defined as an exercise in programming which helps hone your skills through practice and
4
+ repetition. Authoring katas is done in blogs but you can't really test yourself. This gem provides a
5
+ DSL to author the kata and administer it as a test providing feedback for evaluation. It also
6
+ provides basic github repo setup so that you can chart solution progress over time.
12
7
 
13
- Authoring a kata is as simple as installing this gem and creating a ruby file
14
- much like an RSpec test as illustrated below:
8
+ The inspiration for this gem came from my friend [Nick Hengeveld](https://github.com/nhengeveld)
15
9
 
16
- kata "String Calculator" do
17
- requirement "Create an add method that will accept two digits as arguments" do
18
- example "invoking with 1 and 2 returns 3"
19
- example "invoking with 5 only returns 5"
20
- example "invoking with no arguments returns 0"
21
- end
22
- requirement "Modify the add method to access multple digits as arguments" do
23
- example "invoking with 1 and 2 and 3 returns 6"
24
- example "invoking with 1 and 2 and 3 and 4 and 5 returns 15"
25
- end
26
- context "sub" do
27
- requirement "Create a sub method that will accept two digits as arguments" do
28
- detail "Negative numbers are not allowed"
29
- detail "Digits must range from 0-9"
30
- example "9-6 = 3"
31
- end
32
- requirement "Modify the sub method to access multple digits as arguments" do
33
- example "9-6-3 = 0"
34
- end
35
- end
36
- end
10
+ ### Installation
37
11
 
38
- There are five methods that can be used to author a kata that have a hierarchy
39
- illustrated below:
12
+ It is up on rubygems.org so add it to your project bundle:
40
13
 
41
- 1. kata
42
- 2. context
43
- 3. requirement
44
- 4. detail
45
- 5. example
14
+ gem kata
46
15
 
47
- 1. The **kata()** method sets up the test to administer and starts the clock running.
48
- It takes 2 arguments:
16
+ or do it the old fashioned way and install the gem manually:
49
17
 
50
- * *string* - The name of the kata that will be displayed when taking it as well as
51
- being used in creating the parent directory of the github repo during setup.
52
- * *&block* - A ruby block that includes calls to *context()* or *requirement()*
53
-
54
- 1. The **context()** method allows for grouping of requirements with 2 arguments:
55
-
56
- * *string* - A description of the provided context
57
- * *&block* - A ruby block consisting of a call to *requirement()*
58
-
59
- this method call is optional and not required to define a kata.
60
-
61
- 1. The **requirement()** method is the heart of a kata as it is used to provide the
62
- business rules that the code should provide solutions to. It follows the same
63
- pattern of the other methods with 2 arguments:
64
-
65
- * *string* - A description of the requirement that the code implementing the
66
- kata should meet
67
- * *&block* - A ruby block consisting of calls to *detail()* or *example()*
68
-
69
- 1. The **detail()** method takes a single argument allowing for further defintion
70
- of a requirement. This method can be called repeatedly in a block.
71
-
72
- * *string* - A description of the detail of requirement
73
-
74
- 1. The **example()** method takes a single argument allowing for illustration of
75
- examples of the requirement in practice
76
-
77
- * *string* - An example that will help illustrate the requirement in practice
78
-
79
- ## Setting up a Kata
80
-
81
- To setup a minimal github repo you must first already have a github account and
82
- git installed on your machine. To build a kata repo simply use the setup
83
- command:
84
-
85
- wesbailey@feynman:~/scratch-1.9.0> kata setup sample.rb
86
- Creating github repo...complete
87
- creating files for repo and initializing...done
88
- You can now change directories to my_first-2011-03-17-225948 and take your kata
89
-
90
- Looking in that directory you can see what files have been created:
91
-
92
- .rspec
93
- README
94
- lib
95
- lib/my_first.rb
96
- spec
97
- spec/my_first_spec.rb
98
- spec/spec_helper.rb
99
- spec/support
100
- spec/support/helpers
101
- spec/support/matchers
102
- spec/support/matchers/my_first.rb
103
-
104
- For the files that are generated you will see the following default contents:
105
-
106
- *.rspec*
107
-
108
- --color --format d
109
-
110
- *README*
111
-
112
- Leveling up my ruby awesomeness!
113
-
114
- *lib/my_first.rb*
115
-
116
- class MyFirst
117
- end
118
-
119
- *spec/my_first_spec.rb*
120
-
121
- require 'spec_helper'
122
- require 'my_first'
123
-
124
- describe MyFirst do
125
- describe "new" do
126
- it "should instantiate" do
127
- lambda {
128
- MyFirst.new
129
- }.should_not raise_exception
130
- end
131
- end
132
- end
133
-
134
- *spec/spec_helper.rb*
135
-
136
- $: << '.' << File.join(File.dirname(__FILE__), '..', 'lib')
137
-
138
- require 'rspec'
139
-
140
- Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
141
-
142
- *spec/support/matchers/my_first.rb*
18
+ gem install kata
143
19
 
144
- RSpec::Matchers.define :your_method do |expected|
145
- match do |your_match|
146
- #your_match.method_on_object_to_execute == expected
147
- end
148
- end
20
+ ### Usage
149
21
 
150
- Following TDD the first test has been written and passes:
22
+ NAME
23
+ kata - Ruby kata management
151
24
 
152
- wesbailey@feynman:~/katas/my_first-2011-03-17-225948> rspec spec/
25
+ SYNOPSIS
26
+ kata [COMMAND] [ARGS]
153
27
 
154
- MyFirst
155
- new
156
- should instantiate
28
+ DESCRIPTION
29
+ The kata gem allows one to manage their personal development in the
30
+ practice of writing code through repitition.
157
31
 
158
- Finished in 0.0005 seconds
159
- 1 example, 0 failures
32
+ PRIMARY COMMANDS
33
+ kata setup [--no-repo] [--language=option] file
34
+ Setup a github repo for the kata development session.
160
35
 
161
- With rspec configured you can also run autotest if you have it installed.
162
-
163
- ## Administering a Kata
36
+ --no-repo - Add the directory tree and files to the current repo if possible
37
+ --language=option - Define the programming language for the directory tree that is built
38
+ file - Path to the code kata source file for the practice session
164
39
 
165
- Running the kata from the command line yields:
40
+ kata take file
41
+ Start a kata development session
166
42
 
167
- wesbailey@feynman:~/katas> kata take stringcalculator.rb
168
- String Calculator Kata
169
- Create an add method that will accept two digits as arguments
170
- - detail: invoking with 1 and 2 returns 3
171
- - detail: invoking with 1 returns 1
172
- - detail: invoking with no arguments returns 0
173
- - example: "1,2" sums to 3
43
+ kata version
44
+ Current installed version number
174
45
 
175
- continue (Y|n):
46
+ kata help
47
+ This usage message
176
48
 
177
- At this point you should go into your setup and start coding until this
178
- requirement is completed. Once it is then enter and the next requirement will
179
- appear as illustrated below:
49
+ ### [Wiki](https://github.com/wbailey/kata/wiki)
180
50
 
181
- Modify the add method to access multple digits as arguments
182
- - example: "1,2,3" sums to 6
183
- - example: "1,2,3,4,5" sums to 15
51
+ The [Wiki](https://github.com/wbailey/kata/wiki) has all of the documentation necessary for getting you started.
184
52
 
185
- continue (Y|n):
53
+ ### DSL Reference
186
54
 
187
- The process continues until all of the requirements have been coded. The
188
- kata will keep track of the ammount of time it takes for you to complete coding.
55
+ * kata(string, &block)
56
+ * context(string, &block)
57
+ * requirement(string, &block)
58
+ * detail(string)
59
+ * example(string)
189
60
 
190
- ## Completing the Kata
61
+ ### Contributors
191
62
 
192
- After completing the requirements of the kata continue and the report is
193
- displayed:
63
+ Wes Bailey ([Exposing Gotchas](http://exposinggotchas.blogspot.com/ "Exposing Gotchas"))
194
64
 
195
- Congratulations!
196
- - Create an add method that will accept two digits as arguments 00:02:02
197
- - Modify the add method to access multple digits as arguments 00:00:45
198
- ---------------------------------------------------------------------- --------
199
- Total Time taking Calculator kata: 00:02:47
200
-
65
+ ### License
201
66
 
202
- ## Installing Kata
67
+ Copyright (c) 2011-2012 Wes Bailey
203
68
 
204
- It is up on rubygems.org so add it to your bundle or do it the old fashioned
205
- way with:
69
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
70
+ associated documentation files (the "Software"), to deal in the Software without restriction,
71
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
72
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
73
+ furnished to do so, subject to the following conditions:
206
74
 
207
- gem install kata
75
+ The above copyright notice and this permission notice shall be included in all copies or substantial
76
+ portions of the Software.
208
77
 
209
- ## Contributions
78
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
79
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
80
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
81
+ OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
82
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
210
83
 
211
- Wes Bailey ([Exposing Gotchas](http://exposinggotchas.blogspot.com/ "Exposing Gotchas"))
data/bin/kata CHANGED
@@ -16,9 +16,12 @@ DESCRIPTION
16
16
  practice of writing code through repitition.
17
17
 
18
18
  PRIMARY COMMANDS
19
- kata setup file [repository]
20
- Setup a github repo for the kata development session. Use a repository
21
- if it is provided and do not create a new one
19
+ kata setup [--no-repo] [--language=option] file
20
+ Setup a github repo for the kata development session.
21
+
22
+ --no-repo - Add the directory tree and files to the current repo if possible
23
+ --language=option - Define the programming language for the directory tree that is built
24
+ file - Path to the code kata source file for the practice session
22
25
 
23
26
  kata take file
24
27
  Start a kata development session
@@ -39,8 +39,8 @@ require 'spec_helper'
39
39
  require '#{use_kata_name}'
40
40
 
41
41
  describe #{class_name} do
42
- describe "new" do
43
- it "should instantiate" do
42
+ describe "#initialize" do
43
+ it "instantiates" do
44
44
  expect {
45
45
  #{class_name}.new
46
46
  }.should_not raise_exception
data/lib/kata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kata
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kata
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-11 00:00:00.000000000 Z
13
+ date: 2012-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
17
- requirement: &2168560200 !ruby/object:Gem::Requirement
17
+ requirement: &2151828020 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.0.0
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2168560200
25
+ version_requirements: *2151828020
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: command_line_reporter
28
- requirement: &2168559680 !ruby/object:Gem::Requirement
28
+ requirement: &2151826140 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 3.2.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2168559680
36
+ version_requirements: *2151826140
37
37
  description: This DSL provides an easy way for you to write a code kata for pairing
38
38
  exercises or individual testing
39
39
  email: baywes@gmail.com
@@ -68,9 +68,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
68
  - - ! '>='
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
- segments:
72
- - 0
73
- hash: -448375996502687545
74
71
  required_rubygems_version: !ruby/object:Gem::Requirement
75
72
  none: false
76
73
  requirements: