datacite-mapping 0.2.5 → 0.3.0

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +23 -11
  3. data/.ruby-version +1 -1
  4. data/CHANGES.md +5 -0
  5. data/Gemfile +2 -0
  6. data/LICENSE.md +1 -1
  7. data/README.md +2 -2
  8. data/Rakefile +5 -3
  9. data/datacite-mapping.gemspec +9 -7
  10. data/examples/reading.rb +1 -1
  11. data/examples/writing.rb +1 -0
  12. data/lib/datacite/mapping.rb +2 -0
  13. data/lib/datacite/mapping/alternate_identifier.rb +4 -2
  14. data/lib/datacite/mapping/contributor.rb +5 -3
  15. data/lib/datacite/mapping/creator.rb +6 -4
  16. data/lib/datacite/mapping/date.rb +5 -5
  17. data/lib/datacite/mapping/date_value.rb +4 -2
  18. data/lib/datacite/mapping/description.rb +5 -3
  19. data/lib/datacite/mapping/empty_filtering_nodes.rb +2 -0
  20. data/lib/datacite/mapping/funding_reference.rb +6 -4
  21. data/lib/datacite/mapping/geo_location.rb +2 -0
  22. data/lib/datacite/mapping/geo_location_box.rb +12 -10
  23. data/lib/datacite/mapping/geo_location_node.rb +9 -7
  24. data/lib/datacite/mapping/geo_location_point.rb +8 -6
  25. data/lib/datacite/mapping/geo_location_polygon.rb +3 -1
  26. data/lib/datacite/mapping/identifier.rb +9 -7
  27. data/lib/datacite/mapping/module_info.rb +5 -3
  28. data/lib/datacite/mapping/name_identifier.rb +4 -2
  29. data/lib/datacite/mapping/namespace_extensions.rb +2 -0
  30. data/lib/datacite/mapping/read_only_nodes.rb +5 -3
  31. data/lib/datacite/mapping/related_identifier.rb +5 -3
  32. data/lib/datacite/mapping/resource.rb +15 -13
  33. data/lib/datacite/mapping/resource_type.rb +3 -1
  34. data/lib/datacite/mapping/rights.rb +3 -1
  35. data/lib/datacite/mapping/subject.rb +5 -3
  36. data/lib/datacite/mapping/title.rb +5 -3
  37. data/spec/.rubocop.yml +3 -0
  38. data/spec/rspec_custom_matchers.rb +8 -8
  39. data/spec/spec_helper.rb +2 -0
  40. data/spec/unit/datacite/mapping/alternate_identifier_spec.rb +2 -0
  41. data/spec/unit/datacite/mapping/contributor_spec.rb +2 -0
  42. data/spec/unit/datacite/mapping/creator_spec.rb +2 -0
  43. data/spec/unit/datacite/mapping/date_spec.rb +2 -0
  44. data/spec/unit/datacite/mapping/date_value_spec.rb +2 -0
  45. data/spec/unit/datacite/mapping/description_spec.rb +2 -0
  46. data/spec/unit/datacite/mapping/funding_reference_spec.rb +3 -1
  47. data/spec/unit/datacite/mapping/geo_location_box_spec.rb +2 -0
  48. data/spec/unit/datacite/mapping/geo_location_point_spec.rb +2 -0
  49. data/spec/unit/datacite/mapping/geo_location_polygon_spec.rb +22 -20
  50. data/spec/unit/datacite/mapping/geo_location_spec.rb +24 -22
  51. data/spec/unit/datacite/mapping/identifier_spec.rb +8 -6
  52. data/spec/unit/datacite/mapping/name_identifier_spec.rb +2 -0
  53. data/spec/unit/datacite/mapping/related_identifier_spec.rb +2 -0
  54. data/spec/unit/datacite/mapping/resource_spec.rb +22 -18
  55. data/spec/unit/datacite/mapping/rights_spec.rb +3 -1
  56. data/spec/unit/datacite/mapping/subject_spec.rb +2 -0
  57. data/spec/unit/datacite/mapping/title_spec.rb +2 -0
  58. metadata +26 -26
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # ------------------------------------------------------------
2
4
  # SimpleCov setup
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -56,7 +58,7 @@ module Datacite
56
58
  <funderIdentifier funderIdentifierType="Crossref Funder ID">http://doi.org/10.13039/501100000780</funderIdentifier>
57
59
  <awardNumber awardURI="http://cordis.europa.eu/project/rcn/100180_en.html">282625</awardNumber>
58
60
  <awardTitle>MOTivational strength of ecosystem services and alternative ways to express the value of BIOdiversity</awardTitle>
