maltese 0.8.15 → 0.9.0

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: 47f0ba0813eeed3c56a5636d34acbb9bc3349cef65513b3a834c05dcda19bc08
4
- data.tar.gz: 6ecb5ff42d4759e07c7632420aa78a81284a57ebba7aeca9d2747218e0d78297
3
+ metadata.gz: c055f201fbb1897c52f01b81a3a2ba65702266a331ca3b4484ac757499ae267c
4
+ data.tar.gz: aa1443e00f56188003e1194340d92192e10d6e996fd0424920db7768d079ea4c
5
5
  SHA512:
6
- metadata.gz: 05aedc2d77881876ac08bf9f11a2796220619e06e128209f83600758d5c5c5448a47db3b7a25f67870b1ceaba63ea5c840958c2f5fa1ad85666280b285362306
7
- data.tar.gz: c15bcefd230f7839556345f455879c702ed25a06368410d9e6e1bc72a86885b4cb06fdb8ddb03f5c3a21be605339834da56c21ef2c91fc39f8588fa45e84e483
6
+ metadata.gz: 20cff31e196123eb7b4c8b66a22dd39865c335919fea0c73bdfb832e00fde48bcd10ea38ba8091d66a6a0d504819946f03067a0d9a44d1da2306b9b256e3e8d3
7
+ data.tar.gz: 1b1deb4d8ad8218992a3b85dadfea96c97cbc7fda4ebcb65d165fd5d5afd8873d7e218ac9f08190dc13ca2583fdbaa0241959c408698f6c17e095a95e5b0028a
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.15
14
+ RUN /sbin/setuser app gem install maltese -v 0.9.0
15
15
 
16
16
  CMD maltese sitemap --sitemap_bucket $SITEMAP_BUCKET --rack_env $RACK_ENV --access_key $AWS_ACCESS_KEY_ID --secret_key $AWS_SECRET_ACCESS_KEY --region $AWS_REGION
data/Gemfile.lock CHANGED
@@ -1,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maltese (0.8.15)
4
+ maltese (0.9.0)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  aws-sdk-s3 (~> 1.19)
7
7
  dotenv (~> 2.1, >= 2.1.1)
8
8
  faraday (= 0.17.0)
9
+ logger (~> 1.4.2)
9
10
  maremma (~> 4.1)
10
11
  mime-types (~> 3.1)
11
12
  sitemap_generator (~> 6.0)
@@ -58,6 +59,7 @@ GEM
58
59
  concurrent-ruby (~> 1.0)
59
60
  jmespath (1.4.0)
60
61
  json (2.2.0)
62
+ logger (1.4.2)
61
63
  maremma (4.4)
62
64
  activesupport (>= 4.2.5, < 6)
63
65
  addressable (>= 2.3.6)
data/README.md CHANGED
@@ -8,7 +8,7 @@ Ruby gem and command-line tool for generating sitemap files from the DataCite RE
8
8
 
9
9
  Run as a command-line tool:
10
10
 
11
- ```
11
+ ```ruby
12
12
  maltese sitemap
13
13
  ```
14
14
 
@@ -33,7 +33,7 @@ gem install maltese
33
33
 
34
34
  We use rspec for unit testing:
35
35
 
36
- ```
36
+ ```ruby
37
37
  bundle exec rspec
38
38
  ```
39
39
 
@@ -48,4 +48,5 @@ Follow along via [Github Issues](https://github.com/datacite/toccatore/issues).
48
48
  * Commit, push and make a pull request. Bonus points for topical branches.
49
49
 
50
50
  ## License
51
+
51
52
  **maltese** is released under the [MIT License](https://github.com/datacite/maltese/blob/master/LICENSE.md).
@@ -1,6 +1,8 @@
1
+ require "logger"
2
+
1
3
  module Maltese
2
4
  class Sitemap
3
- attr_reader :sitemap_bucket, :rack_env, :access_key, :secret_key, :region
5
+ attr_reader :sitemap_bucket, :rack_env, :access_key, :secret_key, :region, :logger
4
6
 
5
7
  # load ENV variables from .env file if it exists
6
8
  env_file = File.expand_path("../../../.env", __FILE__)
@@ -23,6 +25,8 @@ module Maltese
23
25
  @access_key = attributes[:access_key].presence || ENV['AWS_ACCESS_KEY_ID']
24
26
  @secret_key = attributes[:secret_key].presence || ENV['AWS_SECRET_ACCESS_KEY']
25
27
  @region = attributes[:region].presence || ENV['AWS_REGION']
28
+
29
+ @logger = Logger.new(STDOUT)
26
30
  end
27
31
 
28
32
  def sitemap_url
@@ -65,11 +69,11 @@ module Maltese
65
69
  total = get_total(options)
66
70
 
67
71
  if total.nil?
68
- puts "An error occured."
72
+ logger.error "An error occured."
69
73
  elsif total > 0
70
74
  process_data(options.merge(total: total, url: get_query_url))
71
75
  else
72
- puts "No works found."
76
+ logger.info "No works found."
73
77
  end
74
78
 
75
79
  # return number of works queued
@@ -105,11 +109,11 @@ module Maltese
105
109
 
106
110
  if response.status == 200
107
111
  link_count += parse_data(response)
108
- puts "#{link_count} DOIs parsed."
112
+ logger.info "#{link_count} DOIs parsed."
109
113
  options[:url] = response.body.dig("links", "next")
110
114
  else
111
- puts "An error occured for URL #{options[:url]}."
112
- puts "Error message: #{response.body.fetch("errors").inspect}" if response.body.fetch("errors", nil).present?
115
+ logger.error "An error occured for URL #{options[:url]}."
116
+ logger.error "Error message: #{response.body.fetch("errors").inspect}" if response.body.fetch("errors", nil).present?
113
117
  error_count += 1
114
118
  options[:url] = nil
115
119
  end
@@ -1,3 +1,3 @@
1
1
  module Maltese
2
- VERSION = "0.8.15"
2
+ VERSION = "0.9.0"
3
3
  end
data/maltese.gemspec CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  # Declary dependencies here, rather than in the Gemfile
18
18
  s.add_dependency 'maremma', '~> 4.1'
19
19
  s.add_dependency 'faraday', '0.17.0'
20
+ s.add_dependency 'logger', '~> 1.4.2'
20
21
  s.add_dependency 'activesupport', '>= 4.2.5', '< 6'
21
22
  s.add_dependency 'dotenv', '~> 2.1', '>= 2.1.1'
22
23
  s.add_dependency 'thor', '~> 0.19'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maltese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.15
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.17.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: logger
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.4.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.4.2
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: activesupport
43
57
  requirement: !ruby/object:Gem::Requirement