maltese 0.8.2 → 0.8.3
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/Dockerfile +1 -1
- data/Gemfile.lock +1 -1
- data/lib/maltese/sitemap.rb +10 -9
- data/lib/maltese/version.rb +1 -1
- data/spec/cli_spec.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Maltese_CLI/sitemap/should_succeed.yml +19 -19
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/get_data/should_report_if_there_are_works_returned_by_the_Datacite_REST_API.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/get_total/with_works.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/push_data/should_report_if_there_are_no_works_returned_by_the_Datacite_REST_API.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/push_data/should_report_if_there_are_works_returned_by_the_Datacite_REST_API.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Maltese_Sitemap/queue_jobs/should_report_if_there_are_works_returned_by_the_Datacite_REST_API.yml +20 -20
- data/spec/sitemap_spec.rb +3 -3
- 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: b164d7b559b700d446fa188db4ec7709da66090345f5c7812b63a159ee37e498
|
4
|
+
data.tar.gz: e18e182c07263de4a85e6e5100d6db4657ea9b11751746c8c11ba75ab5511a78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fed1c2951942238010cbfdeca20b1de77174037868052fdf80b9f9c95d7a6a1aab4a2d18fc9e895185157346e549098ff06f095ffc82cb0e7085d442bc413fac
|
7
|
+
data.tar.gz: e610158f1267a2f4dac264c70383a3734a881298e1f05e1dd9baf424a3a34e099b57dc186c355ee4f0e74a998972d65f5d11541d3e6f9d4e775da7d3c054815d
|
data/Dockerfile
CHANGED
@@ -11,6 +11,6 @@ RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" &&
|
|
11
11
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
12
12
|
|
13
13
|
# Install maltese gem
|
14
|
-
RUN /sbin/setuser app gem install maltese -v 0.8.
|
14
|
+
RUN /sbin/setuser app gem install maltese -v 0.8.3
|
15
15
|
|
16
16
|
CMD maltese sitemap --sitemap_bucket $SITEMAP_BUCKET
|
data/Gemfile.lock
CHANGED
data/lib/maltese/sitemap.rb
CHANGED
@@ -61,7 +61,7 @@ module Maltese
|
|
61
61
|
total = get_total(options)
|
62
62
|
|
63
63
|
if total > 0
|
64
|
-
puts process_data(options.merge(total: total,
|
64
|
+
puts process_data(options.merge(total: total, url: get_query_url))
|
65
65
|
else
|
66
66
|
puts "No works found."
|
67
67
|
end
|
@@ -92,19 +92,20 @@ module Maltese
|
|
92
92
|
options[:start_time] = Time.now
|
93
93
|
|
94
94
|
# walk through paginated results
|
95
|
-
while options[:
|
96
|
-
|
97
|
-
|
98
|
-
|
95
|
+
while options[:url] do
|
96
|
+
response = get_data(options[:url])
|
97
|
+
parse_data(response)
|
98
|
+
options[:url] = response.body.dig("links", "next")
|
99
|
+
|
100
|
+
# don't loop when testing
|
101
|
+
break if ENV['RACK'] == "test"
|
99
102
|
end
|
100
103
|
|
101
104
|
push_data(options)
|
102
105
|
end
|
103
106
|
|
104
|
-
def get_data(
|
105
|
-
|
106
|
-
|
107
|
-
Maremma.get(query_url, options)
|
107
|
+
def get_data(url)
|
108
|
+
Maremma.get(url)
|
108
109
|
end
|
109
110
|
|
110
111
|
def parse_data(result)
|
data/lib/maltese/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe Maltese::CLI do
|
|
12
12
|
describe "sitemap", vcr: true, :order => :defined do
|
13
13
|
it 'should succeed' do
|
14
14
|
subject.options = cli_options
|
15
|
-
expect { subject.sitemap }.to output(/
|
15
|
+
expect { subject.sitemap }.to output(/1001 links/).to_stdout
|
16
16
|
sitemap = Zlib::GzipReader.open("public/sitemaps/sitemap.xml.gz") { |gz| gz.read }
|
17
17
|
doc = Nokogiri::XML(sitemap)
|
18
18
|
expect(doc.xpath("//xmlns:url").size).to eq(1001)
|