demo-reader 0.0.1 → 0.0.2

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.
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "demo-reader"
8
- gem.summary = %Q{A library to read warsow and defrag demo files}
9
- gem.description = %Q{A library to read warsow and defrag demo files}
8
+ gem.summary = %Q{A library to read warsow demo files}
9
+ gem.description = %Q{A library to read warsow demo files (.wd8, .wd9, .wd10, .wd11 files)}
10
10
  gem.email = "me@aekym.com"
11
11
  gem.homepage = "http://github.com/aekym/demo-reader"
12
12
  gem.authors = ["aekym"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/demo-reader.gemspec CHANGED
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{demo-reader}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["aekym"]
12
- s.date = %q{2010-01-16}
13
- s.description = %q{A library to read warsow and defrag demo files}
12
+ s.date = %q{2010-01-23}
13
+ s.description = %q{A library to read warsow demo files (.wd8, .wd9, .wd10, .wd11 files)}
14
14
  s.email = %q{me@aekym.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
@@ -43,6 +43,7 @@ Gem::Specification.new do |s|
43
43
  "test/fixtures/warsow/wd11/bomb_wbomb1_b2uberspot.wd11",
44
44
  "test/fixtures/warsow/wd11/race_bardok-lick-revamped_54.882.wd11",
45
45
  "test/fixtures/warsow/wd11/race_cwrace5.wd11",
46
+ "test/fixtures/warsow/wd11/race_ghost-eikram2_25.848.wd11",
46
47
  "test/fixtures/warsow/wd11/race_killua-hykon.wd11",
47
48
  "test/fixtures/warsow/wd11/race_st1_07.848.wd11",
48
49
  "test/fixtures/warsow/wd11/race_wdm16_unfinished.wd11",
@@ -53,7 +54,7 @@ Gem::Specification.new do |s|
53
54
  s.rdoc_options = ["--charset=UTF-8"]
54
55
  s.require_paths = ["lib"]
55
56
  s.rubygems_version = %q{1.3.5}
56
- s.summary = %q{A library to read warsow and defrag demo files}
57
+ s.summary = %q{A library to read warsow demo files}
57
58
  s.test_files = [
58
59
  "test/demo_reader_test.rb",
59
60
  "test/demo_reader_warsow_wd10_race_test.rb",
@@ -61,7 +61,7 @@ class DemoReaderWarsow
61
61
 
62
62
 
63
63
  # detect scoreboard
64
-
64
+ #
65
65
  regex = /scb \"([^\"]+)/
66
66
  matchdata = regex.match(content)
67
67
 
@@ -73,7 +73,7 @@ class DemoReaderWarsow
73
73
 
74
74
 
75
75
  # detect game mode
76
-
76
+ #
77
77
  if @version == 11
78
78
  @gamemode = gamemode_wd11(content)
79
79
  else
@@ -100,9 +100,10 @@ class DemoReaderWarsow
100
100
 
101
101
 
102
102
  # detect time by sent message string with time from server
103
+ #
103
104
  if ['race', 'unknown'].include?(@gamemode)
104
105
  matches = []
105
- regex = /(server record|race finished)(?:!.*(?:current|times\^7 ))?: (\d+):(\d+)\.(\d+)/im
106
+ regex = /(server record|race finished)(?:!.*(?:current|times\^7 ))?:[0-9:\. ]* (\d+):(\d+)\.(\d+)/im
106
107
  matchdata = regex.match(content)
107
108
 
108
109
  while matchdata
@@ -119,6 +120,7 @@ class DemoReaderWarsow
119
120
 
120
121
 
121
122
  #detect all player names
123
+ #
122
124
  matches = []
123
125
  regex = /cs ([0-9]+) \"\\name\\([^\0]*)\\hand/
124
126
  rest_content = content
@@ -144,7 +146,7 @@ class DemoReaderWarsow
144
146
 
145
147
 
146
148
  # detect player
147
-
149
+ #
148
150
  playernames = @playernames.compact.sort.uniq
149
151
  if playernames.length == 1
150
152
  @player = playernames.first
@@ -10,7 +10,8 @@ class DemoReaderWarsowWd11RaceTest < Test::Unit::TestCase
10
10
  %w(race_st1_07.848 st1 00:07.848),
11
11
  %w(race_wdm16_unfinished wdm16),
12
12
  %w(race_bardok-lick-revamped_54.882 bardok-lick-revamped 00:54.882),
13
- %w(race_wrc03-3_28.684 wrc03-3 00:28.684)
13
+ %w(race_wrc03-3_28.684 wrc03-3 00:28.684),
14
+ %w(race_ghost-eikram2_25.848 ghost-eikram2 00:25.848)
14
15
  ].each do |entry|
15
16
 
16
17
  file, map, time = entry
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: demo-reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - aekym
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-16 00:00:00 +01:00
12
+ date: 2010-01-23 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: A library to read warsow and defrag demo files
16
+ description: A library to read warsow demo files (.wd8, .wd9, .wd10, .wd11 files)
17
17
  email: me@aekym.com
18
18
  executables: []
19
19
 
@@ -49,6 +49,7 @@ files:
49
49
  - test/fixtures/warsow/wd11/bomb_wbomb1_b2uberspot.wd11
50
50
  - test/fixtures/warsow/wd11/race_bardok-lick-revamped_54.882.wd11
51
51
  - test/fixtures/warsow/wd11/race_cwrace5.wd11
52
+ - test/fixtures/warsow/wd11/race_ghost-eikram2_25.848.wd11
52
53
  - test/fixtures/warsow/wd11/race_killua-hykon.wd11
53
54
  - test/fixtures/warsow/wd11/race_st1_07.848.wd11
54
55
  - test/fixtures/warsow/wd11/race_wdm16_unfinished.wd11
@@ -81,7 +82,7 @@ rubyforge_project:
81
82
  rubygems_version: 1.3.5
82
83
  signing_key:
83
84
  specification_version: 3
84
- summary: A library to read warsow and defrag demo files
85
+ summary: A library to read warsow demo files
85
86
  test_files:
86
87
  - test/demo_reader_test.rb
87
88
  - test/demo_reader_warsow_wd10_race_test.rb