neurolibre 1.5.7 → 1.5.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5b0fdff71e32a79ca2bd3d2ecfe6b8f670dcc0e1c509cc05d4f2c2c99123dc6
4
- data.tar.gz: a65f2aedad14e0e4ca0d3152662a3376f53948bcc4fa1a23e6d8135955acdea8
3
+ metadata.gz: d551d008924929db68dc5ffb268b705b3d245310a6beacfb6f0caddc86a492df
4
+ data.tar.gz: f852c56ee6e7c9826eda7dc89ab0f1698d44754edf825924e4ea402cdf771b09
5
5
  SHA512:
6
- metadata.gz: 7697da4e5b9007bc625499662ebd58b54f1e6bf1c36b1d25dc66f0753b4b02b1fd652c66021d2ebaa8bb8e434e668cbefb47df9c5b244247f006643ae57b9a41
7
- data.tar.gz: 1c006318aaa671cedff181134ca7a100b4c82dd12925172f7182eb322f76b32eef1e00261183c04d26c27b02e589903662e6e4ceb21c956b3a7b149cef983988
6
+ metadata.gz: 38fe331c552a555bd299ecbce13e2140cf12557fcde5606d00d3b0dcfb909f49b2ee1c4961bcff3ecb825e9bfc1ac1ec1486e7b27bd9f8f18bb5df2c5aa76b20
7
+ data.tar.gz: 76e04948fca0a7fa7fa2146e44fa71e477292c8b732abdf5a32e594b0aa0cd51fbbcdcbbd33cf0b6bc76527e224c69d5b86eb31e60a376e210f1f7ff317e6189
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.8 (2026-11-06)
4
+
5
+ - A paper.md with no front matter block takes all of its metadata from
6
+ myst.yml. The 1.5.7 fallback was never reached for such a paper: the whole
7
+ file was handed to the YAML parser, which read the markdown body as YAML and
8
+ raised `mapping values are not allowed in this context` on the first line
9
+ of prose with a colon in it.
10
+ - The spec helper requires the gem's own entry file, so the suite loads again.
11
+
3
12
  ## 1.5.7 (2026-08-19)
4
13
 
5
14
  - Paper metadata falls back to myst.yml when a key is absent from the paper's
data/lib/theoj/paper.rb CHANGED
@@ -125,11 +125,22 @@ module Theoj
125
125
  def front_matter_metadata
126
126
  if paper_path.include?('.tex')
127
127
  YAML.load_file(paper_path.gsub('.tex', '.yml'))
128
- else
128
+ elsif front_matter_block?(paper_path)
129
129
  YAML.load_file(paper_path)
130
+ else
131
+ # No front matter: everything comes from myst.yml. Parsing the file
132
+ # anyway would read the markdown body as YAML, and prose with a
133
+ # colon in it ("Note: see below") is a Psych syntax error.
134
+ nil
130
135
  end
131
136
  end
132
137
 
138
+ # Does the paper open with a `---` line, the start of a YAML front matter block?
139
+ def front_matter_block?(path)
140
+ first_line = File.open(path, &:gets).to_s
141
+ first_line.strip == "---"
142
+ end
143
+
133
144
  def parse_authors
134
145
  parsed_authors = []
135
146
  authors_metadata = @paper_metadata['authors']
data/lib/theoj/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Theoj
2
- VERSION = "1.5.7"
2
+ VERSION = "1.5.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neurolibre
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.7
4
+ version: 1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juanjo Bazán
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-20 00:00:00.000000000 Z
11
+ date: 2026-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit