maremma 4.9.3 → 4.9.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: b434f52f03f14c1210e58fe2b47d9abd29fb7195a9691617109552368f42c70d
4
- data.tar.gz: 21d34076acf4a146965fa8a0b3b70f151f8d74cbf18e925e8ed79aaa518ecc19
3
+ metadata.gz: 812d9d624b11d65e0e4de04c4eb8de717a1ba060dc0ee25c362f4a659a04f658
4
+ data.tar.gz: 99914ece6614328bce7e0677919bbfd68f1f8eae75ea907ef22721b6506d8129
5
5
  SHA512:
6
- metadata.gz: 4008b8df539b95e01ab7bc2ae52e81dfd1675acaae2156932a4101443d238f743cf018bd0c5f2b328c442d214002a827b5f6898ddb71ab0b3a271c9ef80281d6
7
- data.tar.gz: 70736b2bcdbac3ebbe4f305a17f510b7ec97c928a32cb2c5925ffbe029f5b1887e34b36bdc0d1dddb35cda34a5b5827bc8a912db1ef8e5a5c3a084289864326e
6
+ metadata.gz: 77aeaaecdedf584cfdc84240ac199f2a1c87c289248869ed3fbf215dfe05e634b21ac1f48a911f6505d4c5b301454489e3de27f991737490c618ec6b188116a9
7
+ data.tar.gz: 4e0077762347ef7f2ab8a3bd91ee059e488bbc1674b8d5d1985070b44bc21493a63f5dd3ca395b95b045906f8c3335ba96b50e9e23400a27cdea80ccfef8f309
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.9.3](https://github.com/datacite/maremma/tree/4.9.3) (2021-06-07)
4
+
5
+ [Full Changelog](https://github.com/datacite/maremma/compare/4.9.2...4.9.3)
6
+
3
7
  ## [4.9.2](https://github.com/datacite/maremma/tree/4.9.2) (2021-06-07)
4
8
 
5
9
  [Full Changelog](https://github.com/datacite/maremma/compare/4.9.1...4.9.2)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maremma (4.9.3)
4
+ maremma (4.9.4)
5
5
  activesupport (>= 4.2.5)
6
6
  addressable (>= 2.3.6)
7
7
  builder (~> 3.2, >= 3.2.2)
data/lib/maremma.rb CHANGED
@@ -130,7 +130,7 @@ module Maremma
130
130
  c.headers["Accept"] = options[:headers]["Accept"]
131
131
  c.headers["User-Agent"] = options[:headers]["User-Agent"]
132
132
  c.use FaradayMiddleware::FollowRedirects, limit: limit, cookie: :all if limit > 0
133
- # c.use FaradayMiddleware::Gzip
133
+ c.use FaradayMiddleware::Gzip
134
134
  c.request :multipart
135
135
  c.request :json if options[:headers]["Accept"] == "application/json"
136
136
  c.response :encoding
@@ -1,3 +1,3 @@
1
1
  module Maremma
2
- VERSION = "4.9.3".freeze
2
+ VERSION = "4.9.4".freeze
3
3
  end
data/spec/maremma_spec.rb CHANGED
@@ -78,20 +78,20 @@ describe Maremma do
78
78
  expect(stub).to have_been_requested
79
79
  end
80
80
 
81
- # it "get json compressed", vcr: true do
82
- # response = subject.get("https://api.datacite.org/works", :headers => { "Content-Type" => "application/json", "Accept-Encoding" => "gzip"})
83
- # expect(response.body["data"].length).to eq(25)
84
- # end
81
+ it "get json compressed", vcr: true do
82
+ response = subject.get("https://api.datacite.org/works", headers: { "Content-Type" => "application/json", "Accept-Encoding" => "gzip" })
83
+ expect(response.body["data"].length).to eq(25)
84
+ end
85
85
 
86
- # it "get html compressed", vcr: true do
87
- # response = subject.get("https://datacite.org/", :headers => {"Accept-Encoding" => "gzip"})
88
- # expect(response.body["data"]).to include("html")
89
- # end
86
+ it "get html compressed", vcr: true do
87
+ response = subject.get("https://datacite.org/", headers: { "Accept-Encoding" => "gzip" })
88
+ expect(response.body["data"]).to include("html")
89
+ end
90
90
 
91
- # it "get xml compressed", vcr: true do
92
- # response = subject.get("https://data.crosscite.org/application/vnd.datacite.datacite+xml/10.5061/dryad.8515", :headers => { "Accept-Encoding" => "gzip"})
93
- # expect(response.body["data"]).to be_a(Hash)
94
- # end
91
+ it "get xml compressed", vcr: true do
92
+ response = subject.get("https://data.crosscite.org/application/vnd.datacite.datacite+xml/10.5061/dryad.8515", headers: { "Accept-Encoding" => "gzip" })
93
+ expect(response.body["data"]).to be_a(Hash)
94
+ end
95
95
  end
96
96
 
97
97
  context "head" do
@@ -99,7 +99,7 @@ describe Maremma do
99
99
  stub = stub_request(:head, url).to_return(status: 200, headers: { "Content-Type" => "text/html" })
100
100
  response = subject.head(url, accept: "html")
101
101
  expect(response.body).to be_nil
102
- expect(response.headers).to eq("Content-Type" => "text/html")
102
+ expect(response.headers).to eq("Content-Length" => 0, "Content-Type" => "text/html")
103
103
  expect(stub).to have_been_requested
104
104
  end
105
105
  end
@@ -151,7 +151,7 @@ describe Maremma do
151
151
  stub = stub_request(:get, url).to_return(body: nil, status: 200, headers: { "Content-Type" => "application/json" })
152
152
  response = subject.get(url)
153
153
  expect(response.body).to eq("data" => nil)
154
- expect(response.headers).to eq("Content-Type" => "application/json")
154
+ expect(response.headers).to eq("Content-Length" => 0, "Content-Type" => "application/json")
155
155
  expect(stub).to have_been_requested
156
156
  end
157
157
 
@@ -159,7 +159,7 @@ describe Maremma do
159
159
  stub = stub_request(:get, url).to_return(body: nil, status: 200, headers: { "Content-Type" => "application/xml" })
160
160
  response = subject.get(url, accept: "xml")
161
161
  expect(response.body).to eq("data" => nil)
162
- expect(response.headers).to eq("Content-Type" => "application/xml")
162
+ expect(response.headers).to eq("Content-Length" => 0, "Content-Type" => "application/xml")
163
163
  expect(stub).to have_been_requested
164
164
  end
165
165
 
@@ -167,7 +167,7 @@ describe Maremma do
167
167
  stub = stub_request(:get, url).to_return(body: nil, status: 200, headers: { "Content-Type" => "text/html" })
168
168
  response = subject.get(url, accept: "html")
169
169
  expect(response.body).to eq("data" => nil)
170
- expect(response.headers).to eq("Content-Type" => "text/html")
170
+ expect(response.headers).to eq("Content-Length" => 0, "Content-Type" => "text/html")
171
171
  expect(stub).to have_been_requested
172
172
  end
173
173
 
@@ -319,7 +319,7 @@ describe Maremma do
319
319
  stub = stub_request(:delete, url).to_return(status: 204, headers: { "Content-Type" => "text/html" })
320
320
  response = subject.delete(url)
321
321
  expect(response.body).to eq("data" => nil)
322
- expect(response.headers).to eq("Content-Type" => "text/html")
322
+ expect(response.headers).to eq("Content-Length" => 0, "Content-Type" => "text/html")
323
323
  expect(response.status).to eq(204)
324
324
  expect(stub).to have_been_requested
325
325
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maremma
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.9.3
4
+ version: 4.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner