RPSrb 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/RPSrb.gemspec +2 -1
  3. data/bin/RPSrb +1 -1
  4. data/doc/RPSrb.html +112 -0
  5. data/doc/RockPaperScissors.html +310 -0
  6. data/doc/created.rid +4 -0
  7. data/doc/css/fonts.css +167 -0
  8. data/doc/css/rdoc.css +590 -0
  9. data/doc/fonts/Lato-Light.ttf +0 -0
  10. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  11. data/doc/fonts/Lato-Regular.ttf +0 -0
  12. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  13. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  14. data/doc/fonts/SourceCodePro-Regular.ttf +0 -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 +83 -0
  41. data/doc/js/darkfish.js +161 -0
  42. data/doc/js/jquery.js +4 -0
  43. data/doc/js/navigation.js +142 -0
  44. data/doc/js/navigation.js.gz +0 -0
  45. data/doc/js/search.js +109 -0
  46. data/doc/js/search_index.js +1 -0
  47. data/doc/js/search_index.js.gz +0 -0
  48. data/doc/js/searcher.js +229 -0
  49. data/doc/js/searcher.js.gz +0 -0
  50. data/doc/table_of_contents.html +63 -0
  51. data/lib/RPSrb/Version.rb +2 -1
  52. data/lib/RockPaperScissors.rb +13 -4
  53. metadata +49 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c86ca7727e606a609d4e96df5deed39e1924254f
4
- data.tar.gz: c3357b2bcba9d8f46f35d4debde5b257b5f09684
3
+ metadata.gz: 498556016d62416fcf414e7c7b3df1bc994cb5ec
4
+ data.tar.gz: beeed6e953ba191bbc11dbb7939aa269d384b39f
5
5
  SHA512:
6
- metadata.gz: cec6a7660054b2384c65134df52986f26a838efca0de8d1ed63cdcd7e58a372225b17555e7073f9af027fffcf8a244681099120004d4b3ec206c9c92df9a946b
7
- data.tar.gz: 2fc02aa5c712e0d2aea8a0a46321bd818576e9f042596efa1224fe503c509eded890acad7d18176592168dd8488b13fc9f478da09a9a8585bc6bf24e7fb03c7d
6
+ metadata.gz: 2504a8fd73c747684e7aa6717567bb3768b09b746cd9aafcb557fa1c2adba35e8081f319e74a7efbdee24a5bb1aced2dba330beab5f1902da21c6b00e4fe5a3b
7
+ data.tar.gz: 96e057d3862d783d60b556c115bd116a61b514407f4a682144e5b7ddd94d63ac9e8b5aa629f71e710732174e656f6d6497854b769d061f9d6931bae77c48b17a
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "RPSrb"
3
- spec.version = "0.0.4"
3
+ spec.version = "0.0.5"
4
4
  spec.date = "2017-12-11" # format: YYYY/MM/DD
5
5
  spec.summary = "A Rock Paper Scissors Game RubyGem"
6
6
  spec.description = <<-EOF
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.license = "MIT"
20
20
  spec.required_ruby_version = ">= 2.0.0"
21
21
  spec.required_rubygems_version = ">= 2.6.0"
22
+ spec.homepage = "https://rubygems.org/gems/RPSrb"
22
23
  spec.extra_rdoc_files = ["README.md"]
23
24
  spec.bindir = "bin"
24
25
  spec.executables << "RPSrb"
data/bin/RPSrb CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/ruby
2
2
 
3
3
  # $LOAD_PATH.unshift(".")
4
4
 
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>module RPSrb - RPSrb RDocs</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
12
+ </script>
13
+
14
+ <script src="./js/jquery.js"></script>
15
+ <script src="./js/darkfish.js"></script>
16
+
17
+ <link href="./css/fonts.css" rel="stylesheet">
18
+ <link href="./css/rdoc.css" rel="stylesheet">
19
+
20
+
21
+
22
+ <body id="top" role="document" class="module">
23
+ <nav role="navigation">
24
+ <div id="project-navigation">
25
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
26
+ <h2>
27
+ <a href="./index.html" rel="home">Home</a>
28
+ </h2>
29
+
30
+ <div id="table-of-contents-navigation">
31
+ <a href="./table_of_contents.html#pages">Pages</a>
32
+ <a href="./table_of_contents.html#classes">Classes</a>
33
+ <a href="./table_of_contents.html#methods">Methods</a>
34
+ </div>
35
+ </div>
36
+
37
+ <div id="search-section" role="search" class="project-section initially-hidden">
38
+ <form action="#" method="get" accept-charset="utf-8">
39
+ <div id="search-field-wrapper">
40
+ <input id="search-field" role="combobox" aria-label="Search"
41
+ aria-autocomplete="list" aria-controls="search-results"
42
+ type="text" name="search" placeholder="Search" spellcheck="false"
43
+ title="Type to search, Up and Down to navigate, Enter to load">
44
+ </div>
45
+
46
+ <ul id="search-results" aria-label="Search Results"
47
+ aria-busy="false" aria-expanded="false"
48
+ aria-atomic="false" class="initially-hidden"></ul>
49
+ </form>
50
+ </div>
51
+
52
+ </div>
53
+
54
+
55
+
56
+ <div id="class-metadata">
57
+
58
+
59
+
60
+
61
+
62
+ </div>
63
+ </nav>
64
+
65
+ <main role="main" aria-labelledby="module-RPSrb">
66
+ <h1 id="module-RPSrb" class="module">
67
+ module RPSrb
68
+ </h1>
69
+
70
+ <section class="description">
71
+
72
+ <p>version constant for RubyGem</p>
73
+
74
+ </section>
75
+
76
+
77
+
78
+
79
+ <section id="5Buntitled-5D" class="documentation-section">
80
+
81
+
82
+
83
+
84
+
85
+ <section class="constants-list">
86
+ <header>
87
+ <h3>Constants</h3>
88
+ </header>
89
+ <dl>
90
+
91
+ <dt id="VERSION">VERSION
92
+
93
+ <dd>
94
+
95
+
96
+ </dl>
97
+ </section>
98
+
99
+
100
+
101
+
102
+
103
+ </section>
104
+ </main>
105
+
106
+
107
+ <footer id="validator-badges" role="contentinfo">
108
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
109
+ <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
110
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
111
+ </footer>
112
+
@@ -0,0 +1,310 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class RockPaperScissors - RPSrb RDocs</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
12
+ </script>
13
+
14
+ <script src="./js/jquery.js"></script>
15
+ <script src="./js/darkfish.js"></script>
16
+
17
+ <link href="./css/fonts.css" rel="stylesheet">
18
+ <link href="./css/rdoc.css" rel="stylesheet">
19
+
20
+
21
+
22
+ <body id="top" role="document" class="class">
23
+ <nav role="navigation">
24
+ <div id="project-navigation">
25
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
26
+ <h2>
27
+ <a href="./index.html" rel="home">Home</a>
28
+ </h2>
29
+
30
+ <div id="table-of-contents-navigation">
31
+ <a href="./table_of_contents.html#pages">Pages</a>
32
+ <a href="./table_of_contents.html#classes">Classes</a>
33
+ <a href="./table_of_contents.html#methods">Methods</a>
34
+ </div>
35
+ </div>
36
+
37
+ <div id="search-section" role="search" class="project-section initially-hidden">
38
+ <form action="#" method="get" accept-charset="utf-8">
39
+ <div id="search-field-wrapper">
40
+ <input id="search-field" role="combobox" aria-label="Search"
41
+ aria-autocomplete="list" aria-controls="search-results"
42
+ type="text" name="search" placeholder="Search" spellcheck="false"
43
+ title="Type to search, Up and Down to navigate, Enter to load">
44
+ </div>
45
+
46
+ <ul id="search-results" aria-label="Search Results"
47
+ aria-busy="false" aria-expanded="false"
48
+ aria-atomic="false" class="initially-hidden"></ul>
49
+ </form>
50
+ </div>
51
+
52
+ </div>
53
+
54
+
55
+
56
+ <div id="class-metadata">
57
+
58
+ <div id="parent-class-section" class="nav-section">
59
+ <h3>Parent</h3>
60
+
61
+
62
+ <p class="link">Object
63
+
64
+ </div>
65
+
66
+
67
+
68
+ <!-- Method Quickref -->
69
+ <div id="method-list-section" class="nav-section">
70
+ <h3>Methods</h3>
71
+
72
+ <ul class="link-list" role="directory">
73
+
74
+ <li ><a href="#method-c-continue">::continue</a>
75
+
76
+ <li ><a href="#method-c-new">::new</a>
77
+
78
+ <li ><a href="#method-i-play">#play</a>
79
+
80
+ </ul>
81
+ </div>
82
+
83
+ </div>
84
+ </nav>
85
+
86
+ <main role="main" aria-labelledby="class-RockPaperScissors">
87
+ <h1 id="class-RockPaperScissors" class="class">
88
+ class RockPaperScissors
89
+ </h1>
90
+
91
+ <section class="description">
92
+
93
+ </section>
94
+
95
+
96
+
97
+
98
+ <section id="5Buntitled-5D" class="documentation-section">
99
+
100
+
101
+
102
+
103
+
104
+ <section class="constants-list">
105
+ <header>
106
+ <h3>Constants</h3>
107
+ </header>
108
+ <dl>
109
+
110
+ <dt id="CHOICES">CHOICES
111
+
112
+ <dd><p>make choices constant (2d list)</p>
113
+
114
+
115
+ <dt id="COMPUTER_CHOICES">COMPUTER_CHOICES
116
+
117
+ <dd><p>define possible computer choices</p>
118
+
119
+
120
+ <dt id="LOSERS">LOSERS
121
+
122
+ <dd><p>map array for losers</p>
123
+
124
+
125
+ <dt id="NTRY_TO_SYM">NTRY_TO_SYM
126
+
127
+ <dd><p>define an entry to symbol dictionary</p>
128
+
129
+
130
+ <dt id="VALID_ENTRIES">VALID_ENTRIES
131
+
132
+ <dd><p>define what our valid entries out</p>
133
+
134
+
135
+ <dt id="WINNERS">WINNERS
136
+
137
+ <dd><p>define winners 2d array</p>
138
+
139
+
140
+ </dl>
141
+ </section>
142
+
143
+
144
+
145
+
146
+
147
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
148
+ <header>
149
+ <h3>Public Class Methods</h3>
150
+ </header>
151
+
152
+
153
+ <div id="method-c-new" class="method-detail ">
154
+
155
+ <div class="method-heading">
156
+ <span class="method-name">new</span><span
157
+ class="method-args">()</span>
158
+
159
+ <span class="method-click-advice">click to toggle source</span>
160
+
161
+ </div>
162
+
163
+
164
+ <div class="method-description">
165
+
166
+ <p>define constructor for class</p>
167
+
168
+
169
+
170
+
171
+ <div class="method-source-code" id="new-source">
172
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 47</span>
173
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
174
+ <span class="ruby-ivar">@player_score</span> = <span class="ruby-ivar">@computer_score</span> = <span class="ruby-ivar">@ties</span> = <span class="ruby-value">0</span>
175
+ <span class="ruby-keyword">end</span></pre>
176
+ </div>
177
+
178
+ </div>
179
+
180
+
181
+
182
+
183
+ </div>
184
+
185
+
186
+ </section>
187
+
188
+ <section id="protected-class-5Buntitled-5D-method-details" class="method-section">
189
+ <header>
190
+ <h3>Protected Class Methods</h3>
191
+ </header>
192
+
193
+
194
+ <div id="method-c-continue" class="method-detail ">
195
+
196
+ <div class="method-heading">
197
+ <span class="method-name">continue</span><span
198
+ class="method-args">(str1,str2,str3)</span>
199
+
200
+ <span class="method-click-advice">click to toggle source</span>
201
+
202
+ </div>
203
+
204
+
205
+ <div class="method-description">
206
+
207
+ <p>define entry point for game</p>
208
+
209
+
210
+
211
+
212
+ <div class="method-source-code" id="continue-source">
213
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 35</span>
214
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">continue</span>(<span class="ruby-identifier">str1</span>,<span class="ruby-identifier">str2</span>,<span class="ruby-identifier">str3</span>)
215
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">str1</span>
216
+ <span class="ruby-identifier">print</span> <span class="ruby-identifier">str2</span>
217
+ <span class="ruby-identifier">gets</span>
218
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">str3</span>
219
+ <span class="ruby-keyword">end</span></pre>
220
+ </div>
221
+
222
+ </div>
223
+
224
+
225
+
226
+
227
+ </div>
228
+
229
+
230
+ </section>
231
+
232
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
233
+ <header>
234
+ <h3>Public Instance Methods</h3>
235
+ </header>
236
+
237
+
238
+ <div id="method-i-play" class="method-detail ">
239
+
240
+ <div class="method-heading">
241
+ <span class="method-name">play</span><span
242
+ class="method-args">(winning_score)</span>
243
+
244
+ <span class="method-click-advice">click to toggle source</span>
245
+
246
+ </div>
247
+
248
+
249
+ <div class="method-description">
250
+
251
+ <p>define play game method</p>
252
+
253
+
254
+
255
+
256
+ <div class="method-source-code" id="play-source">
257
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 53</span>
258
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">play</span>(<span class="ruby-identifier">winning_score</span>)
259
+ <span class="ruby-keyword">while</span> <span class="ruby-ivar">@player_score</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">winning_score</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@computer_score</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">winning_score</span>
260
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\nPlayer score: #{@player_score}, &quot;</span> <span class="ruby-operator">+</span>
261
+ <span class="ruby-node">&quot;Computer score: #{@computer_score}, Ties: #{@ties}.\n&quot;</span>
262
+ <span class="ruby-identifier">player</span> = <span class="ruby-identifier">player_choice</span>
263
+ <span class="ruby-identifier">computer</span> = <span class="ruby-constant">COMPUTER_CHOICES</span>.<span class="ruby-identifier">sample</span> <span class="ruby-comment"># chooses a random option</span>
264
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\nPlayer chooses #{player.to_s.downcase}.&quot;</span>
265
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Computer chooses #{computer.to_s.downcase}.\n&quot;</span>
266
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">player_outcome</span> [<span class="ruby-identifier">player</span>, <span class="ruby-identifier">computer</span>]
267
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:WIN</span>
268
+ <span class="ruby-identifier">printf</span> <span class="ruby-string">&quot;\n%s beats %s, player wins the round. \n\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">player</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">capitalize</span>, <span class="ruby-identifier">computer</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>]
269
+ <span class="ruby-ivar">@player_score</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
270
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:LOSE</span>
271
+ <span class="ruby-identifier">printf</span> <span class="ruby-string">&quot;\n%s beats %s, computer wins the round.\n\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">computer</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">capitalize</span>, <span class="ruby-identifier">player</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>]
272
+ <span class="ruby-ivar">@computer_score</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
273
+ <span class="ruby-keyword">else</span>
274
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\nTie, choose again\n&quot;</span>
275
+ <span class="ruby-ivar">@ties</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
276
+ <span class="ruby-keyword">end</span>
277
+ <span class="ruby-keyword">end</span>
278
+ <span class="ruby-identifier">printf</span> <span class="ruby-string">&quot;\nFinal score:\nplayer: %i, computer: %i; (ties: %i).\n\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@player_score</span>, <span class="ruby-ivar">@computer_score</span>, <span class="ruby-ivar">@ties</span>]
279
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">final_outcome</span>(<span class="ruby-ivar">@player_score</span>, <span class="ruby-ivar">@computer_score</span>)
280
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:WIN</span>
281
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\nPlayer wins!\n&quot;</span>
282
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:LOSE</span>
283
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\nComputer wins!\n&quot;</span>
284
+ <span class="ruby-keyword">end</span>
285
+ <span class="ruby-identifier">print</span> <span class="ruby-string">&quot;\n[press the enter/return key to exit game]&quot;</span>
286
+ <span class="ruby-identifier">gets</span>
287
+ <span class="ruby-identifier">puts</span>
288
+ <span class="ruby-keyword">end</span></pre>
289
+ </div>
290
+
291
+ </div>
292
+
293
+
294
+
295
+
296
+ </div>
297
+
298
+
299
+ </section>
300
+
301
+ </section>
302
+ </main>
303
+
304
+
305
+ <footer id="validator-badges" role="contentinfo">
306
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
307
+ <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
308
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
309
+ </footer>
310
+