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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/maremma.rb +1 -1
- data/lib/maremma/version.rb +1 -1
- data/spec/maremma_spec.rb +17 -17
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 812d9d624b11d65e0e4de04c4eb8de717a1ba060dc0ee25c362f4a659a04f658
|
|
4
|
+
data.tar.gz: 99914ece6614328bce7e0677919bbfd68f1f8eae75ea907ef22721b6506d8129
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
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
|
-
|
|
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
|
data/lib/maremma/version.rb
CHANGED
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|