gamespy_query 0.0.3 → 0.0.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.
@@ -8,20 +8,28 @@ module GamespyQuery
8
8
  RX_X0_SPEC = /^\x00|[^\x00]+\x00?/
9
9
  STR_EMPTY = ""
10
10
 
11
+ DEBUG = false
12
+
11
13
  module Tools
12
14
  STR_EMPTY = ""
13
15
 
14
16
  module_function
15
17
  def logger
16
- ActionController::Base.logger ||= Logger.new("logger.log")
18
+ @logger ||= ActionController::Base.logger || Logger.new("logger.log")
17
19
  end
18
20
 
19
21
  def debug(&block)
22
+ return unless DEBUG
20
23
  logger.debug yield
24
+ rescue Exception => e
25
+ puts "Error: #{e.class} #{e.message}, #{e.backtrace.join("\n")}"
21
26
  end
22
27
  end
23
28
 
24
29
  class Base
30
+ class TimeOutError < StandardError
31
+ end
32
+
25
33
  def strip_tags(str)
26
34
  # TODO: Strip tags!!
27
35
  str
@@ -1,3 +1,3 @@
1
1
  module GamespyQuery
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/gamespy_query.rb CHANGED
@@ -6,3 +6,13 @@ require_relative "gamespy_query/master"
6
6
  module GamespyQuery
7
7
  # Your code goes here...
8
8
  end
9
+
10
+
11
+ if $0 == __FILE__
12
+ host = ARGV[0]
13
+ port = ARGV[1]
14
+ g = GamespyQuery::Socket.new(host, port)
15
+ r = g.sync
16
+ exit unless r
17
+ puts r.to_yaml
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamespy_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: