testscore 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/testscore.rb +9 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f161f02bf494876095f154c46241422853916a191b9075506d20ec470ae4c449
4
- data.tar.gz: e4d7fc847b1f4713cf013f8dff689cbadd26534087d4e48eda89c4860efc4c49
3
+ metadata.gz: 5d63551aaefa042f8d0a6013a3a06bdd987c36bb120a3017ff40a9349526063a
4
+ data.tar.gz: 8b870d1ae8065a16db8e97c8a86d5fd1687b52280f44ab939f71a121d5821287
5
5
  SHA512:
6
- metadata.gz: 87eac76b9ff895049e25c65ff366a286a08b5c2f8069d3f7d157d6a859363cc044e8e0c373b55c3c0e0a201f1b6d44c4925d484b1695d0dd814a029b91a5a392
7
- data.tar.gz: c284ca6f9cfe2e625cdf1bed8731ecf9b84a78415d20f603dcc38c9a2dce37e384469c597686d4be99666bf4d9d0853b9403a2b11eceac4d54928c20c1b54413
6
+ metadata.gz: 41319a64b799e0934ef33ee0b7cfd268cf829e04bc8f42572c7ec4d41c3d436841d21300438dc12d19a2b017ec0fb0a5f6a56a0d836cdf6578ea4c6b828a0826
7
+ data.tar.gz: f043087d0f4751785372bad8aa436f689daa582ffb4756459cf8082a9376daa4dd2976c82e44e036a7c6e7a9b4a28219f0f7165d26621aaa0a281531617960d1
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'zlib'
2
3
  require 'net/http'
3
4
 
4
5
  module ActiveRecord
@@ -63,8 +64,14 @@ module TestScore
63
64
  puts "\n\nReporting test suite performance to TestScore."
64
65
  host = ENV.fetch('TESTSCORE_REPORT_HOST', 'https://testscore.io')
65
66
  uri = URI("#{host}/results/#{@api_key}")
66
- req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
67
- req.body = { examples: @results }.to_json
67
+ req = Net::HTTP::Post.new(
68
+ uri,
69
+ 'Content-Type' => 'application/json',
70
+ 'Content-Encoding' => 'gzip',
71
+ )
72
+ gzip = Zlib::GzipWriter.new(StringIO.new)
73
+ gzip << { examples: @results }.to_json
74
+ req.body = gzip.close.string
68
75
  http = Net::HTTP.new(uri.host, uri.port)
69
76
  http.use_ssl = (uri.scheme == "https")
70
77
  http.request(req)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testscore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TestScore