benchmark_driver 0.10.7 → 0.10.8

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
  SHA256:
3
- metadata.gz: 8346d596ab14db8378d9575ecd00a9efae898170b890c4627cb603d60290c19c
4
- data.tar.gz: 21879bf897e059878da0bae0ef0c68dd622fe6086d948d33e18822c36582597d
3
+ metadata.gz: 8b1b310f52a83e0661be59e3835573a69b7e84a7aebb7f4f13e0f190ce2545c8
4
+ data.tar.gz: 3597a61936cedb14e59cf172e76cf3d5f91616ec0dd6470a54c4e51c32e7008c
5
5
  SHA512:
6
- metadata.gz: 2d612ff00aceaea804a3b0ebaa39c7c6dd5bcd219d26e1e9c855049069e65271c1aa4dfd897502326713cd1e447054ddb39ba47061a0f604402c6b0c039b8107
7
- data.tar.gz: 1be94a52f4d63a438bbec19e9c787b2b7c202367102b516784ad7a7d30afc33a3457ad7b3a434012fb739a2be6f95b9289417607d613defe741d4847f6a85a3b
6
+ metadata.gz: b96308b5c25cae8dead511787fba95c1b049b5900e15670ccd8f84ec1b7b4584a23d2dd555c49a58c8ac32b59d4bc9715d6ffcdc964ee15761877d0986eb4ead
7
+ data.tar.gz: 9a33f86af59d36209715847a39cfc6777d1d4f078203f0dfa702b330e12201b747f3a275b9d6d032d2e2322013a83bd9230fa91c12303fb97e77b67c459029a1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.10.8
2
+
3
+ - In `command_stdout`, `$RBENV_VERSION` is no longer passed to --rbenv option because it has no effect for rbenv
4
+ - Instead, now dirname of executable path is prefixed to $PATH in `command_stdout`
5
+
1
6
  # v0.10.7
2
7
 
3
8
  - Pass `$RBENV_VERSION` for `command_stdout` runner with --rbenv option
data/exe/benchmark-driver CHANGED
@@ -35,7 +35,7 @@ config = BenchmarkDriver::Config.new.tap do |c|
35
35
  name, spec = full_spec.split('::', 2)
36
36
  spec ||= name # if `::` is not given, regard whole string as spec
37
37
  version, *args = spec.split(',')
38
- executables << BenchmarkDriver::Config::RbenvExecutable.new(
38
+ executables << BenchmarkDriver::Config::Executable.new(
39
39
  name: name,
40
40
  command: [BenchmarkDriver::Rbenv.ruby_path(version), *args],
41
41
  )
@@ -36,17 +36,4 @@ module BenchmarkDriver
36
36
  Config.defaults[:executables] = [
37
37
  BenchmarkDriver::Config::Executable.new(name: RUBY_VERSION, command: [RbConfig.ruby]),
38
38
  ]
39
-
40
- class Config::RbenvExecutable < Config::Executable
41
- def freeze
42
- rbenv_version # avoid `can't modify frozen xxx`
43
- super
44
- end
45
-
46
- def rbenv_version
47
- return @rbenv_version if defined?(@rbenv_version)
48
- match = command.first.match(%r[/(?<version>[^/]+)/bin/ruby\z])
49
- @rbenv_version = match && match[:version]
50
- end
51
- end
52
39
  end
@@ -1,6 +1,5 @@
1
1
  require 'benchmark_driver/struct'
2
2
  require 'benchmark_driver/metrics'
3
- require 'benchmark_driver/rbenv'
4
3
  require 'tempfile'
5
4
  require 'shellwords'
6
5
  require 'open3'
@@ -62,7 +61,7 @@ class BenchmarkDriver::Runner::CommandStdout
62
61
  @config.executables.each do |exec|
63
62
  best_value = with_repeat(metrics_type) do
64
63
  stdout = with_chdir(job.working_directory) do
65
- with_rbenv_version(exec) { execute(*exec.command, *job.command) }
64
+ with_ruby_prefix(exec) { execute(*exec.command, *job.command) }
66
65
  end
67
66
  StdoutToMetrics.new(
68
67
  stdout: stdout,
@@ -84,18 +83,12 @@ class BenchmarkDriver::Runner::CommandStdout
84
83
 
85
84
  private
86
85
 
87
- def with_rbenv_version(executable, &block)
88
- if executable.is_a?(BenchmarkDriver::Config::RbenvExecutable) && executable.rbenv_version
89
- begin
90
- env = ENV.to_h.dup
91
- ENV['RBENV_VERSION'] = executable.rbenv_version
92
- block.call
93
- ensure
94
- ENV.replace(env)
95
- end
96
- else
97
- block.call
98
- end
86
+ def with_ruby_prefix(executable, &block)
87
+ env = ENV.to_h.dup
88
+ ENV['PATH'] = "#{File.dirname(executable.command.first)}:#{ENV['PATH']}"
89
+ block.call
90
+ ensure
91
+ ENV.replace(env)
99
92
  end
100
93
 
101
94
  def with_chdir(working_directory, &block)
@@ -1,3 +1,3 @@
1
1
  module BenchmarkDriver
2
- VERSION = '0.10.7'
2
+ VERSION = '0.10.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.7
4
+ version: 0.10.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.7.3
113
+ rubygems_version: 2.7.6
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Fully-featured accurate benchmark driver for Ruby