lines 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGY1NGIwNzgzMjEwODZjZjA4ZTBhNTZjYTA3YTEzNWYzMTRkYjYyNA==
4
+ NTIwMmJjMDE2ODE1NTNjMmFlMDEyNTlmOTVkZDIyYzliOTI5NzMyYg==
5
5
  data.tar.gz: !binary |-
6
- OWZkYzQxZDk2ZTFkMjYxMzM1OWQyZDI1YTg1ZTc3NTUxYzBjMDZhYQ==
6
+ ODM3YmQzNjcwOGNjNTQ3NTViNTNlZTRiZmMyMjc1ZWJkYjZmOGE2OQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Y2I1YTQyMDc5ZThjZjY1NmUzZTQ1NzEzZjE0M2M2MjVhMjNlNTUwMDU3Njk2
10
- YmYzYjk5MjE1NjBhMThkMzI1YThkNTVhYzJjNjhjY2MzYTkwMzA0N2EwOTc1
11
- NjAwZDUxMDU0ZTgyMDUxNmM5MTc2MjdlZmUzZTAyNTJhZTAwMzY=
9
+ ZGM2NDAwM2YwMmZhZWM4MTk4MzA0MDY1YTZmZDc0MGE5OTQyYjU1MTI3MTM1
10
+ NDU0N2JiZWM3ZGZkOGNhNjQzYzc2MTUwMzA0M2RkZmFjZDEyMWQ3YWM1MDNm
11
+ MTc5NGIyYTQwNWQ5MjIxNmU1MjhjZWVhMzc5MzE0OWFiNzMwZTA=
12
12
  data.tar.gz: !binary |-
13
- MGQ0YWU0ZmM5ZWQ4NThhZjRkNWM3N2U4Y2Q3OTc1YmY3M2U0NmE5M2ZlNGIz
14
- MmQyYjRlYjc5MTM5ODBiYWRmMjNiYzExMzVlNDYyODA2OTM1NzRmZmRhMzNl
15
- MTJkMWFiNzIwMmYyNTYxYzRjMTFhNmJmOTM2YWQ1ODUwNmVmMDM=
13
+ YjM5OWRkYjFlMmM4MWI4YWI2YzVmMDlmY2Y5OTVkMDgzOGUxYTM0ZjNlYzUx
14
+ OGEzOTM3ZjEwYWI1MGU0OTViYjE1ZGRjMDdiMzQzOWFhYzA4MmFmYzNkNDA2
15
+ Nzg3ZTU0NzcxM2Q3ODdmOGI0M2ViMWRlOTIzMTI5YWQwNDk4MDk=
data/lib/lines.rb CHANGED
@@ -75,7 +75,7 @@ module Lines
75
75
  # Returns a backward-compatibile logger
76
76
  def logger
77
77
  @logger ||= (
78
- require "lines/logger"
78
+ require 'lines/logger'
79
79
  Logger.new(self)
80
80
  )
81
81
  end
@@ -176,6 +176,9 @@ module Lines
176
176
  level = extract_pri(obj)
177
177
  str = dumper.dump(obj)
178
178
 
179
+ # Escape printf formatting
180
+ str.gsub!('%', '%%')
181
+
179
182
  syslog.log(level, str)
180
183
  end
181
184
 
@@ -276,9 +279,9 @@ module Lines
276
279
  when String, Symbol then strenc(x)
277
280
  when Numeric then numenc(x)
278
281
  when Time, Date then timeenc(x)
279
- when true then "#t"
280
- when false then "#f"
281
- when nil then "nil"
282
+ when true then '#t'
283
+ when false then '#f'
284
+ when nil then 'nil'
282
285
  else
283
286
  litenc(x)
284
287
  end
@@ -6,7 +6,7 @@ module Lines
6
6
  def sql(event)
7
7
  payload = event.payload
8
8
 
9
- return if payload[:name] == "SCHEMA"
9
+ return if payload[:name] == 'SCHEMA'
10
10
 
11
11
  args = {}
12
12
 
@@ -5,7 +5,7 @@ module Lines
5
5
  class RackLogger < Rack::CommonLogger
6
6
  # In development mode the common logger is always inserted
7
7
  def self.silence_common_logger!
8
- Rack::CommonLogger.module_eval("def call(env); @app.call(env); end")
8
+ Rack::CommonLogger.module_eval('def call(env); @app.call(env); end')
9
9
  self
10
10
  end
11
11
 
@@ -25,11 +25,11 @@ module Lines
25
25
 
26
26
  def log(env, status, header, began_at)
27
27
  Lines.log(
28
- remote_addr: env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"],
28
+ remote_addr: env['HTTP_X_FORWARDED_FOR'] || env['REMOTE_ADDR'],
29
29
  remote_user: env['REMOTE_USER'] || '',
30
30
  method: env['REQUEST_METHOD'],
31
31
  path: env['PATH_INFO'],
32
- query: env["QUERY_STRING"],
32
+ query: env['QUERY_STRING'],
33
33
  status: status.to_s[0..3],
34
34
  length: extract_content_length(header),
35
35
  elapsed: [Time.now - began_at, 's'],
data/lib/lines/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lines
2
- VERSION = "0.1.22"
2
+ VERSION = "0.1.23"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lines
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Pfenniger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-27 00:00:00.000000000 Z
11
+ date: 2013-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler