physh_roller 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +7 -0
  3. data/README +1 -0
  4. data/bin/dice +42 -0
  5. data/doc/Object.html +204 -0
  6. data/doc/Output.html +226 -0
  7. data/doc/PhyshRoller.html +140 -0
  8. data/doc/PhyshRoller/DiceRoll.html +498 -0
  9. data/doc/PhyshRoller/Die.html +266 -0
  10. data/doc/created.rid +14 -0
  11. data/doc/doc/created_rid.html +97 -0
  12. data/doc/features/physh_roller/parse_dice_roll_string_feature.html +117 -0
  13. data/doc/features/physh_roller/roll_dice_feature.html +119 -0
  14. data/doc/features/physh_roller/roll_die_feature.html +117 -0
  15. data/doc/images/add.png +0 -0
  16. data/doc/images/arrow_up.png +0 -0
  17. data/doc/images/brick.png +0 -0
  18. data/doc/images/brick_link.png +0 -0
  19. data/doc/images/bug.png +0 -0
  20. data/doc/images/bullet_black.png +0 -0
  21. data/doc/images/bullet_toggle_minus.png +0 -0
  22. data/doc/images/bullet_toggle_plus.png +0 -0
  23. data/doc/images/date.png +0 -0
  24. data/doc/images/delete.png +0 -0
  25. data/doc/images/find.png +0 -0
  26. data/doc/images/loadingAnimation.gif +0 -0
  27. data/doc/images/macFFBgHack.png +0 -0
  28. data/doc/images/package.png +0 -0
  29. data/doc/images/page_green.png +0 -0
  30. data/doc/images/page_white_text.png +0 -0
  31. data/doc/images/page_white_width.png +0 -0
  32. data/doc/images/plugin.png +0 -0
  33. data/doc/images/ruby.png +0 -0
  34. data/doc/images/tag_blue.png +0 -0
  35. data/doc/images/tag_green.png +0 -0
  36. data/doc/images/transparent.png +0 -0
  37. data/doc/images/wrench.png +0 -0
  38. data/doc/images/wrench_orange.png +0 -0
  39. data/doc/images/zoom.png +0 -0
  40. data/doc/index.html +94 -0
  41. data/doc/js/darkfish.js +155 -0
  42. data/doc/js/jquery.js +18 -0
  43. data/doc/js/navigation.js +142 -0
  44. data/doc/js/search.js +94 -0
  45. data/doc/js/search_index.js +1 -0
  46. data/doc/js/searcher.js +228 -0
  47. data/doc/rdoc.css +595 -0
  48. data/doc/table_of_contents.html +98 -0
  49. data/features/physh_roller/parse_dice_roll_string.feature +19 -0
  50. data/features/physh_roller/roll_dice.feature +22 -0
  51. data/features/physh_roller/roll_die.feature +19 -0
  52. data/features/step_definitions/physh_roller/physh_roller_steps.rb +79 -0
  53. data/features/support/env.rb +3 -0
  54. data/lib/physh_roller.rb +2 -0
  55. data/lib/physh_roller/dice_roll.rb +62 -0
  56. data/lib/physh_roller/die.rb +14 -0
  57. data/spec/physh_roller/dice_roll_spec.rb +145 -0
  58. data/spec/physh_roller/die_spec.rb +44 -0
  59. data/spec/spec_helper.rb +3 -0
  60. metadata +133 -0
