benchmark_driver 0.16.2 → 0.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d12d73c435a4bc6f93f92bfa7facf60c4b7badc985249f5ccb71b77137454106
4
- data.tar.gz: 53d4c9ffeb1d3b682359ecf96e29e02b8013ac22e130b936910fb99fba162cc6
3
+ metadata.gz: 7f9cf509e30003805a04ef225d6941f96b355f833121ef8bc3dcb35476a12569
4
+ data.tar.gz: d8709282ed2d0505322b124c68a6a618f3085f906ae3f503cf6b2333756c7d02
5
5
  SHA512:
6
- metadata.gz: 2075268423fa15c86e3dcf70c5378cc70bc5a9bc2b245515dc098f009f770c832cd5a6148c7a9c1e77ab2c7eed5e9e014476cdc66a83e8ec71835ed6a52a05a8
7
- data.tar.gz: 07f0c6f4f205fb4179e4bc44ce38937cd51a455a9a93b64a29a61597f5a9286aadb731b4a825ea7d6a0199c7677adad1e866e6f464cf23a34b1bb6583af0ee67
6
+ metadata.gz: dcc32a63dc71bfa73a80f2e21adff057ef24baa939c17f613e7c26c4cd737c1345ecd713c5f4245eb8877fa08528d219e44a31b1dfe2c2924a683f003293a53f
7
+ data.tar.gz: deff92f21009fe2d306a49b100b3a04c1ec490f4658400573dc71345f276ffee99956c8c340cd0704548d99b6bb716ebd0d35c8e91b07692d32a79fa8b240830
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # v0.16.4
2
+
3
+ - Fix broken output on `-o markdown --output-compare`
4
+
5
+ # v0.16.3
6
+
7
+ - Unset `GEM_PATH` and `GEM_HOME` in child processes to avoid warnings when using chruby
8
+
1
9
  # v0.16.2
2
10
 
3
11
  - Add --chruby option to use a Ruby managed by chruby
@@ -133,13 +133,9 @@ class BenchmarkDriver::Output::Markdown
133
133
  if context == worst
134
134
  result = '-'
135
135
  else
136
- result = result.values.first[1]
137
- if order == :min_by
138
- result = result.fdiv(worst_result)
139
- else
140
- result = best_result.fdiv(worst_result)
141
- end
142
- result = sprintf("%.2fx", result)
136
+ val = result.values.first[1]
137
+ ratio = val.fdiv(worst_result)
138
+ result = sprintf("%.2fx", ratio)
143
139
  end
144
140
  length = [context.name.length, NAME_LENGTH].max
145
141
  $stdout.printf("|%*s", length, result)
@@ -98,6 +98,16 @@ module BenchmarkDriver
98
98
  end
99
99
 
100
100
  def with_clean_env(&block)
101
+ # chruby sets GEM_HOME and GEM_PATH in your shell. We have to unset it in the child
102
+ # process to avoid installing gems to the version that is running benchmark-driver.
103
+ env = nil
104
+ ['GEM_HOME', 'GEM_PATH'].each do |var|
105
+ if ENV.key?(var)
106
+ env ||= ENV.to_h
107
+ ENV.delete(var)
108
+ end
109
+ end
110
+
101
111
  unless defined?(Gem::Version)
102
112
  # default-gem Bundler can be loaded and broken with --disable-gems
103
113
  return block.call
@@ -115,6 +125,10 @@ module BenchmarkDriver
115
125
  end
116
126
  rescue LoadError
117
127
  block.call
128
+ ensure
129
+ if env
130
+ ENV.replace(env)
131
+ end
118
132
  end
119
133
  end
120
134
  end
@@ -1,3 +1,3 @@
1
1
  module BenchmarkDriver
2
- VERSION = '0.16.2'
2
+ VERSION = '0.16.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.2
4
+ version: 0.16.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-16 00:00:00.000000000 Z
11
+ date: 2023-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.3.7
150
+ rubygems_version: 3.4.10
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Fully-featured accurate benchmark driver for Ruby