rblineprof-report 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rblineprof/report.rb +13 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0b00d0048fe14b6368f77d67b3d76751740d4da
|
4
|
+
data.tar.gz: 3c4aa2b49e6f9761da611d92437576158ffb73b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5faa37dc5658451cfd74e540b0ee59bb1ed268b7b1c427d164f0cad95fc4aecced8c8b0566cddfc583d6c98b8ce00b03de94f03a2325652b160f92119ba4e78c
|
7
|
+
data.tar.gz: 978362c54d70c6d72155ad845d483c13093c04f016ff6ea084d9f270f9ab5b1d93ea7aa2687445767721d2a67fb0d79f0b09e294fd13e5efe1477b7d7009314f
|
data/lib/rblineprof/report.rb
CHANGED
@@ -18,9 +18,20 @@ module LineProf
|
|
18
18
|
# options
|
19
19
|
# :context
|
20
20
|
# :thresholds
|
21
|
+
# :out
|
21
22
|
def report(profile, options = {})
|
22
|
-
|
23
|
-
|
23
|
+
out_open(options[:out]) do |io|
|
24
|
+
io.puts Term::ANSIColor.blue("\n[LineProf] #{'=' * 63}") << "\n\n" <<
|
25
|
+
format_profile(profile, options) << "\n"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def out_open(path)
|
30
|
+
if path
|
31
|
+
File.open(path, 'a') {|io| yield(io) }
|
32
|
+
else
|
33
|
+
yield($stdout)
|
34
|
+
end
|
24
35
|
end
|
25
36
|
|
26
37
|
def format_profile(profile, options = {})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rblineprof-report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
71
|
rubyforge_project:
|
72
|
-
rubygems_version: 2.
|
72
|
+
rubygems_version: 2.4.5
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Format and print the result of rblineprof (github.com/tmm1/rblineprof)
|