rblineprof-report 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rblineprof/report.rb +13 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3768e906e3d72f26780b5fbfc53e2d2b1979973d
4
- data.tar.gz: 549230e9fd41484c30f6238cc3aaf612c6eb0de6
3
+ metadata.gz: e0b00d0048fe14b6368f77d67b3d76751740d4da
4
+ data.tar.gz: 3c4aa2b49e6f9761da611d92437576158ffb73b4
5
5
  SHA512:
6
- metadata.gz: e94ea4ec548a9b64b2abb70523bfc1f786fc4e8dfca1e0fdc80cadeadf1d95825fa9df8ca9d125ee852c712e9d255dabf4899020e6882f092b720d1c3b976e08
7
- data.tar.gz: 32caea4097589ff03204323caffb6fd237be94a4c45143abb76da25017b96104c36eb23ced000e48670eb721b7b17264745d3b440d8b3d5548b21d5f730514c2
6
+ metadata.gz: 5faa37dc5658451cfd74e540b0ee59bb1ed268b7b1c427d164f0cad95fc4aecced8c8b0566cddfc583d6c98b8ce00b03de94f03a2325652b160f92119ba4e78c
7
+ data.tar.gz: 978362c54d70c6d72155ad845d483c13093c04f016ff6ea084d9f270f9ab5b1d93ea7aa2687445767721d2a67fb0d79f0b09e294fd13e5efe1477b7d7009314f
@@ -18,9 +18,20 @@ module LineProf
18
18
  # options
19
19
  # :context
20
20
  # :thresholds
21
+ # :out
21
22
  def report(profile, options = {})
22
- puts Term::ANSIColor.blue("\n[LineProf] #{'=' * 63}") + "\n\n" +
23
- format_profile(profile, options) + "\n"
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.3
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: 2014-11-04 00:00:00.000000000 Z
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.2.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)