59
- </fundingReference>'.freeze
61
+ </fundingReference>'
60
62
 
61
63
  @fref = FundingReference.parse_xml(fref_xml)
62
64
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -6,17 +8,17 @@ module Datacite
6
8
  describe '#==' do
7
9
  it 'reports equal values as equal' do
8
10
  polygon1 = GeoLocationPolygon.new(points: [
9
- GeoLocationPoint.new(-33.45, -122.33),
10
- GeoLocationPoint.new(33.45, -122.33),
11
- GeoLocationPoint.new(33.45, 122.33),
12
- GeoLocationPoint.new(-33.45, -122.33)
13
- ])
11
+ GeoLocationPoint.new(-33.45, -122.33),
12
+ GeoLocationPoint.new(33.45, -122.33),
13
+ GeoLocationPoint.new(33.45, 122.33),
14
+ GeoLocationPoint.new(-33.45, -122.33)
15
+ ])
14
16
  polygon2 = GeoLocationPolygon.new(points: [
15
- GeoLocationPoint.new(-33.45, -122.33),
16
- GeoLocationPoint.new(33.45, -122.33),
17
- GeoLocationPoint.new(33.45, 122.33),
18
- GeoLocationPoint.new(-33.45, -122.33)
19
- ])
17
+ GeoLocationPoint.new(-33.45, -122.33),
18
+ GeoLocationPoint.new(33.45, -122.33),
19
+ GeoLocationPoint.new(33.45, 122.33),
20
+ GeoLocationPoint.new(-33.45, -122.33)
21
+ ])
20
22
  expect(polygon1).to eq(polygon2)
21
23
  expect(polygon1.hash).to eq(polygon2.hash)
22
24
  expect(polygon2).to eq(polygon1)
@@ -25,17 +27,17 @@ module Datacite
25
27
 
26
28
  it 'reports unequal values as unequal' do
27
29
  polygon1 = GeoLocationPolygon.new(points: [
28
- GeoLocationPoint.new(-33.45, -122.33),
29
- GeoLocationPoint.new(33.45, -122.33),
30
- GeoLocationPoint.new(33.45, 122.33),
31
- GeoLocationPoint.new(-33.45, -122.33)
32
- ])
30
+ GeoLocationPoint.new(-33.45, -122.33),
31
+ GeoLocationPoint.new(33.45, -122.33),
32
+ GeoLocationPoint.new(33.45, 122.33),
33
+ GeoLocationPoint.new(-33.45, -122.33)
34
+ ])
33
35
  polygon2 = GeoLocationPolygon.new(points: [
34
- GeoLocationPoint.new(33.45, 122.33),
35
- GeoLocationPoint.new(-33.45, 122.33),
36
- GeoLocationPoint.new(-33.45, -122.33),
37
- GeoLocationPoint.new(33.45, 122.33)
38
- ])
36
+ GeoLocationPoint.new(33.45, 122.33),
37
+ GeoLocationPoint.new(-33.45, 122.33),
38
+ GeoLocationPoint.new(-33.45, -122.33),
39
+ GeoLocationPoint.new(33.45, 122.33)
40
+ ])
39
41
  expect(polygon1).not_to eq(polygon2)
40
42
  expect(polygon1.hash).not_to eq(polygon2.hash)
41
43
  expect(polygon2).not_to eq(polygon1)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -45,11 +47,11 @@ module Datacite
45
47
  end
46
48
  it 'accepts a polygon' do
47
49
  polygon = GeoLocationPolygon.new(points: [
48
- GeoLocationPoint.new(47.61, -122.33),
49
- GeoLocationPoint.new(-33.45, -122.33),
50
- GeoLocationPoint.new(47.61, -70.67),
51
- GeoLocationPoint.new(47.61, -122.33)
52
- ])
50
+ GeoLocationPoint.new(47.61, -122.33),
51
+ GeoLocationPoint.new(-33.45, -122.33),
52
+ GeoLocationPoint.new(47.61, -70.67),
53
+ GeoLocationPoint.new(47.61, -122.33)
54
+ ])
53
55
  loc = GeoLocation.new(polygon: polygon)
54
56
  expect(loc.polygon).to eq(polygon)
55
57
  end
@@ -106,11 +108,11 @@ module Datacite
106
108
  describe '#polygon=' do
107
109
  it 'sets the polygon' do
