rack-lineprof 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/rack/lineprof.rb +3 -1
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4c671bd62ed01d6e795f86c4707f3c63009e23af
4
- data.tar.gz: 7a4119942165738a119d97f7261b4dbba1865e25
2
+ SHA256:
3
+ metadata.gz: 985feac4708f76e0b4503d539b81cb28f668dc6a944648d3eef55b47a2a50181
4
+ data.tar.gz: 2808e0348345116fee7737811cdec0b8b2eef97130da977418253e08c33a7d60
5
5
  SHA512:
6
- metadata.gz: f2d30923f4976336eb6e0d2fd1f9eb031901a32990e00846ac918625935a2dc6d3428561d78babcabd365863ac36c296c0b7cb3283f887c263096537e7cc91c3
7
- data.tar.gz: 36feda5c2153b34a6a3b9fd91bf76ee3c4446c62541fa63fdcd6e9b066b795bb26ab130a0e5e77ea4bb766d5495337d1e3d82b85c2b30b1cf917c2ff62484a5c
6
+ metadata.gz: 8552ae53a792652e2edaf7ca62de47c8f5976a54256204aaba08a9af0d56feaa3074d21fe639a61e6ac620303a553fa13f24dfbbb0a8c02cd685b477472e54dc
7
+ data.tar.gz: f0310616b84e9dbdbe934b641faaa485d5a5ed98dcdabdf7c1debf1ef3e65e4dde025ed4d495bc5bd084aee7f31c21d9c8e6bebb60acd98d1ee00cbde2b93202
@@ -1,4 +1,5 @@
1
1
  require 'rblineprof'
2
+ require 'logger'
2
3
  require 'term/ansicolor'
3
4
 
4
5
  module Rack
@@ -21,13 +22,14 @@ module Rack
21
22
  def call env
22
23
  request = Rack::Request.new env
23
24
  matcher = request.params['lineprof'] || options[:profile]
25
+ logger = options[:logger] || ::Logger.new(STDOUT)
24
26
 
25
27
  return @app.call env unless matcher
26
28
 
27
29
  response = nil
28
30
  profile = lineprof(%r{#{matcher}}) { response = @app.call env }
29
31
 
30
- puts Term::ANSIColor.blue("\n[Rack::Lineprof] #{'=' * 63}") + "\n\n" +
32
+ logger.debug Term::ANSIColor.blue("\n[Rack::Lineprof] #{'=' * 63}") + "\n\n" +
31
33
  format_profile(profile) + "\n"
32
34
 
33
35
  response
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-lineprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-14 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 2.2.2
86
+ rubygems_version: 2.7.3
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Makes line-by-line source code profiling easy.