acpc_poker_types 7.2.3 → 7.2.4

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: ebd2152146b1dc9244929e8da7149ef24f1a9aaa
4
- data.tar.gz: 436a9675970b24bef46497299274ce873fa80416
3
+ metadata.gz: 29d52abf33b84eca7383eae28cb21589864f6047
4
+ data.tar.gz: b25c8d6b77c61bb65a82fc5efe5b22de9fabb8a0
5
5
  SHA512:
6
- metadata.gz: 2e2cf819cb172e7827bcfa58d404ef15ca6b4b89adb04d4b9898299c7322d8d855cd4eed6f67f964602dda491fc17609bf0c477d4b96c10ebef671e51f4548e3
7
- data.tar.gz: 3129577ddf84a23a046723902f9a5f55f4f1a51ea325e68477cebf59d0f0328dd682e04a036204d43f3802092e91821caf6c0628e9993c7476534820d6fc3316
6
+ metadata.gz: 89baac270d2453a97e52ffe7d62a9a0277a58eb13150017327544b9e5e7c340dcb417d59ebeb5504bf1f386c158e68950be1797e2d416ebb3d43b4b8541c769a
7
+ data.tar.gz: 039f04569ffa7f0f1b99fa62633194b83a78511f4f9a05e516b8eb9b58cd743107cfcfc03519f423ef49105368bbbbb0e97c6d3451ce086ccd1cd1278fed6e50
@@ -230,12 +230,10 @@ class MatchState < DelegateClass(String)
230
230
 
231
231
  # @return [PokerAction] The last action taken.
232
232
  def last_action
233
- @last_action ||= if @betting_sequence_string.match(
234
- /([^#{BETTING_SEQUENCE_SEPARATOR}])#{BETTING_SEQUENCE_SEPARATOR}*$/
235
- )
236
- PokerAction.new($1)
237
- else
233
+ @last_action ||= if betting_sequence.flatten.empty?
238
234
  nil
235
+ else
236
+ betting_sequence[round_in_which_last_action_taken].last
239
237
  end
240
238
  end
241
239
 
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerTypes
2
- VERSION = '7.2.3'
2
+ VERSION = '7.2.4'
3
3
  end
@@ -29,13 +29,18 @@ include AcpcPokerTypes
29
29
 
30
30
  describe MatchState do
31
31
  describe '#parse' do
32
- it "parses every possible limit action" do
33
- partial_match_state = MatchState::LABEL + ":1:1:"
32
+ it "parses every possible action" do
33
+ partial_match_state = "#{MatchState::LABEL}:1:1:"
34
34
  hole_cards = arbitrary_hole_card_hand
35
35
  PokerAction::CANONICAL_ACTIONS.each do |action|
36
- match_state = partial_match_state + action + ":" + hole_cards.to_acpc
36
+ action_string = if PokerAction::MODIFIABLE_ACTIONS.include?(action)
37
+ "#{action}123"
38
+ else
39
+ action
40
+ end
41
+ match_state = "#{partial_match_state}#{action_string}/:#{hole_cards.to_acpc}"
37
42
  patient = test_match_state_success match_state
38
- patient.last_action.to_s.must_equal action
43
+ patient.last_action.to_s.must_equal action_string
39
44
  end
40
45
  end
41
46
  it "parses every possible hole card hand" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_poker_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.3
4
+ version: 7.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-11 00:00:00.000000000 Z
11
+ date: 2013-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: process_runner