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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bd65d56b15e8b07f5304a75611c81fe6b56693c8
4
+ data.tar.gz: 50558192dc968036a8501395c652273459c451ee
5
+ SHA512:
6
+ metadata.gz: 01dbae2c7915352713459a3933888a642c052cbbb39010c858bb640bbab25396ff5ccf17cf77e056955a2bfd83373da1d1568ce5f1ffc5cca73fc9447b6ee8fa
7
+ data.tar.gz: afab68ad4150fe59dd35873295f4f4c5afea04b3698cc7749f7176c6e0357db126125f469012c5a3e4ca51cf85f3b2f7cdb8f853e1d5e88a8748136eea67181d
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (C) 2013 Kryptyk Fysh
2
+
3
+ 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 the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1 @@
1
+ A simple dice rolling application.
data/bin/dice ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
4
+
5
+ require 'physh_roller'
6
+ require 'optparse'
7
+
8
+ options = {}
9
+
10
+ opt_parse = OptionParser.new do |opts|
11
+ # Banner to display at the top of the
12
+ # help screen.
13
+ opts.banner = "Usage: dice [options] dice_roll_string"
14
+ opts.banner = "dice_roll_string examples: 1d6, 2d4-1, 99D100+1"
15
+
16
+ # Help screen option.
17
+ opts.on('-h', '--help', 'Display this screen') do
18
+ puts opts
19
+ exit
20
+ end
21
+ end
22
+
23
+ opt_parse.parse!
24
+
25
+
26
+ dice_roll_string = ARGV.unshift[0]
27
+
28
+ dice_roll = PhyshRoller::DiceRoll.new(dice_roll_string, $stdout)
29
+ dice_roll.roll_dice
30
+ dice_roll.output_results
31
+
32
+ while true
33
+ puts "Reroll? (Y/N)"
34
+ input = STDIN.gets.chomp.downcase
35
+ if input == 'y'
36
+ dice_roll.roll_dice
37
+ dice_roll.output_results
38
+ else
39
+ puts 'Fine then, be like that.'
40
+ exit
41
+ end
42
+ end
data/doc/Object.html ADDED
@@ -0,0 +1,204 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class Object - 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>features/step_definitions/physh_roller/physh_roller_steps.rb
53
+ <li>spec/spec_helper.rb
54
+ </ul>
55
+ </nav>
56
+
57
+
58
+ </div>
59
+
60
+ <div id="class-metadata">
61
+
62
+ <nav id="parent-class-section" class="section">
63
+ <h3 class="section-header">Parent</h3>
64
+
65
+ <p class="link">BasicObject
66
+
67
+ </nav>
68
+
69
+ <!-- Included Modules -->
70
+ <nav id="includes-section" class="section">
71
+ <h3 class="section-header">Included Modules</h3>
72
+
73
+ <ul class="link-list">
74
+
75
+
76
+ <li><span class="include">RSpec::Matchers</span>
77
+
78
+
79
+ </ul>
80
+ </nav>
81
+
82
+
83
+ <!-- Method Quickref -->
84
+ <nav id="method-list-section" class="section">
85
+ <h3 class="section-header">Methods</h3>
86
+
87
+ <ul class="link-list">
88
+
89
+ <li ><a href="#method-i-output">#output</a>
90
+
91
+ </ul>
92
+ </nav>
93
+
94
+ </div>
95
+
96
+ <div id="project-metadata">
97
+ <nav id="fileindex-section" class="section project-section">
98
+ <h3 class="section-header">Pages</h3>
99
+
100
+ <ul>
101
+
102
+ <li class="file"><a href="./doc/created_rid.html">created.rid</a>
103
+
104
+ <li class="file"><a href="./features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
105
+
106
+ <li class="file"><a href="./features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
107
+
108
+ <li class="file"><a href="./features/physh_roller/roll_die_feature.html">roll_die.feature</a>
109
+
110
+ </ul>
111
+ </nav>
112
+
113
+ <nav id="classindex-section" class="section project-section">
114
+ <h3 class="section-header">Class and Module Index</h3>
115
+
116
+ <ul class="link-list">
117
+
118
+ <li><a href="./Object.html">Object</a>
119
+
120
+ <li><a href="./Output.html">Output</a>
121
+
122
+ <li><a href="./PhyshRoller.html">PhyshRoller</a>
123
+
124
+ <li><a href="./PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
125
+
126
+ <li><a href="./PhyshRoller/Die.html">PhyshRoller::Die</a>
127
+
128
+ </ul>
129
+ </nav>
130
+
131
+ </div>
132
+ </nav>
133
+
134
+ <div id="documentation">
135
+ <h1 class="class">class Object</h1>
136
+
137
+ <div id="description" class="description">
138
+
139
+ </div><!-- description -->
140
+
141
+
142
+
143
+
144
+ <section id="5Buntitled-5D" class="documentation-section">
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+ <!-- Methods -->
154
+
155
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
156
+ <h3 class="section-header">Public Instance Methods</h3>
157
+
158
+
159
+ <div id="method-i-output" class="method-detail ">
160
+
161
+ <div class="method-heading">
162
+ <span class="method-name">output</span><span
163
+ class="method-args">()</span>
164
+
165
+ <span class="method-click-advice">click to toggle source</span>
166
+
167
+ </div>
168
+
169
+
170
+ <div class="method-description">
171
+
172
+
173
+
174
+
175
+
176
+
177
+ <div class="method-source-code" id="output-source">
178
+ <pre><span class="ruby-comment"># File features/step_definitions/physh_roller/physh_roller_steps.rb, line 11</span>
179
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">output</span>
180
+ <span class="ruby-ivar">@output</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Output</span>.<span class="ruby-identifier">new</span>
181
+ <span class="ruby-keyword">end</span></pre>
182
+ </div><!-- output-source -->
183
+
184
+ </div>
185
+
186
+
187
+
188
+
189
+ </div><!-- output-method -->
190
+
191
+
192
+ </section><!-- public-instance-method-details -->
193
+
194
+ </section><!-- 5Buntitled-5D -->
195
+
196
+ </div><!-- documentation -->
197
+
198
+
199
+ <footer id="validator-badges">
200
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
201
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
202
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
203
+ </footer>
204
+
data/doc/Output.html ADDED
@@ -0,0 +1,226 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class Output - 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>features/step_definitions/physh_roller/physh_roller_steps.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-i-messages">#messages</a>
77
+
78
+ <li ><a href="#method-i-puts">#puts</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 Output</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
+
142
+ <!-- Methods -->
143
+
144
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
145
+ <h3 class="section-header">Public Instance Methods</h3>
146
+
147
+
148
+ <div id="method-i-messages" class="method-detail ">
149
+
150
+ <div class="method-heading">
151
+ <span class="method-name">messages</span><span
152
+ class="method-args">()</span>
153
+
154
+ <span class="method-click-advice">click to toggle source</span>
155
+
156
+ </div>
157
+
158
+
159
+ <div class="method-description">
160
+
161
+
162
+
163
+
164
+
165
+
166
+ <div class="method-source-code" id="messages-source">
167
+ <pre><span class="ruby-comment"># File features/step_definitions/physh_roller/physh_roller_steps.rb, line 2</span>
168
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">messages</span>
169
+ <span class="ruby-ivar">@messages</span> = []
170
+ <span class="ruby-keyword">end</span></pre>
171
+ </div><!-- messages-source -->
172
+
173
+ </div>
174
+
175
+
176
+
177
+
178
+ </div><!-- messages-method -->
179
+
180
+
181
+ <div id="method-i-puts" class="method-detail ">
182
+
183
+ <div class="method-heading">
184
+ <span class="method-name">puts</span><span
185
+ class="method-args">(message)</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="puts-source">
200
+ <pre><span class="ruby-comment"># File features/step_definitions/physh_roller/physh_roller_steps.rb, line 6</span>
201
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">puts</span>(<span class="ruby-identifier">message</span>)
202
+ <span class="ruby-identifier">messages</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">message</span>
203
+ <span class="ruby-keyword">end</span></pre>
204
+ </div><!-- puts-source -->
205
+
206
+ </div>
207
+
208
+
209
+
210
+
211
+ </div><!-- puts-method -->
212
+
213
+
214
+ </section><!-- public-instance-method-details -->
215
+
216
+ </section><!-- 5Buntitled-5D -->
217
+
218
+ </div><!-- documentation -->
219
+
220
+
221
+ <footer id="validator-badges">
222
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
223
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
224
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
225
+ </footer>
226
+