bergamasco 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bergamasco/markdown.rb +2 -2
- data/lib/bergamasco/version.rb +1 -1
- data/spec/markdown_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaa833ffb770d75838b831b557b42e8b57222212
|
4
|
+
data.tar.gz: c4d1df252794388585a78b6ade862df62fa73780
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33107f5e4461710a78fffe2507a41cd577c471a669481cbfbd0ad5aec7a743c15f6b3dbf3be02376d031ccd7ce919d010e77ebdd942c4ca3423586d313b5b79d
|
7
|
+
data.tar.gz: 7077e2f957d95f41a649984c0daa4b3def8e12ac9309136a65a138fb9fccd2ea827a81b5f52727c60d3c0dc9ab499e84e31499a040514c3072b5f8f8e0266089
|
data/Gemfile.lock
CHANGED
data/lib/bergamasco/markdown.rb
CHANGED
@@ -37,7 +37,7 @@ module Bergamasco
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.read_yaml_for_doi_metadata(filepath, options={})
|
40
|
-
keys = options[:keys] || ["title", "author", "date", "tags", "summary", "doi", "type", "version", "
|
40
|
+
keys = options[:keys] || ["title", "author", "date", "tags", "summary", "doi", "type", "version", "references"]
|
41
41
|
unless File.exist?(filepath)
|
42
42
|
parentdir = Pathname.new(filepath).parent
|
43
43
|
FileUtils.mkdir_p parentdir
|
@@ -51,7 +51,7 @@ module Bergamasco
|
|
51
51
|
content = YAML_FRONT_MATTER_REGEXP.match(file).post_match
|
52
52
|
html = render_html(content, options)
|
53
53
|
metadata["summary"] = Bergamasco::Summarize.summary_from_html(html, options)
|
54
|
-
metadata["
|
54
|
+
metadata["references"] = extract_references(html)
|
55
55
|
metadata["date"] = metadata["date"].iso8601
|
56
56
|
metadata
|
57
57
|
end
|
data/lib/bergamasco/version.rb
CHANGED
data/spec/markdown_spec.rb
CHANGED
@@ -53,7 +53,7 @@ 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/fixtures/apa.csl', bibliography: 'spec/fixtures/references.yaml')
|
56
|
-
expect(metadata["
|
56
|
+
expect(metadata["references"]).to eq(["https://www.w3.org/Provider/Style/URI", "https://doi.org/10.1371/journal.pone.0115253"])
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'should write yaml' do
|