profiling 2.3.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcebc905bbf17f65a9569c5c3517381ab8f976ae
4
- data.tar.gz: 9156e9ccc5ae1f19772337cd53789d3e1bc421a3
3
+ metadata.gz: 8dc6e9a87098345c0cef1eb925bb7255fd3722ed
4
+ data.tar.gz: 4255c2433487a11981d2c0fc5527d792e388d35b
5
5
  SHA512:
6
- metadata.gz: ce32170eb1c1776886d720bf7a0495c393bb7ab7bdc597a233d7c19f804294773acf9dcb5fb6ebecbc0645a99c3e03520a0a26a39615ff4595e17652dd5a8e5f
7
- data.tar.gz: 1162eff56e9deaca226d8be89144d24e136426e44c1fe11135bbb0a15060f0a750a92fab53fbbef11ef99eafbabb6ce22d2504c4f2dfc5b639009e59444ca56a
6
+ metadata.gz: 71be0138fdb39dbc6a83f38d18b09472e4833f330fa31e4b1ff410055c3126b4a264589836e804b77d5670ed7934cb4639fc82d33d5d6ab02ea46093e6aa1930
7
+ data.tar.gz: 917530a65c98698f504d461874dc2020a6084698eacd36ba9a2aa71a35f013d7c8e212ff595689d73f59a465ff061020c759623aa2fee1aa419ca4bfb1cd41ce
data/README.md CHANGED
@@ -12,7 +12,7 @@ Non-discriminatory profiling for your MRI Ruby code. This gem is a small wrapper
12
12
  Add this line to your application's Gemfile:
13
13
 
14
14
  ```ruby
15
- gem 'profiling', "~> 2.2"
15
+ gem 'profiling', "~> 3.0"
16
16
  ```
17
17
 
18
18
  And then execute:
@@ -31,10 +31,10 @@ class Profiler
31
31
 
32
32
  @results = profile.stop
33
33
 
34
- # Optionally remove gems from the results
35
- if !@results.threads.empty? && config[:exclude_gems]
34
+ # Optionally remove gems (and the remainder of any standard lib) from the results
35
+ if !@results.threads.empty? && exclusion_regex
36
36
  @results.threads.each do |thread|
37
- thread.methods.each { |m| m.eliminate! if m.source_file.match(/\/gems\//) }
37
+ thread.methods.each { |m| m.eliminate! if m.source_file.match(exclusion_regex) }
38
38
  end
39
39
  end
40
40
 
@@ -57,5 +57,15 @@ class Profiler
57
57
  end
58
58
  end
59
59
 
60
+ def exclusion_regex
61
+ regex = if config[:exclude_gems] && config[:exclude_standard_lib]
62
+ /\/lib\/ruby\//
63
+ elsif config[:exclude_gems]
64
+ /\/lib\/ruby\/gems\//
65
+ elsif config[:exclude_standard_lib]
66
+ /\/lib\/ruby\/[^g]/
67
+ end
68
+ end
69
+
60
70
  end
61
71
  end
@@ -1,3 +1,3 @@
1
1
  class Profiler
2
- VERSION = "2.3.0"
2
+ VERSION = "3.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: profiling
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Duncalfe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-21 00:00:00.000000000 Z
11
+ date: 2018-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  requirements: []
147
147
  rubyforge_project:
148
- rubygems_version: 2.2.2
148
+ rubygems_version: 2.4.5.1
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: 'Non-discriminatory Ruby code profiling: This gem is a small wrapper around