marc 1.1.1 → 1.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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
  3. data/.github/workflows/ruby.yml +24 -0
  4. data/.gitignore +17 -0
  5. data/.standard.yml +1 -0
  6. data/{Changes → CHANGELOG.md} +116 -30
  7. data/Gemfile +5 -0
  8. data/README.md +239 -46
  9. data/Rakefile +14 -14
  10. data/bin/marc +14 -0
  11. data/bin/marc2xml +17 -0
  12. data/examples/xml2marc.rb +10 -0
  13. data/lib/marc/constants.rb +3 -3
  14. data/lib/marc/controlfield.rb +35 -23
  15. data/lib/marc/datafield.rb +70 -63
  16. data/lib/marc/dublincore.rb +59 -41
  17. data/lib/marc/exception.rb +9 -1
  18. data/lib/marc/jsonl_reader.rb +33 -0
  19. data/lib/marc/jsonl_writer.rb +44 -0
  20. data/lib/marc/marc8/map_to_unicode.rb +16417 -16420
  21. data/lib/marc/marc8/to_unicode.rb +80 -87
  22. data/lib/marc/reader.rb +116 -124
  23. data/lib/marc/record.rb +72 -62
  24. data/lib/marc/subfield.rb +12 -10
  25. data/lib/marc/unsafe_xmlwriter.rb +93 -0
  26. data/lib/marc/version.rb +1 -1
  27. data/lib/marc/writer.rb +27 -30
  28. data/lib/marc/xml_parsers.rb +222 -197
  29. data/lib/marc/xmlreader.rb +131 -114
  30. data/lib/marc/xmlwriter.rb +93 -82
  31. data/lib/marc.rb +20 -18
  32. data/marc.gemspec +28 -0
  33. data/test/marc8/tc_marc8_mapping.rb +3 -3
  34. data/test/marc8/tc_to_unicode.rb +28 -34
  35. data/test/messed_up_leader.xml +9 -0
  36. data/test/tc_controlfield.rb +37 -34
  37. data/test/tc_datafield.rb +65 -60
  38. data/test/tc_dublincore.rb +9 -11
  39. data/test/tc_hash.rb +10 -13
  40. data/test/tc_jsonl.rb +19 -0
  41. data/test/tc_marchash.rb +17 -21
  42. data/test/tc_parsers.rb +108 -144
  43. data/test/tc_reader.rb +35 -36
  44. data/test/tc_reader_char_encodings.rb +149 -169
  45. data/test/tc_record.rb +143 -148
  46. data/test/tc_subfield.rb +14 -13
  47. data/test/tc_unsafe_xml.rb +95 -0
  48. data/test/tc_writer.rb +101 -108
  49. data/test/tc_xml.rb +101 -94
  50. data/test/tc_xml_error_handling.rb +7 -8
  51. data/test/ts_marc.rb +8 -8
  52. metadata +129 -22
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Clarke
@@ -10,39 +10,90 @@ authors:
10
10
  - Jonathan Rochkind
11
11
  - Ross Singer
12
12
  - Ed Summers
13
- autorequire: marc
13
+ - Chris Beer
14
+ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
- date: 2021-06-07 00:00:00.000000000 Z
17
+ date: 2025-01-09 00:00:00.000000000 Z
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
- name: scrub_rb
20
+ name: nokogiri
20
21
  requirement: !ruby/object:Gem::Requirement
21
22
  requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: 1.0.1
25
- - - "<"
23
+ - - "~>"
26
24
  - !ruby/object:Gem::Version
27
- version: '2'
25
+ version: '1.0'
28
26
  type: :runtime
29
27
  prerelease: false
30
28
  version_requirements: !ruby/object:Gem::Requirement
31
29
  requirements:
32
- - - ">="
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rake
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '13.0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '13.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: test-unit
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: standard
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
33
73
  - !ruby/object:Gem::Version
34
- version: 1.0.1
35
- - - "<"
74
+ version: '1.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: warning
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
36
80
  - !ruby/object:Gem::Version
37
- version: '2'
81
+ version: '1.5'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.5'
38
89
  - !ruby/object:Gem::Dependency
39
- name: unf
90
+ name: xml-simple
40
91
  requirement: !ruby/object:Gem::Requirement
41
92
  requirements:
42
93
  - - ">="
43
94
  - !ruby/object:Gem::Version
44
95
  version: '0'
45
- type: :runtime
96
+ type: :development
46
97
  prerelease: false
47
98
  version_requirements: !ruby/object:Gem::Requirement
48
99
  requirements:
@@ -63,32 +114,46 @@ dependencies:
63
114
  - - ">="
64
115
  - !ruby/object:Gem::Version
65
116
  version: '0'
66
- description:
117
+ description:
67
118
  email: ehs@pobox.com
68
- executables: []
119
+ executables:
120
+ - marc
121
+ - marc2xml
69
122
  extensions: []
70
123
  extra_rdoc_files: []
71
124
  files:
72
- - Changes
125
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
126
+ - ".github/workflows/ruby.yml"
127
+ - ".gitignore"
128
+ - ".standard.yml"
129
+ - CHANGELOG.md
130
+ - Gemfile
73
131
  - LICENSE
74
132
  - README.md
