gamespy_query 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gamespy_query/base.rb +9 -1
- data/lib/gamespy_query/version.rb +1 -1
- data/lib/gamespy_query.rb +10 -0
- metadata +1 -1
data/lib/gamespy_query/base.rb
CHANGED
@@ -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
|
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
|
data/lib/gamespy_query.rb
CHANGED