rbm 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rbm.rb CHANGED
@@ -10,7 +10,7 @@ module RBM
10
10
  fragments, options = parse_options(args)
11
11
 
12
12
  if load_paths = options.delete(:load_paths)
13
- $LOAD_PATH.unshift(load_paths)
13
+ $LOAD_PATH.unshift(*load_paths)
14
14
  end
15
15
 
16
16
  begin
@@ -10,14 +10,14 @@ module RBM
10
10
 
11
11
  def run(bm, times, init = nil, cleanup = nil)
12
12
  fragment_name = (name || @@unnamed_fragment.succ!).gsub(/\s+/, "_")
13
- object = Object.new
13
+ binding = Object.new.send(:binding)
14
14
 
15
15
  bm.report(name) do
16
- object.instance_eval(init, "#{fragment_name}_init", 0) if init
17
- object.instance_eval(prerun, "#{fragment_name}_prerun", 0) if prerun
18
- object.instance_eval("#{times}.times { #{code} }", "#{fragment_name}", 0)
19
- object.instance_eval(postrun, "#{fragment_name}_postrun", 0) if postrun
20
- object.instance_eval(cleanup, "#{fragment_name}_cleanup", 0) if cleanup
16
+ eval(init, binding, "#{fragment_name}_init", 0) if init
17
+ eval(prerun, binding, "#{fragment_name}_prerun", 0) if prerun
18
+ eval("#{times}.times { #{code} }", binding, "#{fragment_name}", 0)
19
+ eval(postrun, binding, "#{fragment_name}_postrun", 0) if postrun
20
+ eval(cleanup, binding, "#{fragment_name}_cleanup", 0) if cleanup
21
21
  end
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module RBM
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-14 00:00:00.000000000 Z
12
+ date: 2012-07-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: rbm lets you benchmark varies code fragments by running them a specified
15
15
  number of times along with code fragments before and after all of the fragments
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  requirements: []
48
48
  rubyforge_project:
49
- rubygems_version: 1.8.21
49
+ rubygems_version: 1.8.11
50
50
  signing_key:
51
51
  specification_version: 3
52
52
  summary: rbm is a command line tool for doing quick benchmarks of ruby code.