pokerstats 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
1
+ 2.0.3
@@ -53,14 +53,15 @@ def dopsfile(file, players_shown)
53
53
  players = {}
54
54
  last = nil
55
55
  statistics = Pokerstats::PlayerStatistics.new
56
- Pokerstats::PokerstarsFile.open(file).each do |handrecord|
56
+ Pokerstats::PokerstarsFile.open(file) do |pokerstarsfile|
57
+ pokerstarsfile.each do |handrecord|
57
58
  begin
58
59
  handrecord.parse
59
60
  statistics.record(handrecord)
60
61
  last = handrecord
61
62
  rescue Exception => e
62
63
  puts e.message
63
- end
64
+ end end
64
65
  end
65
66
  return if last.nil?
66
67
  players = last.stats.players
@@ -12,6 +12,10 @@ module Pokerstats
12
12
  @parser_class = parser_class
13
13
  @stats = HandStatistics.new
14
14
  end
15
+
16
+ def game
17
+ @parser_class.game lines.first
18
+ end
15
19
 
16
20
  def parsed?
17
21
  @parsed
@@ -11,22 +11,12 @@ module Pokerstats
11
11
  end
12
12
 
13
13
  def self.has_valid_header?(lines)
14
- lines.lstrip!
15
- case lines[/^[^\n\r]*/]
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
14
+ !game(lines).nil?
25
15
  end
26
16
 
27
- def self.game(line)
28
- line.lstrip!
29
- case line[/^[^\n\r]*/]
17
+ def self.game(lines)
18
+ lines.lstrip!
19
+ case lines.lines.first.chomp
30
20
  when /PokerStars Game #([0-9]+): Tournament #([0-9]+), (\$[0-9+$]+) ([^\-]*) - Level ([IVXL]+) \((#{CASH})\/(#{CASH})\) - (.*)$/
31
21
  "PS#{$1}"
32
22
  when /PokerStars Game #([0-9]+): +([^(]*) \((#{CASH})\/(#{CASH})\) - (.*)$/
@@ -0,0 +1,91 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{pokerstats}
8
+ s.version = "2.0.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Andrew C. Greenberg"]
12
+ s.date = %q{2009-10-30}
13
+ s.default_executable = %q{checkps}
14
+ s.description = %q{a library for extracting, computing and reporting statistics of poker hands parsed from hand history files}
15
+ s.email = %q{wizardwerdna@gmail.com}
16
+ s.executables = ["checkps"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/checkps",
29
+ "generators/pokerstats/USAGE",
30
+ "generators/pokerstats/pokerstats_generator.rb",
31
+ "generators/pokerstats/templates/create_pokerstats.rhtml",
32
+ "lib/pokerstats.rb",
33
+ "lib/pokerstats/.gitignore",
34
+ "lib/pokerstats/hand_constants.rb",
35
+ "lib/pokerstats/hand_history.rb",
36
+ "lib/pokerstats/hand_statistics.rb",
37
+ "lib/pokerstats/hand_statistics_api.rb",
38
+ "lib/pokerstats/player_statistics.rb",
39
+ "lib/pokerstats/plugins/aggression_statistics.rb",
40
+ "lib/pokerstats/plugins/blind_attack_statistics.rb",
41
+ "lib/pokerstats/plugins/cash_statistics.rb",
42
+ "lib/pokerstats/plugins/continuation_bet_statistics.rb",
43
+ "lib/pokerstats/plugins/preflop_raise_statistics.rb",
44
+ "lib/pokerstats/poker-edge.rb",
45
+ "lib/pokerstats/pokerstars_file.rb",
46
+ "lib/pokerstats/pokerstars_hand_history_parser.rb",
47
+ "pokerstats.gemspec",
48
+ "spec/file_empty.txt",
49
+ "spec/file_many_hands.txt",
50
+ "spec/file_one_hand.txt",
51
+ "spec/hand_statistics_spec.rb",
52
+ "spec/hand_statistics_spec_helper.rb",
53
+ "spec/player_statistics_spec.rb",
54
+ "spec/pokerstars_file_spec.rb",
55
+ "spec/pokerstars_hand_history_parser_spec.rb",
56
+ "spec/spec_helper.rb",
57
+ "spec/zpokerstars_hand_history_parser_integration.rb.txt"
58
+ ]
59
+ s.homepage = %q{http://github.com/wizardwerdna/pokerstats}
60
+ s.rdoc_options = ["--charset=UTF-8"]
61
+ s.require_paths = ["lib"]
62
+ s.rubygems_version = %q{1.3.5}
63
+ s.summary = %q{poker hand history statistics library}
64
+ s.test_files = [
65
+ "spec/hand_statistics_spec.rb",
66
+ "spec/hand_statistics_spec_helper.rb",
67
+ "spec/player_statistics_spec.rb",
68
+ "spec/pokerstars_file_spec.rb",
69
+ "spec/pokerstars_hand_history_parser_spec.rb",
70
+ "spec/spec_helper.rb"
71
+ ]
72
+
73
+ if s.respond_to? :specification_version then
74
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
75
+ s.specification_version = 3
76
+
77
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
78
+ s.add_development_dependency(%q<rspec>, [">= 0"])
79
+ s.add_development_dependency(%q<pluggable>, [">= 0"])
80
+ s.add_runtime_dependency(%q<pluggable>, [">= 0"])
81
+ else
82
+ s.add_dependency(%q<rspec>, [">= 0"])
83
+ s.add_dependency(%q<pluggable>, [">= 0"])
84
+ s.add_dependency(%q<pluggable>, [">= 0"])
85
+ end
86
+ else
87
+ s.add_dependency(%q<rspec>, [">= 0"])
88
+ s.add_dependency(%q<pluggable>, [">= 0"])
89
+ s.add_dependency(%q<pluggable>, [">= 0"])
90
+ end
91
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pokerstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
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-10-10 00:00:00 -07:00
12
+ date: 2009-10-30 00:00:00 -07:00
13
13
  default_executable: checkps
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -77,6 +77,7 @@ files:
77
77
  - lib/pokerstats/poker-edge.rb
78
78
  - lib/pokerstats/pokerstars_file.rb
79
79
  - lib/pokerstats/pokerstars_hand_history_parser.rb
80
+ - pokerstats.gemspec
80
81
  - spec/file_empty.txt
81
82
  - spec/file_many_hands.txt
82
83
  - spec/file_one_hand.txt