wizardwerdna-pokerstats 1.0.19 → 1.0.22

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.19
1
+ 1.0.22
@@ -15,13 +15,13 @@ class CreatePokerstats < ActiveRecord::Migration
15
15
  <%= Pokerstats::HandStatistics.player_statistics_migration_data -%>
16
16
  t.timestamps
17
17
  end
18
- create_table :player do |t|
18
+ create_table :players do |t|
19
19
  t.string :name
20
20
  end
21
21
  end
22
22
 
23
23
  def self.down
24
- drop_table :player
24
+ drop_table :players
25
25
  drop_table :player_statistics
26
26
  drop_table :hand_statistics
27
27
  end
@@ -9,6 +9,20 @@ module Pokerstats
9
9
  parser = self.new(stats)
10
10
  lines.each {|line| parser.parse(line)}
11
11
  end
12
+
13
+ def self.has_valid_header?(lines)
14
+ lines.lstrip!
15
+ case lines[/^[^\n\r]*/].is_valid_header
16
+ when /PokerStars Game #([0-9]+): Tournament #([0-9]+), (\$[0-9+$]+) ([^\-]*) - Level ([IVXL]+) \((#{CASH})\/(#{CASH})\) - (.*)$/
17
+ true
18
+ when /PokerStars Game #([0-9]+): +([^(]*) \((#{CASH})\/(#{CASH})\) - (.*)$/
19
+ true
20
+ when /PokerStars Game #([0-9]+): +([^(]*) \((#{CASH})\/(#{CASH}) USD\) - (.*)$/
21
+ true
22
+ else
23
+ false
24
+ end
25
+ end
12
26
 
13
27
  def initialize stats=nil
14
28
  @stats = stats || HandStatistics.new
@@ -48,6 +62,8 @@ module Pokerstats
48
62
  @stats.update_hand :name => "PS#{$1}", :description=> "#{$2} (#{$3}/#{$4})", :tournament=> nil, :sb=> cash_to_d($3), :bb=> cash_to_d($4), :played_at=> Time.parse($5), :street => :prelude
49
63
  when /PokerStars Game #([0-9]+): +([^(]*) \((#{CASH})\/(#{CASH}) USD\) - (.*)$/
50
64
  @stats.update_hand :name => "PS#{$1}", :description=> "#{$2} (#{$3}/#{$4})", :tournament=> nil, :sb=> cash_to_d($3), :bb=> cash_to_d($4), :played_at=> Time.parse($5), :street => :prelude
65
+ when /PokerStars Game #([0-9]+):/
66
+ raise "invalid hand record: #{line}"
51
67
  when /\*\*\* HOLE CARDS \*\*\*/
52
68
  @stats.register_button(@stats.button)
53
69
  @stats.update_hand :street => :preflop
@@ -61,8 +77,6 @@ module Pokerstats
61
77
  @stats.update_hand :street => :showdown
62
78
  when /\*\*\* SUMMARY \*\*\*/
63
79
  @stats.update_hand :street => :summary
64
- when /PokerStars Game #([0-9]+):/
65
- raise "invalid hand record: #{line}"
66
80
  when /Dealt to ([^)]+) \[([^\]]+)\]/
67
81
  @stats.register_action($1, 'dealt', :result => :cards, :data => $2)
68
82
  when /(.*): shows \[(.*)\]/
data/pokerstats.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pokerstats}
8
- s.version = "1.0.19"
8
+ s.version = "1.0.22"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew C. Greenberg"]
12
- s.date = %q{2009-09-02}
12
+ s.date = %q{2009-09-15}
13
13
  s.default_executable = %q{checkps}
14
14
  s.description = %q{a library for extracting, computing and reporting statistics of poker hands parsed from hand history files}
15
15
  s.email = %q{wizardwerdna@gmail.com}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wizardwerdna-pokerstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew C. Greenberg
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-02 00:00:00 -07:00
12
+ date: 2009-09-15 00:00:00 -07:00
13
13
  default_executable: checkps
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -90,6 +90,7 @@ files:
90
90
  - spec/zpokerstars_hand_history_parser_integration.rb.txt
91
91
  has_rdoc: false
92
92
  homepage: http://github.com/wizardwerdna/pokerstats
93
+ licenses:
93
94
  post_install_message:
94
95
  rdoc_options:
95
96
  - --charset=UTF-8
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  requirements: []
111
112
 
112
113
  rubyforge_project:
113
- rubygems_version: 1.2.0
114
+ rubygems_version: 1.3.5
114
115
  signing_key:
115
116
  specification_version: 3
116
117
  summary: poker hand history statistics library