benchmark-ips 2.6.0 → 2.6.1

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: 35df2320273ed4690c943dbbda6acf1e005c8c99
4
- data.tar.gz: f41d28b189e3a1968943385cda9c67e47ff0f459
3
+ metadata.gz: 2edc0877b8b37420698e685b9db778b2bad7c094
4
+ data.tar.gz: d034c9416613ed22534e5a2e7b4da8c989313fb8
5
5
  SHA512:
6
- metadata.gz: ddbf666d2506af90fdb6d9fdc68dfd3b82935e91faffa88e1d569fcba14893d5451ad8fc202a10dd1565f9b534635b2b40bb542507ae6145bb4520a8231ef538
7
- data.tar.gz: 52f192abde81aff38251b6c5196e5115381cf76040b3ff04d64d2d029c0c230ef55e5926f1425dfed11dd99d2db6844517ebd647c597712f594679ec2ff40144
6
+ metadata.gz: f807342d963e71a638e77db1f1eeb15f1122fffc996a5e98874d7691821407000d83eba71b081fb0951ef0a6cd10f04e1c951698d0486d6b61561150c6b58631
7
+ data.tar.gz: a47ebd2708d984bdbf960ca50937021f5d2439a216cebf9ec23fe68178b4a6acfdae1e45588748ff182211311950f775c0ab5a4620ec093707c02a8bbf685e7c
@@ -0,0 +1,18 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ hoe (3.15.0)
5
+ rake (>= 0.8, < 12.0)
6
+ minitest (5.8.4)
7
+ rake (10.5.0)
8
+
9
+ PLATFORMS
10
+ ruby
11
+
12
+ DEPENDENCIES
13
+ hoe (~> 3.14)
14
+ minitest
15
+ rake (~> 10.5)
16
+
17
+ BUNDLED WITH
18
+ 1.11.2
@@ -1,4 +1,5 @@
1
1
  .autotest
2
+ Gemfile.lock
2
3
  History.txt
3
4
  Manifest.txt
4
5
  README.md
@@ -9,5 +10,6 @@ lib/benchmark/ips/job.rb
9
10
  lib/benchmark/ips/job/entry.rb
10
11
  lib/benchmark/ips/job/stdout_report.rb
11
12
  lib/benchmark/ips/report.rb
13
+ lib/benchmark/ips/share.rb
12
14
  lib/benchmark/timing.rb
13
15
  test/test_benchmark_ips.rb
@@ -13,7 +13,7 @@ module Benchmark
13
13
  module IPS
14
14
 
15
15
  # Benchmark-ips Gem version.
16
- VERSION = "2.6.0"
16
+ VERSION = "2.6.1"
17
17
 
18
18
  # CODENAME of current version.
19
19
  CODENAME = "Sharing is Caring"
@@ -0,0 +1,48 @@
1
+ require 'net/http'
2
+ require 'net/https'
3
+ require 'json'
4
+
5
+ module Benchmark
6
+ module IPS
7
+ class Share
8
+ DEFAULT_URL = "https://benchmark.fyi"
9
+ def initialize(report, job)
10
+ @report = report
11
+ @job = job
12
+ end
13
+
14
+ def share
15
+ base = (ENV['SHARE_URL'] || DEFAULT_URL)
16
+ url = URI(File.join(base, "reports"))
17
+
18
+ req = Net::HTTP::Post.new(url)
19
+
20
+ data = {
21
+ "entries" => @report.data,
22
+ "options" => {
23
+ "compare" => @job.compare?
24
+ }
25
+ }
26
+
27
+ req.body = JSON.generate(data)
28
+
29
+ http = Net::HTTP.new(url.hostname, url.port)
30
+ if url.scheme == "https"
31
+ http.use_ssl = true
32
+ http.ssl_version = :TLSv1_2
33
+ end
34
+
35
+ res = http.start do |h|
36
+ h.request req
37
+ end
38
+
39
+ if Net::HTTPOK === res
40
+ data = JSON.parse res.body
41
+ puts "Shared at: #{File.join(base, data["id"])}"
42
+ else
43
+ puts "Error sharing report"
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-ips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
@@ -63,6 +63,7 @@ extra_rdoc_files:
63
63
  - README.md
64
64
  files:
65
65
  - ".autotest"
66
+ - Gemfile.lock
66
67
  - History.txt
67
68
  - Manifest.txt
68
69
  - README.md
@@ -73,6 +74,7 @@ files:
73
74
  - lib/benchmark/ips/job/entry.rb
74
75
  - lib/benchmark/ips/job/stdout_report.rb
75
76
  - lib/benchmark/ips/report.rb
77
+ - lib/benchmark/ips/share.rb
76
78
  - lib/benchmark/timing.rb
77
79
  - test/test_benchmark_ips.rb
78
80
  homepage: https://github.com/evanphx/benchmark-ips