rpsg 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e03401aa1acdfe9ed7550be15d6f6b936e93dda
4
- data.tar.gz: fb13a9e01381ab8210c09633113781a08851e044
3
+ metadata.gz: cdadc690e76766a28edca57d221f5f5e5ffbea14
4
+ data.tar.gz: 573caea06a86c0922725efb01708a168dbcd74a0
5
5
  SHA512:
6
- metadata.gz: 743d3d4e956fcf8303616f9dbbed1131ec3e12c0b8073baffedf88ec26905c4830048f97d8d95f45aee00034b340789c851fc431a35ddd204f979a1fd4686df9
7
- data.tar.gz: b2309e5b6d8172923f05784c591d96acf7f00450fc754b801f6246f13cf3e5f4f25fa6699bf7a45d24034978d2e2ad82ce25469a75093cc321b2cbfaae394394
6
+ metadata.gz: f1e4dcb5a95bf4aabecf2973c5816ffc120c2145e56fbcc4b9424d75d2c840ccb1ea90160cfc8d6b74a9249b4e253f2229460dac0a09c8829906b0f4a93658e5
7
+ data.tar.gz: bf2456dfe3454756678ceacc7b3659ae1d6b6ea1b0bfc0bf95ddacef1977488dffd72644cda2910ef5ff12e906351f75b8ed898bccf3598a15d4c5c30f4b2f54
@@ -133,7 +133,7 @@ scissors</p>
133
133
 
134
134
 
135
135
  <div class="method-source-code" id="continue-source">
136
- <pre><span class="ruby-comment"># File lib/Main.rb, line 12</span>
136
+ <pre><span class="ruby-comment"># File lib/Main.rb, line 13</span>
137
137
  <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>)
138
138
  <span class="ruby-identifier">puts</span> <span class="ruby-identifier">str1</span>
139
139
  <span class="ruby-identifier">print</span> <span class="ruby-identifier">str2</span>
@@ -169,7 +169,7 @@ scissors</p>
169
169
 
170
170
 
171
171
  <div class="method-source-code" id="new-source">
172
- <pre><span class="ruby-comment"># File lib/Main.rb, line 24</span>
172
+ <pre><span class="ruby-comment"># File lib/Main.rb, line 25</span>
173
173
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
174
174
  <span class="ruby-comment"># initialize variables and set all equal to zero</span>
175
175
  <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>
@@ -212,7 +212,7 @@ scissors</p>
212
212
 
213
213
 
214
214
  <div class="method-source-code" id="play-source">
215
- <pre><span class="ruby-comment"># File lib/Main.rb, line 30</span>
215
+ <pre><span class="ruby-comment"># File lib/Main.rb, line 31</span>
216
216
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">play</span>(<span class="ruby-identifier">winning_score</span>)
217
217
  <span class="ruby-comment"># make while loop</span>
218
218
  <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>
@@ -1,5 +1,5 @@
1
- Sat, 28 Oct 2017 17:27:58 -0700
2
- lib/Constants.rb Sat, 28 Oct 2017 11:28:45 -0700
3
- lib/Main.rb Sat, 28 Oct 2017 11:29:41 -0700
1
+ Sat, 28 Oct 2017 17:33:35 -0700
2
+ lib/Constants.rb Sat, 28 Oct 2017 17:32:30 -0700
3
+ lib/Main.rb Sat, 28 Oct 2017 17:32:37 -0700
4
4
  lib/PrivateMethods.rb Sat, 28 Oct 2017 11:29:09 -0700
5
- lib/rpsg/version.rb Sat, 28 Oct 2017 17:27:47 -0700
5
+ lib/rpsg/version.rb Sat, 28 Oct 2017 17:32:42 -0700
Binary file
Binary file
Binary file
@@ -36,18 +36,16 @@ class RockPaperScissorsGame
36
36
  # specify the version for the rubygem
37
37
  module RPSG
38
38
  # create version constant for the rubygem
