rack-olark 0.0.8 → 0.1
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/VERSION +1 -1
- data/lib/rack/olark.rb +8 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.1
|
data/lib/rack/olark.rb
CHANGED
@@ -13,6 +13,7 @@ module Rack
|
|
13
13
|
unless options[:id] && options[:id].length == 16
|
14
14
|
raise ArgumentError, 'Need a valid Olark ID!'
|
15
15
|
end
|
16
|
+
|
16
17
|
@app, @options = app, DEFAULTS.merge(options)
|
17
18
|
@id, @tag, @paths = [@options.delete(:id),
|
18
19
|
@options.delete(:tag),
|
@@ -38,6 +39,13 @@ module Rack
|
|
38
39
|
@request = Rack::Request.new(env)
|
39
40
|
valid_path = @paths.select { |path| @request.path_info =~ path }.length > 0
|
40
41
|
|
42
|
+
# Deprecation warning, repeated and annoying. Sorry about your log space.
|
43
|
+
if @options[:format]
|
44
|
+
logger = env['rack.errors']
|
45
|
+
logger.write("[#{Time.now.strftime("%Y-%M-%d %H:%M:%S")}] WARNING ")
|
46
|
+
logger.write("Rack::Olark: The 'format' option no longer works! See README.md for details.\n")
|
47
|
+
end
|
48
|
+
|
41
49
|
if html? && (@paths.empty? || valid_path)
|
42
50
|
response = Rack::Response.new([], @status, @headers)
|
43
51
|
@response.each { |fragment| response.write(inject(fragment)) }
|