method_profiler 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
3
  - 1.9.3
5
4
  - jruby
6
- - rbx
7
- - ree
@@ -1,5 +1,4 @@
1
1
  require 'method_profiler/report'
2
- require 'method_profiler/core_ext/object'
3
2
 
4
3
  require 'benchmark'
5
4
 
@@ -89,12 +88,12 @@ module MethodProfiler
89
88
  total_time = records.reduce(:+)
90
89
  average = total_time / total_calls
91
90
  results << {
92
- :method => method,
93
- :min => records.min,
94
- :max => records.max,
95
- :average => average,
96
- :total_time => total_time,
97
- :total_calls => total_calls,
91
+ method: method,
92
+ min: records.min,
93
+ max: records.max,
94
+ average: average,
95
+ total_time: total_time,
96
+ total_calls: total_calls,
98
97
  }
99
98
  end
100
99
 
@@ -7,12 +7,12 @@ module MethodProfiler
7
7
  class Report
8
8
  # Report headers
9
9
  HEADERS = {
10
- :method => "Method",
11
- :min => "Min Time",
12
- :max => "Max Time",
13
- :average => "Average Time",
14
- :total_time => "Total Time",
15
- :total_calls => "Total Calls",
10
+ method: "Method",
11
+ min: "Min Time",
12
+ max: "Max Time",
13
+ average: "Average Time",
14
+ total_time: "Total Time",
15
+ total_calls: "Total Calls",
16
16
  }
17
17
 
18
18
  # Fields that can be passed to {#sort_by}.
@@ -78,15 +78,15 @@ module MethodProfiler
78
78
  "MethodProfiler results for: #{@obj}",
79
79
  Hirb::Helpers::Table.render(
80
80
  to_a,
81
- :headers => HEADERS.dup,
82
- :fields => FIELDS.dup,
83
- :filters => {
84
- :min => :to_milliseconds,
85
- :max => :to_milliseconds,
86
- :average => :to_milliseconds,
87
- :total_time => :to_milliseconds,
81
+ headers: HEADERS.dup,
82
+ fields: FIELDS.dup,
83
+ filters: {
84
+ min: :to_milliseconds,
85
+ max: :to_milliseconds,
86
+ average: :to_milliseconds,
87
+ total_time: :to_milliseconds,
88
88
  },
89
- :description => false
89
+ description: false
90
90
  )
91
91
  ].join("\n")
92
92
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "method_profiler"
5
- s.version = "1.2.0"
5
+ s.version = "2.0.0"
6
6
  s.authors = ["Jimmy Cuadra"]
7
7
  s.email = ["jimmy@jimmycuadra.com"]
8
8
  s.homepage = "https://github.com/change/method_profiler"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -75,7 +75,6 @@ files:
75
75
  - README.md
76
76
  - Rakefile
77
77
  - lib/method_profiler.rb
78
- - lib/method_profiler/core_ext/object.rb
79
78
  - lib/method_profiler/hirb.rb
80
79
  - lib/method_profiler/profiler.rb
81
80
  - lib/method_profiler/report.rb
@@ -1,9 +0,0 @@
1
- # Backports Object#singleton_class from Ruby 1.9.2
2
- class Object
3
- # Returns the singleton class of an object.
4
- #
5
- # @return [Object] The object's singleton class.
6
- def singleton_class
7
- class << self; self end
8
- end
9
- end if RUBY_VERSION < "1.9.2"