steam_hlds_log_parser 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 30af9317dcddbf6bebd31d3bb02ff5df117db707
4
- data.tar.gz: ab06662bf153b61c2cdab5b9d64209ced673e4e9
5
2
  SHA512:
6
- metadata.gz: 774c7685110aca35822f3642a5a93bbca4bd196f6ddad776345938e29a76df62f3f3b72c866898925f64ed0128a064b8046e9581db9553e6eb4719ea200a07aa
7
- data.tar.gz: 5b8c66867b180997d6769fbff9f047346a270bddfce355fc842eafe55c3af72df5a4ab0deaf3f21112704609393682cba8e5b064a9c2e97420e7631d10ece3f9
3
+ data.tar.gz: 07e4b392ab7437fcfdc19b459ed818ef2f9ea568f7bb77790f90aa2225f5bde3c99f28af74684d1ea8fcde0b033fae332a3b9e24401dd20001a055b3eb7cdbe7
4
+ metadata.gz: 6b3effe39ddd007a2970b3ba3887e031b82042fec141a87d71f288e10f948535a4ba9abd7437a54722472f42f2b00cd59f6cd8622468c1b1a08afd0be591ed62
5
+ SHA1:
6
+ data.tar.gz: a0df584749432ba49b668243c12eb2fd7f4b0bc0
7
+ metadata.gz: d9aca93be069273408f47ad57a141f2b9b7bd3b4
@@ -8,6 +8,7 @@ require "steam_hlds_log_parser/client"
8
8
  require "steam_hlds_log_parser/handler"
9
9
  require "steam_hlds_log_parser/displayer"
10
10
 
11
+ # SteamHldsLogParser module namespace
11
12
  module SteamHldsLogParser
12
13
 
13
14
  I18n.load_path = Dir.glob( File.dirname(__FILE__) + "/locales/*.yml" )
@@ -1,22 +1,21 @@
1
1
  module SteamHldsLogParser
2
2
 
3
+ # Listens to HLDS logs received via UDP on configured port
3
4
  class Client
4
5
 
5
6
  attr_reader :host, :port, :options
6
7
 
7
8
  # Creates a new client
8
9
  #
9
- # @host [String] Hostname / IP Address the server will be running
10
- # @port [Integer] Port to listen to
11
- # @options [Hash] Other options
10
+ # @param [String] host Hostname / IP Address the server will be running
11
+ # @param [Integer] port Port to listen to
12
+ # @param [Hash] options Other options
12
13
  #
13
- # ==== Options
14
- #
15
- # * +locale+ - Set the language of returned content
16
- # * +display_kills+ Enable kills / frags detail (default=true)
17
- # * +display_actions+ Enable players actions / defuse / ... detail (default=true)
18
- # * +display_changelevel+ Enable changelevel (map) display (default=true)
19
- # * +displayer+ Class that will be use to display content (default=HldsReturnDisplayer)
14
+ # @option options [Symbol] :locale (:en) Set the language of returned content
15
+ # @option options [Boolean] :display_kills (true) Enable kills / frags detail
16
+ # @option options [Boolean] :display_actions (true) Enable players actions / defuse / ... detail
17
+ # @option options [Boolean] :display_changelevel (true) Enable changelevel (map) display
18
+ # @option options [Class] :displayer Class that will be use to display content
20
19
  #
21
20
  def initialize(host, port, options = {})
22
21
  default_options = {
@@ -2,7 +2,7 @@ module SteamHldsLogParser
2
2
 
3
3
  # Default Displayer
4
4
  #
5
- # @data [Hash] Data returned by 'receive_data'
5
+ # @param [Hash] data Data returned by 'receive_data'
6
6
  #
7
7
  class Displayer
8
8
 
@@ -12,17 +12,23 @@ module SteamHldsLogParser
12
12
  @data = data
13
13
  end
14
14
 
15
- # Return data
15
+ # Return 'data'
16
+ #
17
+ # @return [Hash] Data processed by Handler class
18
+ #
16
19
  def get_data
17
20
  return @data
18
21
  end
19
22
 
20
- # Display data
23
+ # Display 'data'
21
24
  def display_data
22
25
  puts get_data
23
26
  end
24
27
 
25
- # Return data translation
28
+ # Return 'data' translation
29
+ #
30
+ # @return [String] Translated data processed by Handler class
31
+ #
26
32
  def get_translation
27
33
  return I18n.t(@data[:type], @data[:params]) unless @data[:type].nil?
28
34
  end
@@ -1,14 +1,15 @@
1
1
  module SteamHldsLogParser
2
2
 
3
+ # Process data received by 'Client'
3
4
  class Handler < EM::Connection
4
5
 
5
6
  attr_reader :host, :port, :options
6
7
 
7
8
  # Initialize Handler from Client options
8
9
  #
9
- # @host [String] Hostname / IP Address the server will be running
10
- # @port [Integer] Port to listen to
11
- # @options [Hash] Other options
10
+ # @param [String] host Hostname / IP Address the server will be running
11
+ # @param [Integer] port Port to listen to
12
+ # @param [Hash] options Other options
12
13
  #
13
14
  def initialize(host, port, options)
14
15
  @host, @port, @options = host, port, options
@@ -33,7 +34,7 @@ module SteamHldsLogParser
33
34
  # * match who did what (defuse, drop the bomb...)
34
35
  # * match changelevel
35
36
  #
36
- # @data [String] Data received by Client from HLDS server (a line of log)
37
+ # @param [String] data Data received by Client from HLDS server (a line of log)
37
38
  #
38
39
  def receive_data(data)
39
40
 
@@ -75,7 +76,9 @@ module SteamHldsLogParser
75
76
 
76
77
  # Format team name with long format (textual)
77
78
  #
78
- # @winner [String] Round winner (+CT+ or +T+) from logs
79
+ # @param [String] winner Round winner (+CT+ or +T+) from logs
80
+ #
81
+ # @return [String] Full team name from translation files
79
82
  #
80
83
  def get_full_team_name(winner)
81
84
  case winner
@@ -88,7 +91,9 @@ module SteamHldsLogParser
88
91
 
89
92
  # Format team name with short format (initials)
90
93
  #
91
- # @team [String] Round winner (+CT+ or +TERRORIST+) from logs
94
+ # @param [String] team Round winner (+CT+ or +TERRORIST+) from logs
95
+ #
96
+ # @return [String] Short team name from translation files
92
97
  #
93
98
  def get_short_team_name(team)
94
99
  case team
@@ -1,3 +1,4 @@
1
1
  module SteamHldsLogParser
2
- VERSION = "0.4.0"
2
+ # Gem Version
3
+ VERSION = "0.4.1"
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steam_hlds_log_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas VIAL