benchmark_methods 0.6 → 0.7

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: e2805ee294f5d5f9511ca9b1e144037715ba8352
4
- data.tar.gz: 5e29dcb77aa55ced27e903638bb46226a841127f
3
+ metadata.gz: 24fe7a39cefe5ab4723fea43dd71544d8fdf02c2
4
+ data.tar.gz: 8c32f0a8535f0e176374ed80f0c83f2661a419ea
5
5
  SHA512:
6
- metadata.gz: a5669e591dc5bace7685eaead369fe78df98d4a5bf31a606b213f5ef1fba6186bc301124e30252581c5890001eeaad29a0a8dd3c5da1213b7cadf8ac1b13916d
7
- data.tar.gz: 6a0b7659d40a7e353d3b20ea22826968f2751d6f3fa176ff34eccba6581876aaef03f72eac3353f38d1035ef9dcecaf56e7caa994875a232ff541ca4fa9199b0
6
+ metadata.gz: 14e86f6188129566bd543921084af947339c002e3ba0b3e8893e307afb883951c2375244e525cdc71e1088c3ae07dece8b4bf6d40e31a38cca91f39513f00cdd
7
+ data.tar.gz: cc0252fd70e26e4f87418f4c822374d1dcc8124543c42509ddb12eca4a064485984a102a1a239eab87379bfede2c71b0f7f88e4b5b5e6d082469c0785cef30e9
@@ -4,12 +4,11 @@ require_relative 'string_ext.rb'
4
4
  require 'benchmark_methods/version'
5
5
 
6
6
  module BenchmarkMethods
7
- using StringExt
8
7
 
9
8
  def self.included(base_klass)
10
- unless const_defined?("#{base_klass.name.demodulize}Interceptor")
9
+ unless const_defined?("#{base_klass.name.demodulize_for_bm}Interceptor")
11
10
  base_klass.extend(ClassMethods)
12
- interceptor = const_set("#{base_klass.name.demodulize}Interceptor", Module.new)
11
+ interceptor = const_set("#{base_klass.name.demodulize_for_bm}Interceptor", Module.new)
13
12
  base_klass.send(:prepend, interceptor)
14
13
  end
15
14
  end
@@ -42,7 +41,7 @@ module BenchmarkMethods
42
41
  module ClassMethods
43
42
 
44
43
  def cbenchmark(*cmethods)
45
- interceptor = const_get("#{name.demodulize}Interceptor")
44
+ interceptor = const_get("#{name.demodulize_for_bm}Interceptor")
46
45
  klass = const_get(name)
47
46
  helper = const_set("BenchmarkMethods#{SecureRandom.hex}Helper", Module.new)
48
47
  cmethods.each do |method_name|
@@ -62,7 +61,7 @@ module BenchmarkMethods
62
61
  end
63
62
 
64
63
  def benchmark(*cmethods)
65
- interceptor = const_get("#{name.demodulize}Interceptor")
64
+ interceptor = const_get("#{name.demodulize_for_bm}Interceptor")
66
65
  klass = const_get(name)
67
66
  cmethods.each do |method_name|
68
67
  interceptor.module_eval do
@@ -1,3 +1,3 @@
1
1
  module BenchmarkMethods
2
- VERSION = "0.6"
2
+ VERSION = "0.7"
3
3
  end
@@ -1,12 +1,10 @@
1
- module StringExt
2
- refine String do
3
- def demodulize
4
- path = self
5
- if i = path.rindex('::')
6
- path[(i+2)..-1]
7
- else
8
- path
9
- end
1
+ class String
2
+ def demodulize_for_bm
3
+ path = self
4
+ if i = path.rindex('::')
5
+ path[(i+2)..-1]
6
+ else
7
+ path
10
8
  end
11
9
  end
12
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_methods
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk