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 +4 -4
- data/Gemfile.lock +18 -0
- data/Manifest.txt +2 -0
- data/lib/benchmark/ips.rb +1 -1
- data/lib/benchmark/ips/share.rb +48 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2edc0877b8b37420698e685b9db778b2bad7c094
|
4
|
+
data.tar.gz: d034c9416613ed22534e5a2e7b4da8c989313fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f807342d963e71a638e77db1f1eeb15f1122fffc996a5e98874d7691821407000d83eba71b081fb0951ef0a6cd10f04e1c951698d0486d6b61561150c6b58631
|
7
|
+
data.tar.gz: a47ebd2708d984bdbf960ca50937021f5d2439a216cebf9ec23fe68178b4a6acfdae1e45588748ff182211311950f775c0ab5a4620ec093707c02a8bbf685e7c
|
data/Gemfile.lock
ADDED
data/Manifest.txt
CHANGED
@@ -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
|
data/lib/benchmark/ips.rb
CHANGED
@@ -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.
|
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
|