108
110
  polygon = GeoLocationPolygon.new(points: [
109
- GeoLocationPoint.new(47.61, -122.33),
110
- GeoLocationPoint.new(-33.45, -122.33),
111
- GeoLocationPoint.new(47.61, -70.67),
112
- GeoLocationPoint.new(47.61, -122.33)
113
- ])
111
+ GeoLocationPoint.new(47.61, -122.33),
112
+ GeoLocationPoint.new(-33.45, -122.33),
113
+ GeoLocationPoint.new(47.61, -70.67),
114
+ GeoLocationPoint.new(47.61, -122.33)
115
+ ])
114
116
  loc = GeoLocation.new
115
117
  loc.polygon = polygon
116
118
  expect(loc.polygon).to eq(polygon)
@@ -168,11 +170,11 @@ module Datacite
168
170
  expect(loc.place).to eq('Atlantic Ocean')
169
171
  actual_polygon = loc.polygon
170
172
  expected_polygon = GeoLocationPolygon.new(points: [
171
- GeoLocationPoint.new(31.233, -67.302),
172
- GeoLocationPoint.new(-68.211, -71.032),
173
- GeoLocationPoint.new(42.893, 41.09),
174
- GeoLocationPoint.new(31.233, -67.302)
175
- ])
173
+ GeoLocationPoint.new(31.233, -67.302),
174
+ GeoLocationPoint.new(-68.211, -71.032),
175
+ GeoLocationPoint.new(42.893, 41.09),
176
+ GeoLocationPoint.new(31.233, -67.302)
177
+ ])
176
178
  expect(actual_polygon).to eq(expected_polygon)
177
179
  end
178
180
 
@@ -196,12 +198,12 @@ module Datacite
196
198
  point: GeoLocationPoint.new(31.233, -67.302),
197
199
  box: GeoLocationBox.new(41.09, -71.032, 42.893, -68.211),
198
200
  place: 'Atlantic Ocean',
199
- polygon: (GeoLocationPolygon.new(points: [
200
- GeoLocationPoint.new(-67.302, 31.233),
201
- GeoLocationPoint.new(-71.032, -68.211),
202
- GeoLocationPoint.new(41.09, 42.893),
203
- GeoLocationPoint.new(-67.302, 31.233)
204
- ]))
201
+ polygon: GeoLocationPolygon.new(points: [
202
+ GeoLocationPoint.new(-67.302, 31.233),
203
+ GeoLocationPoint.new(-71.032, -68.211),
204
+ GeoLocationPoint.new(41.09, 42.893),
205
+ GeoLocationPoint.new(-67.302, 31.233)
206
+ ])
205
207
  )
206
208
  end
207
209
 
@@ -257,7 +259,7 @@ module Datacite
257
259
 
258
260
  it 'writes DC3 in XSD-defined order: point, box, place' do
259
261
  actual_xml = loc.save_to_xml(mapping: :datacite_3)
260
- expected_order = %w(geoLocationPoint geoLocationBox geoLocationPlace)
262
+ expected_order = %w[geoLocationPoint geoLocationBox geoLocationPlace]
261
263
  actual_order = actual_xml.children.map(&:name)
262
264
  expect(actual_order).to eq(expected_order)
263
265
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -21,13 +23,13 @@ module Datacite
21
23
  end
22
24
 
23
25
  it 'disallows bad DOIs' do
24
- bad_dois = %w(
26
+ bad_dois = %w[
25
27
  20.14749/1407399495
26
28
  11.14749/1407399495
27
29
  10./1407399495
28
30
  10.14749\1407399495
29
31
  10.14749/
30
- )
32
+ ]
31
33
  bad_dois.each do |doi|
32
34
  expect { Identifier.new(value: doi) }.to raise_error(ArgumentError)
33
35
  end
@@ -71,13 +73,13 @@ module Datacite
71
73
  end
72
74
 
73
75
  it 'raises ArgumentError if it is passed a bad DOI' do
74
- bad_dois = %w(
76
+ bad_dois = %w[
75
77
  20.14749/1407399495
76
78
  11.14749/1407399495
77
79
  10./1407399495
78
80
  10.14749\1407399495
79
81
  10.14749/
80
- )
82
+ ]
81
83
  bad_dois.each do |doi|
82
84
  expect { Identifier.from_doi(doi) }.to raise_error do |e|
83
85
  expect(e).to be_an(ArgumentError)
@@ -95,13 +97,13 @@ module Datacite
95
97
  end
96
98
  it 'disallows bad DOIs' do
97
99
  id = Identifier.allocate
98
- bad_dois = %w(
100
+ bad_dois = %w[
99
101
  20.14749/1407399495
100
102
  11.14749/1407399495
101
103
  10./1407399495
102
104
  10.14749\1407399495
103
105
  10.14749/
104
- )
106
+ ]
105
107
  bad_dois.each do |doi|
