marc 1.0.4 → 1.2.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} +106 -29
  7. data/Gemfile +15 -0
  8. data/README.md +240 -47
  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 -86
  22. data/lib/marc/reader.rb +119 -121
  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 -81
  31. data/lib/marc.rb +20 -18
  32. data/marc.gemspec +23 -0
  33. data/test/marc8/tc_marc8_mapping.rb +3 -3
  34. data/test/marc8/tc_to_unicode.rb +28 -32
  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 +99 -87
  50. data/test/tc_xml_error_handling.rb +7 -8
  51. data/test/ts_marc.rb +8 -8
  52. metadata +94 -9
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.0.4
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Clarke
@@ -10,11 +10,26 @@ 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: 2019-06-28 00:00:00.000000000 Z
17
+ date: 2022-08-02 00:00:00.000000000 Z
17
18
  dependencies:
19
+ - !ruby/object:Gem::Dependency
20
+ name: standard
21
+ requirement: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.0'
26
+ type: :development
27
+ prerelease: false
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
18
33
  - !ruby/object:Gem::Dependency
19
34
  name: scrub_rb
20
35
  requirement: !ruby/object:Gem::Requirement
@@ -49,32 +64,60 @@ dependencies:
49
64
  - - ">="
50
65
  - !ruby/object:Gem::Version
51
66
  version: '0'
52
- description:
67
+ - !ruby/object:Gem::Dependency
68
+ name: rexml
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ description:
53
82
  email: ehs@pobox.com
54
- executables: []
83
+ executables:
84
+ - marc
85
+ - marc2xml
55
86
  extensions: []
56
87
  extra_rdoc_files: []
57
88
  files:
58
- - Changes
89
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
90
+ - ".github/workflows/ruby.yml"
91
+ - ".gitignore"
92
+ - ".standard.yml"
93
+ - CHANGELOG.md
94
+ - Gemfile
59
95
  - LICENSE
60
96
  - README.md
61
97
  - Rakefile
98
+ - bin/marc
99
+ - bin/marc2xml
100
+ - examples/xml2marc.rb
62
101
  - lib/marc.rb
63
102
  - lib/marc/constants.rb
64
103
  - lib/marc/controlfield.rb
65
104
  - lib/marc/datafield.rb
66
105
  - lib/marc/dublincore.rb
67
106
  - lib/marc/exception.rb
107
+ - lib/marc/jsonl_reader.rb
108
+ - lib/marc/jsonl_writer.rb
68
109
  - lib/marc/marc8/map_to_unicode.rb
69
110
  - lib/marc/marc8/to_unicode.rb
70
111
  - lib/marc/reader.rb
71
112
  - lib/marc/record.rb
72
113
  - lib/marc/subfield.rb
114
+ - lib/marc/unsafe_xmlwriter.rb
73
115
  - lib/marc/version.rb
74
116
  - lib/marc/writer.rb
75
117
  - lib/marc/xml_parsers.rb
76
118
  - lib/marc/xmlreader.rb
77
119
  - lib/marc/xmlwriter.rb
120
+ - marc.gemspec
78
121
  - test/bad_eacc_encoding.marc8.marc
79
122
  - test/batch.dat
80
123
  - test/batch.xml
@@ -87,6 +130,7 @@ files:
87
130
  - test/marc8/tc_to_unicode.rb
88
131
  - test/marc8_accented_chars.marc
89
132
  - test/marc_with_bad_utf8.utf8.marc
133
+ - test/messed_up_leader.xml
90
134
  - test/no-leading-zero.xml
91
135
  - test/non-numeric.dat
92
136
  - test/non-numeric.xml
@@ -98,12 +142,14 @@ files:
98
142
  - test/tc_datafield.rb
99
143
  - test/tc_dublincore.rb
100
144
  - test/tc_hash.rb
145
+ - test/tc_jsonl.rb
101
146
  - test/tc_marchash.rb
102
147
  - test/tc_parsers.rb
103
148
  - test/tc_reader.rb
104
149
  - test/tc_reader_char_encodings.rb
105
150
  - test/tc_record.rb
106
151
  - test/tc_subfield.rb
152
+ - test/tc_unsafe_xml.rb
107
153
  - test/tc_writer.rb
108
154
  - test/tc_xml.rb
109
155
  - test/tc_xml_error_handling.rb
@@ -116,7 +162,7 @@ homepage: https://github.com/ruby-marc/ruby-marc/
116
162
  licenses:
117
163
  - MIT
118
164
  metadata: {}
119
- post_install_message:
165
+ post_install_message:
120
166
  rdoc_options: []
121
167
  require_paths:
122
168
  - lib
@@ -131,9 +177,48 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
177
  - !ruby/object:Gem::Version
132
178
  version: '0'
133
179
  requirements: []
134
- rubygems_version: 3.0.3
135
- signing_key:
180
+ rubygems_version: 3.3.3
181
+ signing_key:
136
182
  specification_version: 4
137
183
  summary: A ruby library for working with Machine Readable Cataloging
138
184
  test_files:
185
+ - test/bad_eacc_encoding.marc8.marc
186
+ - test/batch.dat
187
+ - test/batch.xml
188
+ - test/cp866_multirecord.marc
189
+ - test/cp866_unimarc.marc
190
+ - test/escaped_character_reference.marc8.marc
191
+ - test/marc8/data/test_marc8.txt
192
+ - test/marc8/data/test_utf8.txt
193
+ - test/marc8/tc_marc8_mapping.rb
194
+ - test/marc8/tc_to_unicode.rb
195
+ - test/marc8_accented_chars.marc
196
+ - test/marc_with_bad_utf8.utf8.marc
197
+ - test/messed_up_leader.xml
198
+ - test/no-leading-zero.xml
199
+ - test/non-numeric.dat
200
+ - test/non-numeric.xml
201
+ - test/one.dat
202
+ - test/one.xml
203
+ - test/random_tag_order.dat
204
+ - test/random_tag_order2.dat
205
+ - test/tc_controlfield.rb
206
+ - test/tc_datafield.rb
207
+ - test/tc_dublincore.rb
208
+ - test/tc_hash.rb
209
+ - test/tc_jsonl.rb
210
+ - test/tc_marchash.rb
211
+ - test/tc_parsers.rb
212
+ - test/tc_reader.rb
213
+ - test/tc_reader_char_encodings.rb
214
+ - test/tc_record.rb
215
+ - test/tc_subfield.rb
216
+ - test/tc_unsafe_xml.rb
217
+ - test/tc_writer.rb
218
+ - test/tc_xml.rb
219
+ - test/tc_xml_error_handling.rb
220
+ - test/three-records-second-bad.xml
139
221
  - test/ts_marc.rb
222
+ - test/utf8.marc
223
+ - test/utf8_multirecord.marc
224
+ - test/utf8_with_bad_bytes.marc