commonmeta-ruby 3.0.5 → 3.0.7

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: c95cbf53a27529abcef8b642be1808abe1ef14e0743e3659e034c56a63391c44
4
- data.tar.gz: dd32ed83707428d77f567d3810f7581cdffe49493afa58b2a83d7ee36189ebee
3
+ metadata.gz: a8554b09a4a7efef4be8b21703eec6013c56b679b3cd84b1c82f1e3c7c8747ae
4
+ data.tar.gz: cb597fd50b0ba17d9e379344aa2c84647e0eb32829676def9e63356bdb415a4c
5
5
  SHA512:
6
- metadata.gz: 925069193052d9443ae9af6f1f91e0a96d9cf4cc67c7717f08fad06c4f24a9725c654db67036f4a2a644dcbec9f578924838483d541830059a42e3ee3bf0dfc1
7
- data.tar.gz: 8b7fa15309cfa4eeb2333c5ac1b40c1b872df06e5f7bdfe988959900f11a2b3f8ccd7e797e68439c12d0709a0257b26590a7ddcee58915998f529c40fbc60b35
6
+ metadata.gz: 2e4907bf337d9296440b40fbeaa6d97f2da4125f83b649db9787d1e220ee70d53d1dcf57739e2dcf0653b01261f512291e34ba4d4905fbf7f59864878daa90ad
7
+ data.tar.gz: 9328e0618e95c59dc8e2e0d61238fc2a2de9cc0cd2210619e5a797f0742d26d4360e2cecdb47ac318f749f073b5a8919606773f16398df61fc983c016c247922
data/.gitignore CHANGED
@@ -10,6 +10,9 @@
10
10
  /test/version_tmp/
11
11
  /tmp/
12
12
 
13
+ # Used by dotenv library to load environment variables.
14
+ .env
15
+
13
16
  ## Specific to RubyMotion:
14
17
  .dat*
15
18
  .repl_history
data/Gemfile.lock CHANGED
@@ -1,13 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- commonmeta-ruby (3.0.5)
4
+ commonmeta-ruby (3.0.7)
5
5
  activesupport (>= 4.2.5, < 8.0)
6
+ addressable (~> 2.8.1, < 2.8.2)
6
7
  base32-url (>= 0.5.0, < 1)
7
8
  bibtex-ruby (~> 6.0)
8
9
  builder (~> 3.2, >= 3.2.4)
9
10
  citeproc-ruby (~> 2.0)
10
11
  csl-styles (~> 2.0)
12
+ dotenv (~> 2.1, >= 2.1.1)
11
13
  edtf (~> 3.0, >= 3.0.4)
12
14
  gender_detector (~> 2.0)
13
15
  http (~> 5.1, >= 5.1.1)
@@ -56,6 +58,7 @@ GEM
56
58
  docile (1.4.0)
57
59
  domain_name (0.5.20190701)
58
60
  unf (>= 0.0.5, < 1.0.0)
61
+ dotenv (2.8.1)
59
62
  ebnf (2.3.2)
60
63
  htmlentities (~> 4.3)
61
64
  rdf (~> 3.2)
@@ -71,8 +74,9 @@ GEM
71
74
  ffi (>= 1.0.0)
72
75
  rake
73
76
  gender_detector (2.0.0)
74
- haml (5.2.2)
75
- temple (>= 0.8.0)
77
+ haml (6.1.1)
78
+ temple (>= 0.8.2)
79
+ thor
76
80
  tilt
77
81
  hana (1.3.7)
78
82
  hashdiff (1.0.1)
@@ -112,7 +116,7 @@ GEM
112
116
  llhttp-ffi (0.4.0)
113
117
  ffi-compiler (~> 1.0)
114
118
  rake (~> 13.0)
115
- loofah (2.19.1)
119
+ loofah (2.20.0)
116
120
  crass (~> 1.0.2)
117
121
  nokogiri (>= 1.5.9)
118
122
  matrix (0.4.2)
@@ -124,7 +128,7 @@ GEM
124
128
  oj (3.14.2)
125
129
  optimist (3.0.1)
126
130
  parallel (1.22.1)
127
- parser (3.2.1.1)
131
+ parser (3.2.2.0)
128
132
  ast (~> 2.4.1)
129
133
  postrank-uri (1.1)
130
134
  addressable (>= 2.4.0)
@@ -141,8 +145,8 @@ GEM
141
145
  link_header (~> 0.0, >= 0.0.8)
142
146
  rdf-aggregate-repo (3.2.1)
143
147
  rdf (~> 3.2)
144
- rdf-rdfa (3.2.0)
145
- haml (~> 5.2)
148
+ rdf-rdfa (3.2.1)
149
+ haml (>= 5.2, < 7)
146
150
  htmlentities (~> 4.3)
147
151
  rdf (~> 3.2)
148
152
  rdf-aggregate-repo (~> 3.2)
@@ -156,7 +160,7 @@ GEM
156
160
  rdf-turtle (3.2.1)
157
161
  ebnf (~> 2.3)