106
108
  expect { id.value = doi }.to raise_error(ArgumentError)
107
109
  expect(id.value).to be_nil
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -1,5 +1,8 @@
1
- # coding: utf-8
1
+
2
+ # frozen_string_literal: true
3
+
2
4
  require 'spec_helper'
5
+ require 'tmpdir'
3
6
 
4
7
  module Datacite
5
8
  module Mapping
@@ -119,9 +122,9 @@ module Datacite
119
122
  resource = Resource.new(args)
120
123
  expect(resource.creator_affiliations)
121
124
  .to eq([
122
- ['United Artists', 'Metro-Goldwyn-Mayer'],
123
- ['Gaumont Buena Vista International', '20th Century Fox']
124
- ])
125
+ ['United Artists', 'Metro-Goldwyn-Mayer'],
126
+ ['Gaumont Buena Vista International', '20th Century Fox']
127
+ ])
125
128
  end
126
129
  end
127
130
  end
@@ -228,7 +231,7 @@ module Datacite
228
231
  it 'converts strings to integers' do
229
232
  new_pub_year = 1963
230
233
  resource = Resource.new(args)
231
- resource.publication_year = "#{new_pub_year}"
234
+ resource.publication_year = new_pub_year.to_s
232
235
  expect(resource.publication_year).to eq(new_pub_year)
233
236
  end
234
237
  end
@@ -426,7 +429,8 @@ module Datacite
426
429
  scheme_uri: URI('http://iatistandard.org/201/codelists/OrganisationIdentifier/'),
427
430
  value: 'GR-9¾'
428
431
  ),
429
- type: ContributorType::FUNDER)
432
+ type: ContributorType::FUNDER
433
+ )
430
434
  @resource.contributors << @funder
431
435
  end
432
436
 
@@ -465,7 +469,7 @@ module Datacite
465
469
  describe 'dates:' do
466
470
  it 'can be initialized' do
467
471
  dates = [
468
- Date.new(value: DateTime.new(1914, 8, 4, 11, 01, 6.0123, '+1'), type: DateType::AVAILABLE),
472
+ Date.new(value: DateTime.new(1914, 8, 4, 11, 0o1, 6.0123, '+1'), type: DateType::AVAILABLE),
469
473
  Date.new(value: '1914-08-04T11:01:06.0123+01:00', type: DateType::AVAILABLE)
470
474
  ]
471
475
  args[:dates] = dates
@@ -483,7 +487,7 @@ module Datacite
483
487
  it 'can be set' do
484
488
  resource = Resource.new(args)
485
489
  dates = [
486
- Date.new(value: DateTime.new(1914, 8, 4, 11, 01, 6.0123, '+1'), type: DateType::AVAILABLE),
490
+ Date.new(value: DateTime.new(1914, 8, 4, 11, 0o1, 6.0123, '+1'), type: DateType::AVAILABLE),
487
491
  Date.new(value: '1914-08-04T11:01:06.0123+01:00', type: DateType::AVAILABLE)
488
492
  ]
489
493
  resource.dates = dates
@@ -625,7 +629,7 @@ module Datacite
625
629
 
626
630
  describe 'sizes:' do
627
631
  it 'can be initialized' do
628
- sizes = %w(48K 128K)
632
+ sizes = %w[48K 128K]
629
633
  args[:sizes] = sizes
630
634
  resource = Resource.new(args)
631
635
  expect(resource.sizes).to eq(sizes)
@@ -639,7 +643,7 @@ module Datacite
639
643
 
640
644
  describe '#sizes=' do
641
645
  it 'can be set' do
642
- sizes = %w(48K 128K)
646
+ sizes = %w[48K 128K]
643
647
  resource = Resource.new(args)
644
648
  resource.sizes = sizes
645
649
  expect(resource.sizes).to eq(sizes)
@@ -660,7 +664,7 @@ module Datacite
660
664
 
661
665
  describe 'formats:' do
662
666
  it 'can be initialized' do
663
- formats = %w(D64 DSK)
667
+ formats = %w[D64 DSK]
664
668
  args[:formats] = formats
665
669
  resource = Resource.new(args)
666
670
  expect(resource.formats).to eq(formats)
@@ -674,7 +678,7 @@ module Datacite
674
678
 
675
679
  describe '#formats=' do
676
680
  it 'can be set' do
677
- formats = %w(D64 DSK)
681
+ formats = %w[D64 DSK]
678
682
  resource = Resource.new(args)
