acpc_poker_types 0.0.6 → 0.0.7

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.
@@ -112,10 +112,8 @@ class Player
112
112
 
113
113
  # @return [Boolean] Reports whether or not this player has folded.
114
114
  def folded?
115
- if @actions_taken_this_hand.last.empty?
116
- false
117
- else
118
- :fold == @actions_taken_this_hand.last.last.to_sym
115
+ @actions_taken_this_hand.any? do |actions|
116
+ actions.any? { |action| action.to_sym == :fold }
119
117
  end
120
118
  end
121
119
 
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerTypes
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -3,27 +3,18 @@
3
3
  <head>
4
4
  <title>Code coverage for Spec</title>
5
5
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
- <script src='./assets/0.5.3/jquery-1.6.2.min.js' type='text/javascript'></script>
7
- <script src='./assets/0.5.3/jquery.dataTables.min.js' type='text/javascript'></script>
8
- <script src='./assets/0.5.3/fancybox/jquery.fancybox-1.3.1.pack.js' type='text/javascript'></script>
9
- <script src='./assets/0.5.3/jquery.timeago.js' type='text/javascript'></script>
10
- <script src='./assets/0.5.3/jquery.url.js' type='text/javascript'></script>
11
- <script src='./assets/0.5.3/highlight.pack.js' type='text/javascript'></script>
12
- <script src='./assets/0.5.3/app.js' type='text/javascript'></script>
13
- <link href='./assets/0.5.3/stylesheet.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
14
- <link href='./assets/0.5.3/highlight.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
15
- <link href='./assets/0.5.3/fancybox/jquery.fancybox-1.3.1.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
16
- <link href='./assets/0.5.3/smoothness/jquery-ui-1.8.4.custom.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
17
- <link rel="shortcut icon" type="image/png" href="./assets/0.5.3/favicon_green.png" />
18
- <link rel="icon" type="image/png" href="./assets/0.5.3/favicon.png" />
6
+ <script src='./assets/0.7.1/application.js' type='text/javascript'></script>
7
+ <link href='./assets/0.7.1/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
8
+ <link rel="shortcut icon" type="image/png" href="./assets/0.7.1/favicon_green.png" />
9
+ <link rel="icon" type="image/png" href="./assets/0.7.1/favicon.png" />
19
10
  </head>
20
11
 
21
12
  <body>
22
13
  <div id="loading">
23
- <img src="./assets/0.5.3/loading.gif" alt="loading"/>
14
+ <img src="./assets/0.7.1/loading.gif" alt="loading"/>
24
15
  </div>
25
16
  <div id="wrapper" style="display:none;">
26
- <div class="timestamp">Generated <abbr class="timeago" title="2012-12-31T01:48:47-07:00">2012-12-31T01:48:47-07:00</abbr></div>
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2013-01-04T14:59:30-07:00">2013-01-04T14:59:30-07:00</abbr></div>
27
18
  <ul class="group_tabs"></ul>
28
19
 
29
20
  <div id="content">
@@ -68,8 +59,8 @@
68
59
  </div>
69
60
 
70
61
  <div id="footer">
71
- Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.6.4
72
- and simplecov-html v0.5.3<br/>
62
+ Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.7.1
63
+ and simplecov-html v0.7.1<br/>
73
64
  using RSpec
74
65
  </div>
75
66
 
@@ -6,6 +6,7 @@ require 'celluloid'
6
6
 
7
7
  require 'acpc_dealer'
8
8
  require 'acpc_dealer_data'
9
+ require 'dmorrill10-utils'
9
10
 
10
11
  require File.expand_path("#{LIB_ACPC_POKER_TYPES_PATH}/player", __FILE__)
11
12
  require File.expand_path("#{LIB_ACPC_POKER_TYPES_PATH}/poker_action", __FILE__)
@@ -209,17 +210,18 @@ describe Player do
209
210
  @patient.take_winnings!(match.current_hand.chip_distribution[seat] + match.match_def.game_def.blinds[seat])
210
211
  end
211
212
 
212
- @patient.name.should == match.player_name
213
+ @patient.name.should == match.player.name
213
214
  @patient.seat.should == seat
214
- @patient.hole_cards.should == match.hole_cards
215
- @patient.actions_taken_this_hand.should == match.actions_taken_this_hand
216
- @patient.folded?.should == match.folded?
217
- @patient.all_in?.should == match.all_in?
218
- @patient.active?.should == match.active?
215
+ @patient.hole_cards.should == match.player.hole_cards
216
+ @patient.actions_taken_this_hand.reject_empty_elements.should == match.player.actions_taken_this_hand.reject_empty_elements
217
+
218
+ @patient.folded?.should == match.player.folded?
219
+ @patient.all_in?.should == match.player.all_in?
220
+ @patient.active?.should == match.player.active?
219
221
  @patient.round.should == match.current_hand.current_match_state.round
220
222
  end
221
223
 
222
- @patient.chip_balance.should == match.chip_balance
224
+ @patient.chip_balance.should == match.player.chip_balance
223
225
  end
224
226
  end
225
227
  end
@@ -236,6 +238,7 @@ describe Player do
236
238
  else
237
239
  @patient.hole_cards.should be nil
238
240
  end
241
+
239
242
  @patient.actions_taken_this_hand.should == @actions_taken_this_hand
240
243
  @patient.folded?.should == @has_folded
241
244
  @patient.all_in?.should == @is_all_in
@@ -248,6 +251,14 @@ describe Player do
248
251
  end
249
252
  end
250
253
 
254
+ class Array
255
+ def reject_empty_elements
256
+ reject do |elem|
257
+ elem.empty?
258
+ end
259
+ end
260
+ end
261
+
251
262
  MatchLog = Struct.new(
252
263
  :results_file_name,
253
264
  :actions_file_name,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_poker_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-02 00:00:00.000000000 Z
12
+ date: 2013-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dmorrill10-utils
@@ -271,7 +271,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
271
  version: '0'
272
272
  segments:
273
273
  - 0
274
- hash: 4187440214746204785
274
+ hash: 4392869187144069601
275
275
  required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  none: false
277
277
  requirements:
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  version: '0'
281
281
  segments:
282
282
  - 0
283
- hash: 4187440214746204785
283
+ hash: 4392869187144069601
284
284
  requirements: []
285
285
  rubyforge_project:
286
286
  rubygems_version: 1.8.24