benchmark-ips 2.8.3 → 2.8.4

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: 4bd1437bad08cae3326e3598e00e6de5cc934ed419030cfff810fe3b213de495
4
- data.tar.gz: 56b66543830a961b3e960b290205cb80d41229fb1bf5964d223f0af8438d1587
3
+ metadata.gz: 574d0cb84279e02316df55c8d96f396b2a10301b15639ede54198eb278fd6ba2
4
+ data.tar.gz: d4ddabd9c093fd2c9559870818543d105c6fb2bbf3d38ad397b3bdf0df691397
5
5
  SHA512:
6
- metadata.gz: c8c7375472f21ef4403327d993cc71c9b000390507a69dfaeac60b3a149a60059bfd28f3aace273ffdb81c069084d091d67154bc77a72f0402d92f21da4568db
7
- data.tar.gz: 1edd46fee8de839431b479d7dfaa01ac95b0a7d620cb85494ca6262786b87dc372df96eb9eff7ddced14e0b6e3168bc282687a8cd2653b557cb947665a615568
6
+ metadata.gz: 701868e1d0e33101daaf7e5005245b327dbf3b3d02fb19a8e89eb39563540b5ca5b1ff91c4e3cd4bd9dd54f97537ca48e668608742ee0569a13336818ddfef23
7
+ data.tar.gz: a032682bd26691ad5d4a837ba956b9acf50e45c69036e07bdda347791f78bf388cb3339873fd6d5ca9cbf6edeec5090c15ae6fa56a712f6d0f0340729ce8e792
@@ -1,3 +1,8 @@
1
+ === 2.8.4 / 2020-12-03
2
+
3
+ * Bug fix
4
+ * Fixed hold! when results file does not exist.
5
+
1
6
  === 2.8.3 / 2020-08-28
2
7
 
3
8
  * Bug fix
@@ -16,7 +16,7 @@ module Benchmark
16
16
  module IPS
17
17
 
18
18
  # Benchmark-ips Gem version.
19
- VERSION = "2.8.3"
19
+ VERSION = "2.8.4"
20
20
 
21
21
  # CODENAME of current version.
22
22
  CODENAME = "Tardy Turtle"
@@ -188,7 +188,7 @@ module Benchmark
188
188
  end
189
189
 
190
190
  def load_held_results
191
- return unless @held_path && !File.zero?(@held_path)
191
+ return unless @held_path && File.exist?(@held_path) && !File.zero?(@held_path)
192
192
  require "json"
193
193
  @held_results = {}
194
194
  JSON.load(IO.read(@held_path)).each do |result|
@@ -1,6 +1,7 @@
1
1
  require "minitest/autorun"
2
2
  require "benchmark/ips"
3
3
  require "stringio"
4
+ require "tmpdir"
4
5
 
5
6
  class TestBenchmarkIPS < Minitest::Test
6
7
  def setup
@@ -182,4 +183,17 @@ class TestBenchmarkIPS < Minitest::Test
182
183
  assert data[0]["ips"]
183
184
  assert data[0]["stddev"]
184
185
  end
186
+
187
+ def test_hold!
188
+ temp_file_name = Dir::Tmpname.create(["benchmark-ips", ".tmp"]) { }
189
+
190
+ Benchmark.ips(:time => 0.001, :warmup => 0.001) do |x|
191
+ x.report("operation") { 100 * 100 }
192
+ x.report("operation2") { 100 * 100 }
193
+ x.hold! temp_file_name
194
+ end
195
+
196
+ assert File.exist?(temp_file_name)
197
+ File.unlink(temp_file_name)
198
+ end
185
199
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-ips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.3
4
+ version: 2.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-28 00:00:00.000000000 Z
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  requirements: []
110
- rubygems_version: 3.1.2
110
+ rubygems_version: 3.1.4
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: An iterations per second enhancement to Benchmark.