mods 2.4.1 → 3.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +24 -0
  3. data/.gitignore +1 -0
  4. data/README.md +0 -1
  5. data/lib/mods/marc_country_codes.rb +12 -10
  6. data/lib/mods/nom_terminology.rb +108 -844
  7. data/lib/mods/reader.rb +9 -39
  8. data/lib/mods/record.rb +13 -28
  9. data/lib/mods/version.rb +1 -1
  10. data/mods.gemspec +2 -2
  11. data/spec/fixture_data/hp566jq8781.xml +334 -0
  12. data/spec/integration/parker_spec.rb +217 -0
  13. data/spec/{date_spec.rb → lib/date_spec.rb} +0 -0
  14. data/spec/lib/language_spec.rb +123 -0
  15. data/spec/lib/location_spec.rb +175 -0
  16. data/spec/lib/name_spec.rb +366 -0
  17. data/spec/lib/origin_info_spec.rb +134 -0
  18. data/spec/lib/part_spec.rb +162 -0
  19. data/spec/lib/physical_description_spec.rb +72 -0
  20. data/spec/{reader_spec.rb → lib/reader_spec.rb} +1 -41
  21. data/spec/lib/record_info_spec.rb +114 -0
  22. data/spec/lib/record_spec.rb +287 -0
  23. data/spec/lib/related_item_spec.rb +124 -0
  24. data/spec/lib/subject_spec.rb +427 -0
  25. data/spec/lib/title_spec.rb +108 -0
  26. data/spec/lib/top_level_elmnts_simple_spec.rb +169 -0
  27. data/spec/spec_helper.rb +86 -5
  28. data/spec/support/fixtures.rb +9 -0
  29. metadata +51 -46
  30. data/.travis.yml +0 -16
  31. data/spec/language_spec.rb +0 -118
  32. data/spec/location_spec.rb +0 -295
  33. data/spec/name_spec.rb +0 -759
  34. data/spec/origin_info_spec.rb +0 -447
  35. data/spec/part_spec.rb +0 -471
  36. data/spec/physical_description_spec.rb +0 -144
  37. data/spec/record_info_spec.rb +0 -493
  38. data/spec/record_spec.rb +0 -356
  39. data/spec/related_item_spec.rb +0 -305
  40. data/spec/subject_spec.rb +0 -809
  41. data/spec/title_spec.rb +0 -226
  42. data/spec/top_level_elmnts_simple_spec.rb +0 -369
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ee9e9f682562bec8eeee3698cb1dc20fedee759172e0f6ef84a39ab01679550
4
- data.tar.gz: 67a3d7a70e895de43831a40b30195bd8fe2ffb27315c74ec28e805416169512d
3
+ metadata.gz: 58a2e2e97e06da6d141ec207b55af9a95a651590b6c5b5e1d6e79d29e717c902
4
+ data.tar.gz: 608a6c50337ce64b7c0472f2a0f852a8d25adba44429a5d3be47d58eed58cfa5
5
5
  SHA512:
6
- metadata.gz: 90ba88b4a9354acfa9714711cd20a932473fafc62445ee40ea33725b4a03927b5f499cff78fab004a7ed307741424ef9aa19dd65e4b821f416e31a95bb116f83
7
- data.tar.gz: 6e343ecf819c236774468511abb31be4a80aa2cfa8725231736f352c34c51cae0e8fe8fd9cd93d527c97fda52160fe1fe65ae0d204fbcff8fab54e5bad4379ec
6
+ metadata.gz: 1fb07b17da4a3e0b7aaf9a5bda6ba9e719cb370298eabe1da75bcfc9ea57c0f76889ffaf16d81d2946b38885d34b1338b23e6448dfccd6dd4d2d677c21ac6aba
7
+ data.tar.gz: c125714df2b9764306b540fe762fa4c72e3e0cc1089beefa44add644117681e0b2a182f70bcebc25b60c0f69917305857bde6476ff8f893f016aeb83dc303de8
@@ -0,0 +1,24 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ tests:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby: [jruby-9.3.2.0, 2.7, '3.0', 3.1]
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ - name: Install dependencies
22
+ run: bundle install
23
+ - name: Run tests
24
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -22,3 +22,4 @@ tmtags
22
22
  .idea/*
23
23
  to_delete
24
24
  .byebug_history
25
+ /spec/examples.txt
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Mods
2
2
 
3
3
  [<img src="https://secure.travis-ci.org/sul-dlss/mods.png?branch=master" alt="Build Status"/>](http://travis-ci.org/sul-dlss/mods) [![Code Climate Test Coverage](https://codeclimate.com/github/sul-dlss/mods/badges/coverage.svg)](https://codeclimate.com/github/sul-dlss/mods/coverage) [<img
4
- src="https://gemnasium.com/sul-dlss/mods.png" alt="Dependency Status"/>](https://gemnasium.com/sul-dlss/mods) [<img
5
4
  src="https://badge.fury.io/rb/mods.svg" alt="Gem Version"/>](http://badge.fury.io/rb/mods)
6
5
 
7
6
  A Gem to parse MODS (Metadata Object Description Schema) records. More information about MODS can be found at
@@ -1,8 +1,8 @@
1
- # encoding: UTF-8
2
-
3
1
  # Represents the Marc Country Codes mapped to names, from http://www.loc.gov/marc/countries/countries_code.html 2013-01-03
4
- #key - Marc Country code
5
- #value - Marc Country term
2
+ # key - Marc Country code
3
+ # value - Marc Country term
4
+ # frozen_string_literal: true
5
+
6
6
  MARC_COUNTRY = {
7
7
  'aa' => "Albania",
8
8
  'abc' => "Alberta",
@@ -11,7 +11,6 @@ MARC_COUNTRY = {
11
11
  'ae' => "Algeria",
12
12
  'af' => "Afghanistan",
13
13
  'ag' => "Argentina",
14
- #'ai' => "Anguilla", # discontinued
15
14
  'ai' => "Armenia (Republic)",
16
15
  'air' => "Armenian S.S.R.", # discontinued
17
16
  'aj' => "Azerbaijan",
@@ -40,7 +39,7 @@ MARC_COUNTRY = {
40
39
  'bi' => "British Indian Ocean Territory",
41
40
  'bl' => "Brazil",
42
41
  'bm' => "Bermuda Islands",
43
- 'bn' => "Bosnia and Hercegovina",
42
+ 'bn' => "Bosnia and Herzegovina",
44
43
  'bo' => "Bolivia",
45
44
  'bp' => "Solomon Islands",
46
45
  'br' => "Burma",
@@ -74,7 +73,7 @@ MARC_COUNTRY = {
74
73
  'cs' => "Czechoslovakia", # discontinued
75
74
  'ctu' => "Connecticut",
76
75
  'cu' => "Cuba",
77
- 'cv' => "Cape Verde",
76
+ 'cv' => "Cabo Verde",
78
77
  'cw' => "Cook Islands",
79
78
  'cx' => "Central African Republic",
80
79
  'cy' => "Cyprus",
@@ -109,6 +108,7 @@ MARC_COUNTRY = {
109
108
  'gb' => "Kiribati",
110
109
  'gd' => "Grenada",
111
110
  'ge' => "Germany (East)", # discontinued
111
+ 'gg' => "Guernsey",
112
112
  'gh' => "Ghana",
113
113
  'gi' => "Gibraltar",
114
114
  'gl' => "Greenland",
@@ -137,6 +137,7 @@ MARC_COUNTRY = {
137
137
  'ie' => "Ireland",
138
138
  'ii' => "India",
139
139
  'ilu' => "Illinois",
140
+ 'im' => "Isle of Man",
140
141
  'inu' => "Indiana",
141
142
  'io' => "Indonesia",
142
143
  'iq' => "Iraq",
@@ -148,6 +149,7 @@ MARC_COUNTRY = {
148
149
  'iw' => "Israel-Jordan Demilitarized Zones", # discontinued
149
150
  'iy' => "Iraq-Saudi Arabia Neutral Zone",
150
151
  'ja' => "Japan",
152
+ 'je' => "Jersey",
151
153
  'ji' => "Johnston Atoll",
152
154
  'jm' => "Jamaica",
153
155
  'jn' => "Jan Mayen", # discontinued
@@ -284,7 +286,7 @@ MARC_COUNTRY = {
284
286
  'snc' => "Saskatchewan",
285
287
  'so' => "Somalia",
286
288
  'sp' => "Spain",
287
- 'sq' => "Swaziland",
289
+ 'sq' => "Eswatini",
288
290
  'sr' => "Surinam",
289
291
  'ss' => "Western Sahara",
290
292
  'st' => "Saint-Martin",
@@ -365,7 +367,7 @@ MARC_COUNTRY = {
365
367
  'xk' => "Saint Lucia",
366
368
  'xl' => "Saint Pierre and Miquelon",
367
369
  'xm' => "Saint Vincent and the Grenadines",
368
- 'xn' => "Macedonia",
370
+ 'xn' => "North Macedonia",
369
371
  'xna' => "New South Wales",
370
372
  'xo' => "Slovakia",
371
373
  'xoa' => "Northern Territory",
@@ -384,4 +386,4 @@ MARC_COUNTRY = {
384
386
  'ys' => "Yemen (People's Democratic Republic)", # discontinued
385
387
  'yu' => "Serbia and Montenegro", # discontinued
386
388
  'za' => "Zambia"
387
- }
389
+ }.freeze