39
- VERSION = "0.3.8"
39
+ VERSION = "0.3.9"
40
40
  end
41
41
 
42
42
  # create module that holds all contents for this script
43
43
  module ProtectedConstants
44
44
 
45
45
  # create 2d list of choices
46
- protected # make protected
47
46
  CHOICES = [['r', 'rock'], ['p', 'paper'], ['s', 'scissors']]
48
47
 
49
48
  # define entry to symbol (key to value) dictionary
50
- protected # make protected
51
49
  NTRY_TO_SYM = {
52
50
  CHOICES[0][0] => :ROCK , CHOICES[0][1] => :ROCK ,
53
51
  CHOICES[1][0] => :PAPER , CHOICES[1][1] => :PAPER ,
@@ -55,11 +53,9 @@ class RockPaperScissorsGame
55
53
  }
56
54
 
57
55
  # define valid entries
58
- protected # make protected
59
56
  VALID_ENTRIES = NTRY_TO_SYM.keys
60
57
 
61
58
  # define computer choices
62
- protected # make protected
63
59
  COMPUTER_CHOICES = NTRY_TO_SYM.values
64
60
 
65
61
  # create winners 2d list array with format: winning choice, losing choice
@@ -71,12 +67,11 @@ class RockPaperScissorsGame
71
67
  ]
72
68
 
73
69
  # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
74
- protected # make protected
75
70
  LOSERS = WINNERS.map { |winning_choice,losing_choice| [losing_choice,winning_choice] }
76
71
 
77
72
  end
78
73
 
79
- # protected_methods :ProtectedConstants
74
+ protected_methods :ProtectedConstants
80
75
 
81
76
  class << self
82
77
  # add continue method for asking the user if they want to play rock paper scissors
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -74,18 +74,16 @@
74
74
  <span class="c1"># specify the version for the rubygem</span>
75
75
  <span class="k">module</span> <span class="nn">RPSG</span>
76
76
  <span class="c1"># create version constant for the rubygem</span>
77
- <span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"0.3.8"</span>
77
+ <span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"0.3.9"</span>
78
78
  <span class="k">end</span>
79
79
 
80
80
  <span class="c1"># create module that holds all contents for this script</span>
81
81
  <span class="k">module</span> <span class="nn">ProtectedConstants</span>
82
82
 
83
83
  <span class="c1"># create 2d list of choices</span>
84
- <span class="kp">protected</span> <span class="c1"># make protected</span>
85
84
  <span class="no">CHOICES</span> <span class="o">=</span> <span class="p">[[</span><span class="s1">'r'</span><span class="p">,</span> <span class="s1">'rock'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'p'</span><span class="p">,</span> <span class="s1">'paper'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'s'</span><span class="p">,</span> <span class="s1">'scissors'</span><span class="p">]]</span>
86
85
 
87
86
  <span class="c1"># define entry to symbol (key to value) dictionary</span>
88
- <span class="kp">protected</span> <span class="c1"># make protected</span>
89
87
  <span class="no">NTRY_TO_SYM</span> <span class="o">=</span> <span class="p">{</span>
90
88
  <span class="no">CHOICES</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=&gt;</span> <span class="ss">:ROCK</span> <span class="p">,</span> <span class="no">CHOICES</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=&gt;</span> <span class="ss">:ROCK</span> <span class="p">,</span>
91
89
  <span class="no">CHOICES</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=&gt;</span> <span class="ss">:PAPER</span> <span class="p">,</span> <span class="no">CHOICES</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=&gt;</span> <span class="ss">:PAPER</span> <span class="p">,</span>
@@ -93,11 +91,9 @@
93
91
  <span class="p">}</span>
94
92
 
95
93
  <span class="c1"># define valid entries</span>
96
- <span class="kp">protected</span> <span class="c1"># make protected</span>
97
94
  <span class="no">VALID_ENTRIES</span> <span class="o">=</span> <span class="no">NTRY_TO_SYM</span><span class="p">.</span><span class="nf">keys</span>
