bergamasco 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/bergamasco/markdown.rb +2 -1
- data/lib/bergamasco/version.rb +1 -1
- data/spec/markdown_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da851e868923db31de5b7fc89bb91f9b36a3ab83
|
4
|
+
data.tar.gz: 0596c056ed1cf7d4c4ed4ccd6cc7ee262965dce4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c04a737a3eb7354e94a7a18eb07dab2f0bd5759470447dbf97ceb449c3486baf4c933335fb236bd06a6f35f551b54d9d5b5134504a49d4431cfc3f32cbd296d
|
7
|
+
data.tar.gz: fce246a7884d0ad071c1cdc07bb3fc0026d88f258eec855e3d0f99947b5778f46b6229c60057c92a43b9e71b483cc04e15242a802bf1e56002fb370d89d13aea
|
data/Gemfile.lock
CHANGED
data/lib/bergamasco/markdown.rb
CHANGED
@@ -69,6 +69,7 @@ module Bergamasco
|
|
69
69
|
CommonMarker.render_html(text, :default)
|
70
70
|
end
|
71
71
|
|
72
|
+
# expects a references list generated by pandoc
|
72
73
|
def self.extract_references(html, options={})
|
73
74
|
doc = Nokogiri::HTML(html)
|
74
75
|
doc.xpath('//div[@id="refs"]/div/@id').map do |ref|
|
@@ -83,7 +84,7 @@ module Bergamasco
|
|
83
84
|
end
|
84
85
|
|
85
86
|
{
|
86
|
-
|
87
|
+
value: id,
|
87
88
|
related_identifier_type: type,
|
88
89
|
relation_type: "references"
|
89
90
|
}
|
data/lib/bergamasco/version.rb
CHANGED
data/spec/markdown_spec.rb
CHANGED
@@ -53,10 +53,10 @@ describe Bergamasco::Markdown do
|
|
53
53
|
filepath = fixture_path + 'cool-dois.html.md'
|
54
54
|
separator = "READMORE"
|
55
55
|
metadata = subject.read_yaml_for_doi_metadata(filepath, separator: separator, csl: 'spec/apa.csl', bibliography: 'spec/references.bib')
|
56
|
-
expect(metadata["related_identifiers"]).to eq([{:
|
56
|
+
expect(metadata["related_identifiers"]).to eq([{:value=>"https://www.w3.org/Provider/Style/URI",
|
57
57
|
:related_identifier_type=>"URL",
|
58
58
|
:relation_type=>"references"},
|
59
|
-
{ :
|
59
|
+
{ :value=>"10.1371/JOURNAL.PONE.0115253",
|
60
60
|
:related_identifier_type=>"DOI",
|
61
61
|
:relation_type=>"references" }])
|
62
62
|
end
|
@@ -89,10 +89,10 @@ describe Bergamasco::Markdown do
|
|
89
89
|
file = IO.read(filepath)
|
90
90
|
html = subject.render_html(file, skip_yaml_header: true, csl: 'spec/apa.csl', bibliography: 'spec/references.bib')
|
91
91
|
refs = subject.extract_references(html, skip_yaml_header: true, csl: 'spec/apa.csl', bibliography: 'spec/references.bib')
|
92
|
-
expect(refs).to eq([{:
|
92
|
+
expect(refs).to eq([{:value=>"https://www.w3.org/Provider/Style/URI",
|
93
93
|
:related_identifier_type=>"URL",
|
94
94
|
:relation_type=>"references"},
|
95
|
-
{ :
|
95
|
+
{ :value=>"10.1371/JOURNAL.PONE.0115253",
|
96
96
|
:related_identifier_type=>"DOI",
|
97
97
|
:relation_type=>"references" }])
|
98
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bergamasco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|