maltese 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f584e6a0daeb400ae4afc532f0e42a98e2211b4b0e6764a64d92a551bf933f4
4
- data.tar.gz: 1474fc79d473c5274c738d6771697cb50ff5b6632caabbe7f5e079fe043c2af9
3
+ metadata.gz: b164d7b559b700d446fa188db4ec7709da66090345f5c7812b63a159ee37e498
4
+ data.tar.gz: e18e182c07263de4a85e6e5100d6db4657ea9b11751746c8c11ba75ab5511a78
5
5
  SHA512:
6
- metadata.gz: c97d20279a1bb40fe804bc1af2fe653d4864a60a20694008e74dacb7305331d06de304c37d2de14a1a6f851e2b5362acdab6a028b6822d95e186a651fe205ae8
7
- data.tar.gz: fe140ba2ef6c35523284fc0a36f26fc45ce449b0c9c25c0f2f31bd12f6f3d717c3f4acfea00c162a37b5be4b1735963d8c8522fcf86ad68dc996ba2aca846622
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.2
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maltese (0.8.2)
4
+ maltese (0.8.3)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  dotenv (~> 2.1, >= 2.1.1)
@@ -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, cursor: 1))
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[:cursor] do
96
- data = get_data(options.merge(timeout: timeout))
97
- options[:cursor] = data.dig("links", "next")
98
- parse_data(data)
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(options={})
105
- query_url = get_query_url(options)
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)
@@ -1,3 +1,3 @@
1
1
  module Maltese
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
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(/1 links/).to_stdout
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)