158
162
  rdf (~> 3.2)
159
- rdf-vocab (3.2.3)
163
+ rdf-vocab (3.2.4)
160
164
  rdf (~> 3.2, >= 3.2.4)
161
165
  rdf-xsd (3.2.1)
162
166
  rdf (~> 3.2)
@@ -172,24 +176,24 @@ GEM
172
176
  rspec-expectations (3.12.2)
173
177
  diff-lcs (>= 1.2.0, < 2.0)
174
178
  rspec-support (~> 3.12.0)
175
- rspec-mocks (3.12.4)
179
+ rspec-mocks (3.12.5)
176
180
  diff-lcs (>= 1.2.0, < 2.0)
177
181
  rspec-support (~> 3.12.0)
178
182
  rspec-support (3.12.0)
179
183
  rspec-xsd (0.1.0)
180
184
  nokogiri (~> 1.6)
181
185
  rspec (~> 3)
182
- rubocop (1.48.1)
186
+ rubocop (1.49.0)
183
187
  json (~> 2.3)
184
188
  parallel (~> 1.10)
185
189
  parser (>= 3.2.0.0)
186
190
  rainbow (>= 2.2.2, < 4.0)
187
191
  regexp_parser (>= 1.8, < 3.0)
188
192
  rexml (>= 3.2.5, < 4.0)
189
- rubocop-ast (>= 1.26.0, < 2.0)
193
+ rubocop-ast (>= 1.28.0, < 2.0)
190
194
  ruby-progressbar (~> 1.7)
191
195
  unicode-display_width (>= 2.4.0, < 3.0)
192
- rubocop-ast (1.27.0)
196
+ rubocop-ast (1.28.0)
193
197
  parser (>= 3.2.1.0)
194
198
  rubocop-capybara (2.17.1)
195
199
  rubocop (~> 1.41)
data/commonmeta.gemspec CHANGED
@@ -19,11 +19,13 @@ Gem::Specification.new do |s|
19
19
 
20
20
  # Declare dependencies here, rather than in the Gemfile
21
21
  s.add_dependency 'activesupport', '>= 4.2.5', '< 8.0'
22
+ s.add_dependency 'addressable', '~> 2.8.1', '< 2.8.2'
22
23
  s.add_dependency 'base32-url', '>= 0.5.0', '< 1'
23
24
  s.add_dependency 'bibtex-ruby', '~> 6.0'
24
25
  s.add_dependency 'builder', '~> 3.2', '>= 3.2.4'
25
26
  s.add_dependency 'citeproc-ruby', '~> 2.0'
26
27
  s.add_dependency 'csl-styles', '~> 2.0'
28
+ s.add_dependency 'dotenv', '~> 2.1', '>= 2.1.1'
27
29
  s.add_dependency 'edtf', '~> 3.0', '>= 3.0.4'
28
30
  s.add_dependency 'gender_detector', '~> 2.0'
29
31
  s.add_dependency 'http', '~> 5.1', '>= 5.1.1'
@@ -61,12 +61,24 @@ module Commonmeta
61
61
  puts encode_doi(prefix)
62
62
  end
63
63
 
64
+ desc '', 'encode_id'
65
+
66
+ def encode_id
67
+ puts encode_id
68
+ end
69
+
64
70
  desc '', 'decode'
65
71
 
66
72
  def decode(doi)
67
73
  puts decode_doi(doi)
68
74
  end
69
75
 
76
+ desc '', 'decode_id'
77
+
78
+ def decode_id(id)
79
+ puts decode_id(id)
80
+ end
81
+
70
82
  default_task :convert
71
83
  end
72
84
  end
@@ -2,8 +2,9 @@
2
2
 
3
3
  module Commonmeta
4
4
  module CrossrefUtils
5
- # To configure the writing of Crossref metadata, provide the following variables
6
- # depositor, email, and registrant
5
+ # To configure the writing of Crossref metadata, use environmental
6
+ # variables CROSSREF_DEPOSITOR_NAME, CROSSREF_DEPOSITOR_EMAIL and CROSSREF_REGISTRANT,
7
+ # e.g. in a .env file
7
8
  def write_crossref_xml
8
9
  @crossref_xml ||= Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
9
10
  xml.doi_batch(crossref_root_attributes) do
@@ -12,10 +13,10 @@ module Commonmeta
12
13
  xml.doi_batch_id(SecureRandom.uuid)
13
14
  xml.timestamp(Time.now.utc.strftime('%Y%m%d%H%M%S'))
14
15
  xml.depositor do
15
- xml.depositor_name(depositor)
16
- xml.email_address(email)
16
+ xml.depositor_name(ENV.fetch('CROSSREF_DEPOSITOR_NAME', nil))
17
+ xml.email_address(ENV.fetch('CROSSREF_DEPOSITOR_EMAIL', nil))
17
18
  end
18
- xml.registrant(registrant)
19
+ xml.registrant(ENV.fetch('CROSSREF_REGISTRANT', nil))
19
20
  end
20
21
  xml.body do
21
22
  insert_crossref_work(xml)