arunthampi-injour 0.2.1 → 0.2.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/lib/injour.rb +4 -4
- data/lib/injour/version.rb +1 -1
- metadata +1 -1
data/lib/injour.rb
CHANGED
@@ -112,6 +112,8 @@ help
|
|
112
112
|
|
113
113
|
def self.get_status(limit = 5)
|
114
114
|
File.read(INJOUR_STATUS).split("\n").reverse.slice(0, limit).join("\n")
|
115
|
+
rescue # If file is not present, show an empty string
|
116
|
+
""
|
115
117
|
end
|
116
118
|
|
117
119
|
def self.get_limit(query_string)
|
@@ -131,13 +133,11 @@ help
|
|
131
133
|
end
|
132
134
|
|
133
135
|
# Don't log anything, everything goes in an abyss
|
134
|
-
log = WEBrick::Log.new(
|
135
|
-
|
136
|
-
server = WEBrick::HTTPServer.new(:Port => port.to_i, :Logger => log)
|
136
|
+
log = WEBrick::Log.new('/dev/null', WEBrick::Log::DEBUG)
|
137
|
+
server = WEBrick::HTTPServer.new(:Port => port.to_i, :Logger => log, :AccessLog => log)
|
137
138
|
|
138
139
|
# Open up a servlet, so that status can be viewed in a browser
|
139
140
|
server.mount_proc("/") do |req, res|
|
140
|
-
@logger = log
|
141
141
|
limit = get_limit(req.query_string)
|
142
142
|
res.body = get_status(limit)
|
143
143
|
res['Content-Type'] = "text/plain"
|
data/lib/injour/version.rb
CHANGED