679
683
  resource.formats = formats
680
684
  expect(resource.formats).to eq(formats)
@@ -940,7 +944,7 @@ module Datacite
940
944
  r1 = r0.gsub(%r{&lt;br\s+/&gt;}, '<br/>') # entity-de-escape <br/> tags
941
945
  # r2 = r1.gsub(%r{<(?!br)[^>]+/>}, '') # remove empty tags
942
946
  r2 = r1
943
- r3 = r2.gsub(/<resource (xmlns:xsi="[^"]+")\s+(xsi:schemaLocation="[^"]+")>/, "<resource \\2 \\1 xmlns=\"http://datacite.org/schema/kernel-3\">") # fix missing namespace
947
+ r3 = r2.gsub(/<resource (xmlns:xsi="[^"]+")\s+(xsi:schemaLocation="[^"]+")>/, '<resource \\2 \\1 xmlns="http://datacite.org/schema/kernel-3">') # fix missing namespace
944
948
  r4 = r3.gsub(%r{(<identifier[^>]+>)\s*([^ ]+)\s*(</identifier>)}, '\\1\\2\\3') # trim identifiers
945
949
  r5 = r4.gsub(%r{<([^>]+tude)>([0-9.-]+?)(0?)0+</\1>}, '<\\1>\\2\\3</\\1>') # strip trailing coordinate zeroes
946
950
  r6 = r5.gsub(%r{<(geoLocation[^>]+)>[^<]+</\1>}) { |loc| loc.gsub(/([0-9\-]+\.[0-9]+?)0+([^0-9])/, '\\1\\2') } # strip trailing coordinate zeroes
@@ -1017,7 +1021,7 @@ module Datacite
1017
1021
  matches = warnings_including(substring)
1018
1022
  found_count = matches.size
1019
1023
  msg = "expected #{count} warnings including '#{substring}', found #{found_count}"
1020
- msg << ": #{matches}" if include_matches
1024
+ msg += ": #{matches}" if include_matches
1021
1025
  expect(found_count).to eq(count), msg
1022
1026
  end
1023
1027
 
@@ -1025,7 +1029,7 @@ module Datacite
1025
1029
  matches = REXML::XPath.match(rexml, xpath)
1026
1030
  found_count = matches.size
1027
1031
  msg = "expected #{count} matches for XPath '#{xpath}', found #{found_count}"
1028
- msg << ": #{matches}" if include_matches
1032
+ msg += ": #{matches}" if include_matches
1029
1033
  expect(found_count).to eq(count), msg
1030
1034
  end
1031
1035
 
@@ -1033,7 +1037,7 @@ module Datacite
1033
1037
  @warnings = []
1034
1038
  allow(ReadOnlyNodes).to receive(:warn) do |w|
1035
1039
  warnings << w
1036
- Kernel.warn(w) # for debugging
1040
+ # Kernel.warn(w) # for debugging
1037
1041
  end
1038
1042
 
1039
1043
  xml = File.read('spec/data/datacite-4-synthetic.xml')
@@ -1051,7 +1055,7 @@ module Datacite
1051
1055
  end
1052
1056
 
1053
1057
  it 'warns about givenNames and familyNames' do
1054
- name_tags = %w(givenName familyName)
1058
+ name_tags = %w[givenName familyName]
1055
1059
  name_tags.each do |tag|
1056
1060
  expect_matches("//#{tag}", 0, true)
1057
1061
  expect_warning(tag, 1)
@@ -1151,7 +1155,7 @@ module Datacite
1151
1155
 
1152
1156
  describe '#save_to_file' do
1153
1157
  it 'saves to a file' do
1154
- xml_text = File.read('spec/data/datacite4/datacite-example-full-v4.0.xml')
1158
+ xml_text = File.read('spec/data/datacite4/datacite-example-full-v4.0.xml')
1155
1159
  resource = Resource.parse_xml(xml_text)
1156
1160
  Dir.mktmpdir('resource_spec') do |dir|
1157
1161
  path = "#{dir}/resource.xml"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Datacite
@@ -80,7 +82,7 @@ module Datacite
80
82
  expected_xml = '<rights rightsURI="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International (CC BY 4.0)</rights>'
81
83
  expect(rights.save_to_xml).to be_xml(expected_xml)
82
84
 
83
- [:CC_ZERO, :CC_BY].each do |c|
85
+ %i[CC_ZERO CC_BY].each do |c|
84
86
  r = Rights.const_get(c)
85
87
  puts "#{c.to_s.downcase.gsub('_zero', '0')}:"
86
88
  puts " uri: #{r.uri}"