98
95
 
99
96
  <span class="c1"># define computer choices</span>
100
- <span class="kp">protected</span> <span class="c1"># make protected</span>
101
97
  <span class="no">COMPUTER_CHOICES</span> <span class="o">=</span> <span class="no">NTRY_TO_SYM</span><span class="p">.</span><span class="nf">values</span>
102
98
 
103
99
  <span class="c1"># create winners 2d list array with format: winning choice, losing choice</span>
@@ -109,12 +105,11 @@
109
105
  <span class="p">]</span>
110
106
 
111
107
  <span class="c1"># this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player</span>
112
- <span class="kp">protected</span> <span class="c1"># make protected</span>
113
108
  <span class="no">LOSERS</span> <span class="o">=</span> <span class="no">WINNERS</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">winning_choice</span><span class="p">,</span><span class="n">losing_choice</span><span class="o">|</span> <span class="p">[</span><span class="n">losing_choice</span><span class="p">,</span><span class="n">winning_choice</span><span class="p">]</span> <span class="p">}</span>
114
109
 
115
110
  <span class="k">end</span>
116
111
 
117
- <span class="c1"># protected_methods :ProtectedConstants</span>
112
+ <span class="nb">protected_methods</span> <span class="ss">:ProtectedConstants</span>
118
113
 
119
114
  <span class="k">class</span> <span class="o">&lt;&lt;</span> <span class="nb">self</span>
120
115
  <span class="c1"># add continue method for asking the user if they want to play rock paper scissors</span>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=a9a8e65953a55274ca0541ca547c64427155db10"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -2,11 +2,9 @@
2
2
  module ProtectedConstants
3
3
 
4
4
  # create 2d list of choices
5
- protected # make protected
6
5
  CHOICES = [['r', 'rock'], ['p', 'paper'], ['s', 'scissors']]
7
6
 
8
7
  # define entry to symbol (key to value) dictionary
9
- protected # make protected
10
8
  NTRY_TO_SYM = {
11
9
  CHOICES[0][0] => :ROCK , CHOICES[0][1] => :ROCK ,
12
10
  CHOICES[1][0] => :PAPER , CHOICES[1][1] => :PAPER ,
@@ -14,11 +12,9 @@ module ProtectedConstants
14
12
  }
15
13
 
16
14
  # define valid entries
17
- protected # make protected
18
15
  VALID_ENTRIES = NTRY_TO_SYM.keys
19
16
 
20
17
  # define computer choices
21
- protected # make protected
22
18
  COMPUTER_CHOICES = NTRY_TO_SYM.values
23
19
 
24
20
  # create winners 2d list array with format: winning choice, losing choice
@@ -30,7 +26,6 @@ module ProtectedConstants
30
26
  ]
31
27
 
32
28
  # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
33
- protected # make protected
34
29
  LOSERS = WINNERS.map { |winning_choice,losing_choice| [losing_choice,winning_choice] }
35
30
 
36
31
  end
@@ -4,8 +4,9 @@ class RockPaperScissorsGame
4
4
  require "rpsg/version.rb"
5
5
 
6
6
  require "Constants.rb"
7
+
8
+ protected_methods :ProtectedConstants
7
9
 
8
- # protected_methods :Constants
9
10
 
10
11
  class << self
11
12
  # add continue method for asking the user if they want to play rock paper scissors
@@ -1,5 +1,5 @@
1
1
  # specify the version for the rubygem
2
2
  module RPSG
3
3
  # create version constant for the rubygem
4
- VERSION = "0.3.8"
4
+ VERSION = "0.3.9"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "rpsg"
3
- spec.version = "0.3.8"
3
+ spec.version = "0.3.9"
4
4
  spec.date = "2017-10-28" # format: YYYY/MM/DD
5
5
  spec.summary = "A Rock Paper Scissors Game RubyGem"
6
6
  spec.description = <<-EOF
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpsg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - bag3318