bolognese 1.6.2 → 1.6.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +18 -13
  3. data/bolognese.gemspec +4 -4
  4. data/lib/bolognese/datacite_utils.rb +9 -3
  5. data/lib/bolognese/metadata.rb +6 -8
  6. data/lib/bolognese/metadata_utils.rb +10 -3
  7. data/lib/bolognese/readers/bibtex_reader.rb +2 -1
  8. data/lib/bolognese/readers/citeproc_reader.rb +2 -2
  9. data/lib/bolognese/readers/codemeta_reader.rb +3 -3
  10. data/lib/bolognese/readers/crossref_reader.rb +2 -2
  11. data/lib/bolognese/readers/datacite_reader.rb +3 -3
  12. data/lib/bolognese/readers/npm_reader.rb +1 -1
  13. data/lib/bolognese/readers/schema_org_reader.rb +4 -5
  14. data/lib/bolognese/utils.rb +89 -9
  15. data/lib/bolognese/version.rb +1 -1
  16. data/lib/bolognese/writers/bibtex_writer.rb +2 -1
  17. data/lib/bolognese/writers/codemeta_writer.rb +3 -2
  18. data/lib/bolognese/writers/jats_writer.rb +2 -2
  19. data/lib/bolognese/writers/schema_org_writer.rb +1 -1
  20. data/resources/spdx/licenses.json +5297 -0
  21. data/spec/datacite_utils_spec.rb +5 -1
  22. data/spec/fixtures/datacite-example-affiliation.xml +1 -1
  23. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/not_found.yml +44 -0
  24. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash.yml +44 -0
  25. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml +44 -0
  26. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/to_https.yml +44 -0
  27. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash_and_to_https.yml +44 -0
  28. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_id.yml +44 -0
  29. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_not_found.yml +44 -0
  30. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_url.yml +44 -0
  31. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_exists.yml +44 -0
  32. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_id.yml +44 -0
  33. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_not_found.yml +44 -0
  34. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/http.yml +44 -0
  35. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/uri.yml +44 -0
  36. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/with_trailing_slash.yml +44 -0
  37. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/software_w/version.yml +52 -0
  38. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding.yml +58 -10
  39. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +65 -28
  40. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_Cyark.yml +98 -0
  41. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +58 -10
  42. data/spec/readers/bibtex_reader_spec.rb +5 -1
  43. data/spec/readers/codemeta_reader_spec.rb +21 -1
  44. data/spec/readers/crossref_reader_spec.rb +21 -5
  45. data/spec/readers/datacite_json_reader_spec.rb +1 -1
  46. data/spec/readers/datacite_reader_spec.rb +51 -11
  47. data/spec/readers/npm_reader_spec.rb +3 -3
  48. data/spec/readers/schema_org_reader_spec.rb +2 -2
  49. data/spec/utils_spec.rb +58 -0
  50. data/spec/writers/bibtex_writer_spec.rb +6 -0
  51. data/spec/writers/citation_writer_spec.rb +8 -0
  52. data/spec/writers/citeproc_writer_spec.rb +12 -2
  53. data/spec/writers/crosscite_writer_spec.rb +5 -1
  54. data/spec/writers/datacite_json_writer_spec.rb +5 -1
  55. data/spec/writers/datacite_writer_spec.rb +22 -7
  56. data/spec/writers/schema_org_writer_spec.rb +29 -3
  57. metadata +31 -8
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-02 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -132,14 +132,20 @@ dependencies:
132
132
  requirements:
133
133
  - - "~>"
134
134
  - !ruby/object:Gem::Version
135
- version: '0.19'
135
+ version: '1.0'
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: 1.0.1
136
139
  type: :runtime
137
140
  prerelease: false
138
141
  version_requirements: !ruby/object:Gem::Requirement
139
142
  requirements:
140
143
  - - "~>"
141
144
  - !ruby/object:Gem::Version
142
- version: '0.19'
145
+ version: '1.0'
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: 1.0.1
143
149
  - !ruby/object:Gem::Dependency
144
150
  name: colorize
145
151
  requirement: !ruby/object:Gem::Requirement
@@ -268,20 +274,20 @@ dependencies:
268
274
  requirements:
269
275
  - - "~>"
270
276
  - !ruby/object:Gem::Version
271
- version: '2.2'
277
+ version: '3.1'
272
278
  - - ">="
273
279
  - !ruby/object:Gem::Version
274
- version: 2.2.1
280
+ version: 3.1.4
275
281
  type: :runtime
276
282
  prerelease: false
277
283
  version_requirements: !ruby/object:Gem::Requirement
278
284
  requirements:
279
285
  - - "~>"
280
286
  - !ruby/object:Gem::Version
281
- version: '2.2'
287
+ version: '3.1'
282
288
  - - ">="
283
289
  - !ruby/object:Gem::Version
284
- version: 2.2.1
290
+ version: 3.1.4
285
291
  - !ruby/object:Gem::Dependency
286
292
  name: jsonlint
287
293
  requirement: !ruby/object:Gem::Requirement
@@ -725,6 +731,7 @@ files:
725
731
  - resources/oecd/for-mappings.json
726
732
  - resources/oecd/fos-mappings.json
727
733
  - resources/schema_org/jsonldcontext.json
734
+ - resources/spdx/licenses.json
728
735
  - resources/xml.xsd
729
736
  - spec/array_spec.rb
730
737
  - spec/author_utils_spec.rb
@@ -1033,6 +1040,9 @@ files:
1033
1040
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml
1034
1041
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml
1035
1042
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml
1043
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/not_found.yml
1044
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash.yml
1045
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml
1036
1046
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/SICI_doi.yml
1037
1047
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml
1038
1048
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_force_datacite_sandbox.yml
@@ -1060,8 +1070,10 @@ files:
1060
1070
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_empty_array.yml
1061
1071
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_hash.yml
1062
1072
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_string.yml
1073
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/to_https.yml
1063
1074
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/uri.yml
1064
1075
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash.yml
1076
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash_and_to_https.yml
1065
1077
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml
1066
1078
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array_of_strings.yml
1067
1079
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/first.yml
@@ -1070,8 +1082,17 @@ files:
1070
1082
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml
1071
1083
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml
1072
1084
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml
1085
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_id.yml
1086
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_not_found.yml
1087
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_url.yml
1088
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_exists.yml
1089
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_id.yml
1090
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_not_found.yml
1073
1091
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml
1074
1092
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org_identifiers/with_identifiers.yml
1093
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/http.yml
1094
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/uri.yml
1095
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/with_trailing_slash.yml
1075
1096
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_doi/doi.yml
1076
1097
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi.yml
1077
1098
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi_without_prefix.yml
@@ -1108,6 +1129,7 @@ files:
1108
1129
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Dataset.yml
1109
1130
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article.yml
1110
1131
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Missing_author.yml
1132
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/software_w/version.yml
1111
1133
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml
1112
1134
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml
1113
1135
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml
@@ -1174,6 +1196,7 @@ files:
1174
1196
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding.yml
1175
1197
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml
1176
1198
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml
1199
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_Cyark.yml
1177
1200
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml
1178
1201
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_isReferencedBy.yml
1179
1202
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/alternate_identifiers.yml