75
133
  - Rakefile
134
+ - bin/marc
135
+ - bin/marc2xml
136
+ - examples/xml2marc.rb
76
137
  - lib/marc.rb
77
138
  - lib/marc/constants.rb
78
139
  - lib/marc/controlfield.rb
79
140
  - lib/marc/datafield.rb
80
141
  - lib/marc/dublincore.rb
81
142
  - lib/marc/exception.rb
143
+ - lib/marc/jsonl_reader.rb
144
+ - lib/marc/jsonl_writer.rb
82
145
  - lib/marc/marc8/map_to_unicode.rb
83
146
  - lib/marc/marc8/to_unicode.rb
84
147
  - lib/marc/reader.rb
85
148
  - lib/marc/record.rb
86
149
  - lib/marc/subfield.rb
150
+ - lib/marc/unsafe_xmlwriter.rb
87
151
  - lib/marc/version.rb
88
152
  - lib/marc/writer.rb
89
153
  - lib/marc/xml_parsers.rb
90
154
  - lib/marc/xmlreader.rb
91
155
  - lib/marc/xmlwriter.rb
156
+ - marc.gemspec
92
157
  - test/bad_eacc_encoding.marc8.marc
93
158
  - test/batch.dat
94
159
  - test/batch.xml
@@ -101,6 +166,7 @@ files:
101
166
  - test/marc8/tc_to_unicode.rb
102
167
  - test/marc8_accented_chars.marc
103
168
  - test/marc_with_bad_utf8.utf8.marc
169
+ - test/messed_up_leader.xml
104
170
  - test/no-leading-zero.xml
105
171
  - test/non-numeric.dat
106
172
  - test/non-numeric.xml
@@ -112,12 +178,14 @@ files:
112
178
  - test/tc_datafield.rb
113
179
  - test/tc_dublincore.rb
114
180
  - test/tc_hash.rb
181
+ - test/tc_jsonl.rb
115
182
  - test/tc_marchash.rb
116
183
  - test/tc_parsers.rb
117
184
  - test/tc_reader.rb
118
185
  - test/tc_reader_char_encodings.rb
119
186
  - test/tc_record.rb
120
187
  - test/tc_subfield.rb
188
+ - test/tc_unsafe_xml.rb
121
189
  - test/tc_writer.rb
122
190
  - test/tc_xml.rb
123
191
  - test/tc_xml_error_handling.rb
@@ -130,7 +198,7 @@ homepage: https://github.com/ruby-marc/ruby-marc/
130
198
  licenses:
131
199
  - MIT
132
200
  metadata: {}
133
- post_install_message:
201
+ post_install_message:
134
202
  rdoc_options: []
135
203
  require_paths:
136
204
  - lib
@@ -138,16 +206,55 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
206
  requirements:
139
207
  - - ">="
140
208
  - !ruby/object:Gem::Version
141
- version: 1.8.6
209
+ version: 2.2.0
142
210
  required_rubygems_version: !ruby/object:Gem::Requirement
143
211
  requirements:
144
212
  - - ">="
145
213
  - !ruby/object:Gem::Version
146
214
  version: '0'
147
215
  requirements: []
148
- rubygems_version: 3.0.3
149
- signing_key:
216
+ rubygems_version: 3.5.22
217
+ signing_key:
150
218
  specification_version: 4
151
219
  summary: A ruby library for working with Machine Readable Cataloging
152
220
  test_files:
221
+ - test/bad_eacc_encoding.marc8.marc
222
+ - test/batch.dat
223
+ - test/batch.xml
224
+ - test/cp866_multirecord.marc
225
+ - test/cp866_unimarc.marc
226
+ - test/escaped_character_reference.marc8.marc
227
+ - test/marc8/data/test_marc8.txt
228
+ - test/marc8/data/test_utf8.txt
229
+ - test/marc8/tc_marc8_mapping.rb
230
+ - test/marc8/tc_to_unicode.rb
231
+ - test/marc8_accented_chars.marc
232
+ - test/marc_with_bad_utf8.utf8.marc
233
+ - test/messed_up_leader.xml
234
+ - test/no-leading-zero.xml
235
+ - test/non-numeric.dat
236
+ - test/non-numeric.xml
237
+ - test/one.dat
238
+ - test/one.xml
239
+ - test/random_tag_order.dat
240
+ - test/random_tag_order2.dat
241
+ - test/tc_controlfield.rb
242
+ - test/tc_datafield.rb
243
+ - test/tc_dublincore.rb
244
+ - test/tc_hash.rb
245
+ - test/tc_jsonl.rb
246
+ - test/tc_marchash.rb
247
+ - test/tc_parsers.rb
248
+ - test/tc_reader.rb
249
+ - test/tc_reader_char_encodings.rb
250
+ - test/tc_record.rb
251
+ - test/tc_subfield.rb
252
+ - test/tc_unsafe_xml.rb
253
+ - test/tc_writer.rb
254
+ - test/tc_xml.rb
255
+ - test/tc_xml_error_handling.rb
256
+ - test/three-records-second-bad.xml
153
257
  - test/ts_marc.rb
258
+ - test/utf8.marc
259
+ - test/utf8_multirecord.marc
260
+ - test/utf8_with_bad_bytes.marc