andromeda_cms 0.4.2-aarch64-linux → 0.6.0-aarch64-linux
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 +4 -4
- data/CHANGELOG.md +27 -0
- data/README.md +19 -4
- data/lib/andromeda/entry.rb +16 -0
- data/lib/andromeda/helpers.rb +8 -3
- data/lib/andromeda/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5651680f10561904a02f8626baa6f59e4d5bf540131a3fc0653e5025e4a39114
|
|
4
|
+
data.tar.gz: a403b5c8a6a1dd1da2a3b978be2027a0da1edd6628b81326be6e2b36b2847eff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24cc9016120eee6474096caf06d4f82fcf1eccb648df857b99919ccc4a4dad377b7521bf779070ab266443544a20e71732f95f8920e9e7ebb16f314d1c871877
|
|
7
|
+
data.tar.gz: 895dc27f36bc43bcd19f8daacbf17e165f9d46832a321885f70f7a7a85696b0a843c2b8ca6fedeeccfc68892f71ec6ca6f751aae1bef9d47812bb25bf7a5d25a
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.0] - 2026-10-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `Entry.replace_entries(list)` swaps a collection's entries in tests without
|
|
13
|
+
depending on internal cache variables; `reload!` restores the real ones.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- The gem now requires `json < 3`, so `bundle update` no longer pulls in a
|
|
18
|
+
version that breaks session cookie decryption on Rails 8.1. The `Gemfile`
|
|
19
|
+
pin from the README is no longer needed.
|
|
20
|
+
|
|
21
|
+
## [0.5.0] - 2026-10-07
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- `andromeda_content` now wraps the entry body in an `<andromeda-content>`
|
|
26
|
+
element, so the body can be targeted from CSS. Browsers treat an unknown
|
|
27
|
+
element as inline, so add `andromeda-content { display: block; }` to your
|
|
28
|
+
stylesheet. Markup that selected the body's direct children from the
|
|
29
|
+
parent element needs updating. Inside a component rendered during
|
|
30
|
+
`andromeda:build` the wrapper is left out, so an embedded entry is not
|
|
31
|
+
wrapped twice.
|
|
32
|
+
|
|
8
33
|
## [0.4.2] - 2026-09-30
|
|
9
34
|
|
|
10
35
|
### Fixed
|
|
@@ -141,6 +166,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
141
166
|
- Generators: `andromeda:install`, `andromeda:collection`,
|
|
142
167
|
`andromeda:component` and `andromeda:import_astro`.
|
|
143
168
|
|
|
169
|
+
[0.6.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.6.0
|
|
170
|
+
[0.5.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.5.0
|
|
144
171
|
[0.4.2]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.4.2
|
|
145
172
|
[0.4.1]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.4.1
|
|
146
173
|
[0.4.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.4.0
|
data/README.md
CHANGED
|
@@ -107,6 +107,10 @@ end
|
|
|
107
107
|
</article>
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
`andromeda_content` wraps the body in an `<andromeda-content>` element. Browsers
|
|
111
|
+
treat it as inline by default, so add `andromeda-content { display: block; }`
|
|
112
|
+
to your stylesheet.
|
|
113
|
+
|
|
110
114
|
From there it is your code. A typical next step is to make fields mandatory,
|
|
111
115
|
add a draft flag, and add a table of contents:
|
|
112
116
|
|
|
@@ -303,16 +307,27 @@ bundle exec rake test:corpus # after test/fetch_corpus.sh: parse ~370 real Astr
|
|
|
303
307
|
## Troubleshooting
|
|
304
308
|
|
|
305
309
|
**`ArgumentError: wrong number of arguments (given 2, expected 1)` from `JSON.parse`.**
|
|
306
|
-
Not this gem: Rails 8.1 calls `JSON.parse` with a positional options hash,
|
|
307
|
-
version 3 of the `json` gem no longer accepts, and decrypting a session
|
|
308
|
-
hits that path
|
|
309
|
-
|
|
310
|
+
Not this gem's code: Rails 8.1 calls `JSON.parse` with a positional options hash,
|
|
311
|
+
which version 3 of the `json` gem no longer accepts, and decrypting a session
|
|
312
|
+
cookie hits that path, so pages fail only once a session exists. The gem
|
|
313
|
+
restricts `json` to `< 3` to avoid this. If you are on an older andromeda_cms,
|
|
314
|
+
pin it in your own `Gemfile` until Rails ships a fix:
|
|
310
315
|
|
|
311
316
|
```ruby
|
|
312
317
|
# Gemfile
|
|
313
318
|
gem "json", "~> 2.9"
|
|
314
319
|
```
|
|
315
320
|
|
|
321
|
+
## Testing
|
|
322
|
+
|
|
323
|
+
To run model tests against entries that are not files under `app/content`,
|
|
324
|
+
swap them in with `replace_entries` and restore the real ones with `reload!`:
|
|
325
|
+
|
|
326
|
+
```ruby
|
|
327
|
+
setup { Content::Post.replace_entries([Content::Post.new(id: "a", collection: :posts, data: { title: "A" }, body: "", file_path: "a.md", digest: "x")]) }
|
|
328
|
+
teardown { Content::Post.reload! }
|
|
329
|
+
```
|
|
330
|
+
|
|
316
331
|
## Contributing
|
|
317
332
|
|
|
318
333
|
Bug reports are welcome; patches are not. Andromeda is open source but not open
|
data/lib/andromeda/entry.rb
CHANGED
|
@@ -184,6 +184,22 @@ module Andromeda
|
|
|
184
184
|
@entries_signature = nil
|
|
185
185
|
end
|
|
186
186
|
|
|
187
|
+
# Swaps the collection's entries for `list`, so tests can run against
|
|
188
|
+
# entries that are not backed by files under `app/content`. The cache
|
|
189
|
+
# signature is set to match the current source files, so the next query
|
|
190
|
+
# keeps `list` instead of noticing a mismatch and re-reading the files;
|
|
191
|
+
# setting `@entries` alone leaves the signature nil and the swap is
|
|
192
|
+
# silently undone. A later source file change, or `reload!`, restores
|
|
193
|
+
# the real entries.
|
|
194
|
+
#
|
|
195
|
+
# @param list [Array<Andromeda::Entry>]
|
|
196
|
+
# @return [Array<Andromeda::Entry>]
|
|
197
|
+
def replace_entries(list)
|
|
198
|
+
@entries = list.to_a.dup
|
|
199
|
+
@entries_signature = production? ? nil : source_signature
|
|
200
|
+
@entries
|
|
201
|
+
end
|
|
202
|
+
|
|
187
203
|
private
|
|
188
204
|
|
|
189
205
|
# Production never touches source files: everything a query
|
data/lib/andromeda/helpers.rb
CHANGED
|
@@ -5,7 +5,11 @@ module Andromeda
|
|
|
5
5
|
# thin presentation layer over data the build already produced: no parsing
|
|
6
6
|
# or rendering happens while serving a request.
|
|
7
7
|
module Helpers
|
|
8
|
-
# Outputs an entry's converted body
|
|
8
|
+
# Outputs an entry's converted body, wrapped in `<andromeda-content>` so
|
|
9
|
+
# it can be targeted from CSS. Inside a component rendered at conversion
|
|
10
|
+
# time the wrapper is left out: the component's output is stored in the
|
|
11
|
+
# entry's html and wrapped once, when the page is served. Marked
|
|
12
|
+
# html_safe because the build
|
|
9
13
|
# produced this markup from content the application's own authors wrote,
|
|
10
14
|
# the same trust model Astro applies to `.md`/`.mdx` (see 13_security).
|
|
11
15
|
# Inside a component rendered at conversion time the asset markers are
|
|
@@ -14,8 +18,9 @@ module Andromeda
|
|
|
14
18
|
# @param entry [Andromeda::Entry]
|
|
15
19
|
# @return [ActiveSupport::SafeBuffer]
|
|
16
20
|
def andromeda_content(entry)
|
|
17
|
-
html
|
|
18
|
-
|
|
21
|
+
return entry.html.html_safe if Andromeda::BuildContext.converting? # rubocop:disable Rails/OutputSafety
|
|
22
|
+
|
|
23
|
+
tag.send("andromeda-content", Andromeda::Assets.resolve(entry.html).html_safe) # rubocop:disable Rails/OutputSafety
|
|
19
24
|
end
|
|
20
25
|
|
|
21
26
|
# Inside a component partial rendered at conversion time, this returns
|
data/lib/andromeda/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: andromeda_cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- LIMHAUS Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '2.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: json
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "<"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "<"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '3'
|
|
69
83
|
description: |
|
|
70
84
|
Andromeda brings Astro's content collections to an ordinary Ruby on Rails
|
|
71
85
|
app. Markdown and MDX files copied from an Astro project are validated
|