@@ -0,0 +1,266 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class PhyshRoller::Die - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../index.html">Home</a>
28
+ <a href="../table_of_contents.html#classes">Classes</a>
29
+ <a href="../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+
47
+
48
+ <div id="file-metadata">
49
+ <nav id="file-list-section" class="section">
50
+ <h3 class="section-header">Defined In</h3>
51
+ <ul>
52
+ <li>lib/physh_roller/die.rb
53
+ </ul>
54
+ </nav>
55
+
56
+
57
+ </div>
58
+
59
+ <div id="class-metadata">
60
+
61
+ <nav id="parent-class-section" class="section">
62
+ <h3 class="section-header">Parent</h3>
63
+
64
+ <p class="link"><a href="../Object.html">Object</a>
65
+
66
+ </nav>
67
+
68
+
69
+
70
+ <!-- Method Quickref -->
71
+ <nav id="method-list-section" class="section">
72
+ <h3 class="section-header">Methods</h3>
73
+
74
+ <ul class="link-list">
75
+
76
+ <li ><a href="#method-c-new">::new</a>
77
+
78
+ <li ><a href="#method-i-roll">#roll</a>
79
+
80
+ </ul>
81
+ </nav>
82
+
83
+ </div>
84
+
85
+ <div id="project-metadata">
86
+ <nav id="fileindex-section" class="section project-section">
87
+ <h3 class="section-header">Pages</h3>
88
+
89
+ <ul>
90
+
91
+ <li class="file"><a href="../doc/created_rid.html">created.rid</a>
92
+
93
+ <li class="file"><a href="../features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
94
+
95
+ <li class="file"><a href="../features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
96
+
97
+ <li class="file"><a href="../features/physh_roller/roll_die_feature.html">roll_die.feature</a>
98
+
99
+ </ul>
100
+ </nav>
101
+
102
+ <nav id="classindex-section" class="section project-section">
103
+ <h3 class="section-header">Class and Module Index</h3>
104
+
105
+ <ul class="link-list">
106
+
107
+ <li><a href="../Object.html">Object</a>
108
+
109
+ <li><a href="../Output.html">Output</a>
110
+
111
+ <li><a href="../PhyshRoller.html">PhyshRoller</a>
112
+
113
+ <li><a href="../PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
114
+
115
+ <li><a href="../PhyshRoller/Die.html">PhyshRoller::Die</a>
116
+
117
+ </ul>
118
+ </nav>
119
+
120
+ </div>
121
+ </nav>
122
+
123
+ <div id="documentation">
124
+ <h1 class="class">class PhyshRoller::Die</h1>
125
+
126
+ <div id="description" class="description">
127
+
128
+ </div><!-- description -->
129
+
130
+
131
+
132
+
133
+ <section id="5Buntitled-5D" class="documentation-section">
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <!-- Attributes -->
142
+ <section id="attribute-method-details" class="method-section section">
143
+ <h3 class="section-header">Attributes</h3>
144
+
145
+
146
+ <div id="attribute-i-last_result" class="method-detail">
147
+ <div class="method-heading attribute-method-heading">
148
+ <span class="method-name">last_result</span><span
149
+ class="attribute-access-type">[R]</span>
150
+ </div>
151
+
152
+ <div class="method-description">
153
+
154
+
155
+
156
+ </div>
157
+ </div>
158
+
159
+ <div id="attribute-i-sides_on_die" class="method-detail">
160
+ <div class="method-heading attribute-method-heading">
161
+ <span class="method-name">sides_on_die</span><span
162
+ class="attribute-access-type">[R]</span>
163
+ </div>
164
+
165
+ <div class="method-description">
166
+
167
+
168
+
169
+ </div>
170
+ </div>
171
+
172
+ </section><!-- attribute-method-details -->
173
+
174
+
175
+ <!-- Methods -->
176
+
177
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
178
+ <h3 class="section-header">Public Class Methods</h3>
179
+
180
+
181
+ <div id="method-c-new" class="method-detail ">
182
+
183
+ <div class="method-heading">
184
+ <span class="method-name">new</span><span
185
+ class="method-args">(sides_on_die)</span>
186
+
187
+ <span class="method-click-advice">click to toggle source</span>
188
+
189
+ </div>
190
+
191
+
192
+ <div class="method-description">
193
+
194
+
195
+
196
+
197
+
198
+
199
+ <div class="method-source-code" id="new-source">
200
+ <pre><span class="ruby-comment"># File lib/physh_roller/die.rb, line 5</span>
201
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">sides_on_die</span>)
202
+ <span class="ruby-ivar">@sides_on_die</span> = <span class="ruby-identifier">sides_on_die</span>.<span class="ruby-identifier">to_i</span>
203
+ <span class="ruby-ivar">@last_result</span> = <span class="ruby-value">0</span>
204
+ <span class="ruby-keyword">end</span></pre>
205
+ </div><!-- new-source -->
206
+
207
+ </div>
208
+
209
+
210
+
211
+
212
+ </div><!-- new-method -->
213
+
214
+
215
+ </section><!-- public-class-method-details -->
216
+
217
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
218
+ <h3 class="section-header">Public Instance Methods</h3>
219
+
220
+
221
+ <div id="method-i-roll" class="method-detail ">
222
+
223
+ <div class="method-heading">
224
+ <span class="method-name">roll</span><span
225
+ class="method-args">()</span>
226
+
227
+ <span class="method-click-advice">click to toggle source</span>
228
+
229
+ </div>
230
+
231
+
232
+ <div class="method-description">
233
+
234
+
235
+
236
+
237
+
238
+
239
+ <div class="method-source-code" id="roll-source">
240
+ <pre><span class="ruby-comment"># File lib/physh_roller/die.rb, line 10</span>
241
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">roll</span>
242
+ <span class="ruby-ivar">@last_result</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-ivar">@sides_on_die</span>)
243
+ <span class="ruby-keyword">end</span></pre>
244
+ </div><!-- roll-source -->
245
+
246
+ </div>
247
+
248
+
249
+
250
+
251
+ </div><!-- roll-method -->
252
+
253
+
254
+ </section><!-- public-instance-method-details -->
255
+
256
+ </section><!-- 5Buntitled-5D -->
257
+
258
+ </div><!-- documentation -->
259
+
260
+
261
+ <footer id="validator-badges">
262
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
263
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
264
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
265
+ </footer>
266
+
data/doc/created.rid ADDED
@@ -0,0 +1,14 @@
1
+ Thu, 07 Mar 2013 21:59:02 +1100
2
+ ./doc/created.rid Thu, 07 Mar 2013 21:59:02 +1100
3
+ ./lib/physh_roller.rb Thu, 07 Mar 2013 20:21:07 +1100
4
+ ./lib/physh_roller/dice_roll.rb Thu, 07 Mar 2013 21:10:57 +1100
5
+ ./lib/physh_roller/die.rb Tue, 26 Feb 2013 16:25:06 +1100
6
+ ./spec/spec_helper.rb Tue, 26 Feb 2013 13:25:35 +1100
7
+ ./spec/physh_roller/dice_roll_spec.rb Thu, 07 Mar 2013 21:17:58 +1100
8
+ ./spec/physh_roller/die_spec.rb Tue, 26 Feb 2013 17:24:30 +1100
9
+ ./bin/dice Thu, 07 Mar 2013 21:49:46 +1100
10
+ ./features/step_definitions/physh_roller/physh_roller_steps.rb Thu, 07 Mar 2013 21:19:53 +1100
11
+ ./features/support/env.rb Tue, 26 Feb 2013 17:26:09 +1100
12
+ ./features/physh_roller/roll_dice.feature Wed, 06 Mar 2013 11:12:19 +1100
13
+ ./features/physh_roller/roll_die.feature Tue, 26 Feb 2013 17:30:35 +1100
14
+ ./features/physh_roller/parse_dice_roll_string.feature Mon, 25 Feb 2013 23:31:18 +1100
@@ -0,0 +1,97 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>created.rid - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
21
+
22
+
23
+ <body class="file">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../index.html">Home</a>
28
+ <a href="../table_of_contents.html#classes">Classes</a>
29
+ <a href="../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+
47
+
48
+ <div id="project-metadata">
49
+ <nav id="fileindex-section" class="section project-section">
50
+ <h3 class="section-header">Pages</h3>
51
+
52
+ <ul>
53
+
54
+ <li class="file"><a href="../doc/created_rid.html">created.rid</a>
55
+
56
+ <li class="file"><a href="../features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
57
+
58
+ <li class="file"><a href="../features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
59
+
60
+ <li class="file"><a href="../features/physh_roller/roll_die_feature.html">roll_die.feature</a>
61
+
62
+ </ul>
63
+ </nav>
64
+
65
+ <nav id="classindex-section" class="section project-section">
66
+ <h3 class="section-header">Class and Module Index</h3>
67
+
68
+ <ul class="link-list">
69
+
70
+ <li><a href="../Object.html">Object</a>
71
+
72
+ <li><a href="../Output.html">Output</a>
73
+
74
+ <li><a href="../PhyshRoller.html">PhyshRoller</a>
75
+
76
+ <li><a href="../PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
77
+
78
+ <li><a href="../PhyshRoller/Die.html">PhyshRoller::Die</a>
79
+
80
+ </ul>
81
+ </nav>
82
+
83
+ </div>
84
+ </nav>
85
+
86
+ <div id="documentation" class="description">
87
+
88
+ </div>
89
+
90
+
91
+
92
+ <footer id="validator-badges">
93
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
94
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
95
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
96
+ </footer>
97
+
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>parse_dice_roll_string.feature - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
21
+
22
+
23
+ <body class="file">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../../index.html">Home</a>
28
+ <a href="../../table_of_contents.html#classes">Classes</a>
29
+ <a href="../../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+
47
+
48
+ <div id="project-metadata">
49
+ <nav id="fileindex-section" class="section project-section">
50
+ <h3 class="section-header">Pages</h3>
51
+
52
+ <ul>
53
+
54
+ <li class="file"><a href="../../doc/created_rid.html">created.rid</a>
55
+
56
+ <li class="file"><a href="../../features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
57
+
58
+ <li class="file"><a href="../../features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
59
+
60
+ <li class="file"><a href="../../features/physh_roller/roll_die_feature.html">roll_die.feature</a>
61
+
62
+ </ul>
63
+ </nav>
64
+
65
+ <nav id="classindex-section" class="section project-section">
66
+ <h3 class="section-header">Class and Module Index</h3>
67
+
68
+ <ul class="link-list">
69
+
70
+ <li><a href="../../Object.html">Object</a>
71
+
72
+ <li><a href="../../Output.html">Output</a>
73
+
74
+ <li><a href="../../PhyshRoller.html">PhyshRoller</a>
75
+
76
+ <li><a href="../../PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
77
+
78
+ <li><a href="../../PhyshRoller/Die.html">PhyshRoller::Die</a>
79
+
80
+ </ul>
81
+ </nav>
82
+
83
+ </div>
84
+ </nav>
85
+
86
+ <div id="documentation" class="description">
87
+
88
+ <p>Feature: Parse String To Dice Roll</p>
89
+
90
+ <pre>As a user
91
+ To create a dice roll
92
+ I want to parse a string in to its components
93
+
94
+ Scenario Outline: parse valid dice roll string
95
+ Given I want to roll some dice
96
+ When I create a new dice roll with the string &quot;&lt;string&gt;&quot;
97
+ Then the number of dice should be &quot;&lt;number_of_dice&gt;&quot;
98
+ And the sides on the dice should be &quot;&lt;sides_on_dice&gt;&quot;
99
+ And the roll modifier should be &quot;&lt;roll_modifier&gt;&quot;
100
+
101
+ Scenarios: different dice strings
102
+ | string | number_of_dice | sides_on_dice | roll_modifier |
103
+ | 1d6 | 1 | 6 | 0 |
104
+ | 3d4 | 3 | 4 | 0 |
105
+ | 1d6+1 | 1 | 6 | 1 |
106
+ | 3d4-2 | 3 | 4 | -2 |</pre>
107
+
108
+ </div>
109
+
110
+
111
+
112
+ <footer id="validator-badges">
113
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
114
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
115
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
116
+ </footer>
117
+