profiling 3.0.0 → 4.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
- SHA1:
3
- metadata.gz: 8dc6e9a87098345c0cef1eb925bb7255fd3722ed
4
- data.tar.gz: 4255c2433487a11981d2c0fc5527d792e388d35b
2
+ SHA256:
3
+ metadata.gz: 741bfb137712d65a0280ccde370760c2f9993e07fc5f247ee7e796fa99913caa
4
+ data.tar.gz: 90bf533152d0f512c381cb79ef3cffb201c4905bfe59876e1e43ea27939f5b58
5
5
  SHA512:
6
- metadata.gz: 71be0138fdb39dbc6a83f38d18b09472e4833f330fa31e4b1ff410055c3126b4a264589836e804b77d5670ed7934cb4639fc82d33d5d6ab02ea46093e6aa1930
7
- data.tar.gz: 917530a65c98698f504d461874dc2020a6084698eacd36ba9a2aa71a35f013d7c8e212ff595689d73f59a465ff061020c759623aa2fee1aa419ca4bfb1cd41ce
6
+ metadata.gz: e11902ff7667a4b38e19c9ee9e60a0f2301ad86d28d30807b1b7e8fa9c6aa201b15e7ef58585d16f39ff7487680a8a84a1b0a348aa3ce3b3a0ddc1c32eb6664c
7
+ data.tar.gz: 7ebb82d01f71104d1ba1be6671555db8bcd8319a06719f46b500809fe535b611444db4d8b167cb49971c4f6a57518199ffdc74581e4f94ead8327fa8e4f5a5a4
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', "~> 3.0"
15
+ gem 'profiling', "~> 4.0"
16
16
  ```
17
17
 
18
18
  And then execute:
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "profiling"
4
+ require 'bundler/setup'
5
+ require 'profiling'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "profiling"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
data/lib/profiling.rb CHANGED
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fileutils'
2
4
  require 'ostruct'
3
5
 
4
- Dir[File.dirname(__FILE__) + '/profiling/*.rb'].each { |file| require file }
6
+ Dir["#{File.dirname(__FILE__)}/profiling/*.rb"].each { |file| require file }
5
7
 
6
8
  class Profiler
7
9
  extend Configuration
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Profiler
2
4
  module Configuration
3
-
4
5
  DEFAULT_CONFIG = {
5
6
  dir: 'profiling',
6
7
  exclude_gems: false,
7
8
  exclude_standard_lib: false
8
- }
9
+ }.freeze
9
10
 
10
11
  attr_accessor :config
11
12
 
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Profiler
2
4
  module Engine
3
-
4
5
  def run(*args)
5
6
  label = args.find { |a| a.is_a?(String) }
6
7
  opts = args.find { |a| a.is_a?(Hash) }
@@ -24,7 +25,7 @@ class Profiler
24
25
 
25
26
  begin
26
27
  yield
27
- rescue => e
28
+ rescue StandardError => e
28
29
  profile.stop
29
30
  raise e
30
31
  end
@@ -38,34 +39,34 @@ class Profiler
38
39
  end
39
40
  end
40
41
 
41
- out()
42
+ out
42
43
  end
43
44
 
44
45
  private
45
46
 
46
47
  def out
47
- File.open(File.join(@dir, "graph.html"), 'w') do |file|
48
+ File.open(File.join(@dir, 'graph.html'), 'w') do |file|
48
49
  RubyProf::GraphHtmlPrinter.new(@results).print(file)
49
50
  end
50
51
 
51
- File.open(File.join(@dir, "flat.txt"), 'w') do |file|
52
- RubyProf::FlatPrinterWithLineNumbers.new(@results).print(file)
52
+ File.open(File.join(@dir, 'flat.txt'), 'w') do |file|
53
+ RubyProf::FlatPrinter.new(@results).print(file)
53
54
  end
54
55
 
55
- File.open(File.join(@dir, "stack.html"), 'w') do |file|
56
+ File.open(File.join(@dir, 'stack.html'), 'w') do |file|
56
57
  RubyProf::CallStackPrinter.new(@results).print(file)
57
58
  end
58
59
  end
59
60
 
60
61
  def exclusion_regex
61
- regex = if config[:exclude_gems] && config[:exclude_standard_lib]
62
- /\/lib\/ruby\//
62
+ root = '/lib/ruby/'
63
+ if config[:exclude_gems] && config[:exclude_standard_lib]
64
+ /#{root}/
63
65
  elsif config[:exclude_gems]
64
- /\/lib\/ruby\/gems\//
66
+ %r{#{root}gems/}
65
67
  elsif config[:exclude_standard_lib]
66
- /\/lib\/ruby\/[^g]/
68
+ /#{root}[^g]/
67
69
  end
68
70
  end
69
-
70
71
  end
71
72
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Profiler
2
- VERSION = "3.0.0"
4
+ VERSION = '4.0.0'
3
5
  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: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Duncalfe
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-22 00:00:00.000000000 Z
11
+ date: 2021-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,100 +16,100 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '2.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec_junit_formatter
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.3'
61
+ version: '3.10'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.3'
68
+ version: '3.10'
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry
70
+ name: rspec_junit_formatter
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '0.4'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '0.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: yard
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '0.9'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '0.9'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: ruby-prof
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0.17'
103
+ version: '1.4'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0.17'
111
- description: 'Non-discriminatory Ruby code profiling: This gem is a small wrapper
112
- around the ruby-prof gem to do simple but powerful profiling'
110
+ version: '1.4'
111
+ description: Non-discriminatory profiler for Ruby MRI code. This gem is a small wrapper
112
+ around the ruby-prof gem to do simple but powerful profiling
113
113
  email:
114
114
  - lduncalfe@eml.cc
115
115
  executables: []
@@ -129,7 +129,7 @@ licenses:
129
129
  - MIT
130
130
  metadata:
131
131
  yard.run: yri
132
- post_install_message:
132
+ post_install_message:
133
133
  rdoc_options: []
134
134
  require_paths:
135
135
  - lib
@@ -137,17 +137,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: 1.9.3
140
+ version: 2.5.0
141
141
  required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubyforge_project:
148
- rubygems_version: 2.4.5.1
149
- signing_key:
147
+ rubygems_version: 3.2.3
148
+ signing_key:
150
149
  specification_version: 4
151
- summary: 'Non-discriminatory Ruby code profiling: This gem is a small wrapper around
152
- the ruby-prof gem to do simple but powerful profiling'
150
+ summary: Non-discriminatory profiler for Ruby MRI code.
153
151
  test_files: []