bible270 0.9.0 → 0.10.0

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +147 -247
  3. data/README.md +151 -73
  4. data/Rakefile +5 -4
  5. data/app/controllers/bible270/admin_controller.rb +119 -0
  6. data/app/controllers/bible270/application_controller.rb +19 -2
  7. data/app/controllers/bible270/checkoffs_controller.rb +2 -3
  8. data/app/controllers/bible270/comments_controller.rb +6 -2
  9. data/app/controllers/bible270/days_controller.rb +5 -6
  10. data/app/controllers/bible270/readers_controller.rb +5 -4
  11. data/app/controllers/bible270/sessions_controller.rb +60 -26
  12. data/app/helpers/bible270/plan_helper.rb +11 -8
  13. data/app/mailers/bible270/application_mailer.rb +4 -1
  14. data/app/mailers/bible270/sign_in_mailer.rb +1 -0
  15. data/app/models/bible270/application_record.rb +1 -0
  16. data/app/models/bible270/checkoff.rb +4 -3
  17. data/app/models/bible270/comment.rb +26 -5
  18. data/app/models/bible270/reader.rb +78 -14
  19. data/app/models/bible270/sign_in_token.rb +5 -2
  20. data/app/views/bible270/admin/comments.html.erb +44 -0
  21. data/app/views/bible270/admin/index.html.erb +30 -0
  22. data/app/views/bible270/admin/show.html.erb +89 -0
  23. data/app/views/bible270/days/index.html.erb +10 -13
  24. data/app/views/bible270/readers/index.html.erb +2 -2
  25. data/app/views/bible270/readers/show.html.erb +5 -5
  26. data/app/views/bible270/sessions/new.html.erb +9 -3
  27. data/app/views/bible270/shared/_header.html.erb +1 -0
  28. data/app/views/bible270/shared/_styles.html.erb +10 -7
  29. data/config/routes.rb +32 -18
  30. data/db/migrate/20260101000001_create_bible270_readers.rb +3 -2
  31. data/db/migrate/20260101000002_create_bible270_checkoffs.rb +3 -2
  32. data/db/migrate/20260101000003_create_bible270_comments.rb +4 -3
  33. data/db/migrate/20260101000004_create_bible270_sign_in_tokens.rb +4 -3
  34. data/db/migrate/20260101000005_add_names_to_bible270_readers.rb +12 -0
  35. data/db/migrate/20260101000006_add_approval_to_bible270_comments.rb +11 -0
  36. data/lib/bible270/configuration.rb +67 -24
  37. data/lib/bible270/email_sign_in.rb +7 -7
  38. data/lib/bible270/engine.rb +1 -0
  39. data/lib/bible270/plan.rb +355 -101
  40. data/lib/bible270/versification.rb +84 -67
  41. data/lib/bible270/version.rb +2 -1
  42. data/lib/bible270.rb +6 -5
  43. data/lib/generators/bible270/install/install_generator.rb +521 -38
  44. data/lib/generators/bible270/install/templates/bible270.rb.tt +2 -2
  45. metadata +8 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f43ceaccb5fe5397321e30f7160d5014d0770d151aabba1c5e67f4cd0e03839a
4
- data.tar.gz: 32bc3eb138bc02fdcd2057c19b4fb2393b70cd2317b85e9c2975b14b0a5799ff
3
+ metadata.gz: caabc409caaf37d3eeb8a0dd6d0cddba68889fd8deb914e9755c5bb67a571b65
4
+ data.tar.gz: 0dbe187325f50430c2e689307f521b4c2854980de9e409ffc667aaa30eb0102f
5
5
  SHA512:
6
- metadata.gz: 32dd6ec910606937339b441d3afd0bc09dcbc37b409b7a8d5d7b0c80287ba1c67409f818ab4a8b8f876478b013e8a0afbe27e3ae31a2d8388bd0905152123e74
7
- data.tar.gz: d99dc775189163a6a67ed1ad8de20abfa2b7924bf13a6e20295edc6ad9c3c348abd016252bc0e4f589dd7988614ead0eb1b7e3846c42d5b08f873b712db284ad
6
+ metadata.gz: 36bcfb1789a6a6248f4cbfb2e30e8b86878535295958720d121837816e2b7eb243c340002b39d189b10f4496dda2ff5da9915d3c55b50eaa0bb0eead710d450e
7
+ data.tar.gz: c72aaa3f95ab86a4e5139a1d8c7e46e2762c8d9d796b84203fbd8c99ecc153158a1ce6cc1375ac4048025f6c9f93c0f918f3f923677ccaa13d16983ed24e5b70
data/CHANGELOG.md CHANGED
@@ -1,281 +1,181 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to bible270. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
4
- this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html), treating pre-1.0 minor
5
- bumps as the place breaking changes may land.
4
+ this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html), treating pre-1.0 minor bumps as the place breaking changes may land.
5
+
6
+ ## Unreleased Changes
7
+
8
+ See the changes since the last release:
9
+
10
+ **[Full Changelog](https://github.com/avonderluft/bible270/compare/v0.10.0...main)**
11
+
12
+ ## [0.10.0] — 2026-07-26
13
+
14
+ ### Reading plan
15
+ - **Proverbs is read once**, not twice, and its longer chapters are divided — at the discourse
16
+ boundaries in chapters 1–9 and 30–31, evenly elsewhere, since 10–29 are collections of
17
+ independent sayings.
18
+ - **A psalm of 25 verses or fewer is never divided** (`PSALM_WHOLE_MAX_VERSES`), which keeps 131 of
19
+ the 150 psalms whole. Psalms over 25 verses break at their turns of thought.
20
+ - **A divided chapter is always read on consecutive days.** Nothing is inserted between the parts of
21
+ a split psalm.
22
+ - Psalms and Proverbs are now divided against a single budget, so the two books balance by verse
23
+ load rather than each being squeezed into a fixed number of days.
24
+ - The New Testament is read once with a reading every day: 260 chapters over 270 days, so the
25
+ longest are divided (at content boundaries via `CHAPTER_BREAKS`, e.g. Luke 1 at the annunciations,
26
+ Magnificat and Benedictus).
27
+ - `CHAPTER_BREAKS` lets any chapter's break points be set by hand, or `[]` to force it whole. Break
28
+ points are validated; a bad entry raises rather than silently overlapping.
29
+ - Break points can also come from the host app and be changed **without restarting**:
30
+ `config.chapter_breaks`, or a YAML file at `config.chapter_breaks_path` re-read whenever it
31
+ changes. Precedence: constant < config < file.
32
+
33
+ ### Features
34
+ - **Interactive installer** — `bin/rails generate bible270:install` asks where to mount, which
35
+ sign-in methods to enable, writes the initializers, adds the `mount` line, copies the migrations
36
+ and runs them. Scriptable with `--defaults` and friends.
37
+ - **`config.mount_at`** — the mount path in one place; routes and OmniAuth both read it.
38
+ - **Passwordless email sign-in** with single-use magic links; only a SHA-256 digest is stored, and
39
+ the response never reveals whether an address exists. First and last name are required.
40
+ - **Configurable start dates** — community-wide or per reader, with a Today badge and a pace
41
+ indicator. Check-offs are keyed to day numbers, so changing a date never moves history.
42
+ - **Admin panel** (`/admin`, gated by `config.admin_emails` or `config.admin_resolver`; unauthorised
43
+ requests 404 rather than 403). Remove readers, set their progress exactly (mark complete through a
44
+ day, or toggle individual days), and move them to a given day of the plan — which re-maps the
45
+ calendar only, since check-offs are keyed to day numbers.
46
+ - **Comment moderation.** Reflections are **visible as soon as they are written** — moderation is for
47
+ taking something down afterwards, not gatekeeping every post. An admin can hide a reflection
48
+ (removing it from the day and community pages while keeping the writer's words, reversibly) or
49
+ delete it outright, from a list filterable by visible/hidden or from the writer's own page.
6
50
 
7
- ## [0.9.0] — 2026-07-25
8
-
9
- ### Changed
10
- - **The New Testament now has a reading every day — no days off.** 260 chapters over 270 days is
11
- reconciled by dividing the 10 longest chapters in two: Luke 1, Matthew 26 and 27, Mark 14,
12
- Luke 9, 12 and 22, John 6 and 8, and Acts 7. Luke 1 reads as 1–40 then 41–80. This drops the
13
- longest NT reading from 80 verses to 58 (stdev 14.6 11.4) and removes the 10 rest days from
14
- 0.8.0, so all three tracks are present on all 270 days and every day needs three check-offs.
15
- - The daily total is now 76–175 verses (was 76–203), averaging ~119.
16
-
17
- ### Added
18
- - Shared division machinery used by both the NT and the Psalms: `Plan.divide_to_fill`,
19
- `expand_readings`, `segment_length`, `format_segment`, `divided`.
20
- - `Plan.nt_parts`, `nt_readings`, `nt_chapters`, `divided_nt_chapters`, `psalm_chapters`.
21
- - `totals` reports `nt_readings` (270) and `nt_divided` (10).
22
-
23
- ### Removed
24
- - `Plan.nt_groups`, `format_pp_segment`, `pp_segment_length` (superseded by the shared
25
- `format_segment` and `segment_length`), and `totals[:nt_rest_days]`.
26
- - `nt_rest_days` remains but now always returns an empty array.
27
-
28
- ## [0.8.0]2026-07-25
29
-
30
- ### Changed BREAKING (the reading plan itself)
31
- - **New Testament is read once**, not twice: one chapter a day with 10 evenly spaced days off
32
- (every 27th). Matthew 1 on day 1, Revelation 22 on day 270. Chapters stay whole, so the NT load
33
- swings with chapter length (8–80 verses: Revelation 15 to Luke 1). Verse-balancing the NT would
34
- have needed 48 rest days,
35
- since 260 whole chapters can't spread evenly over 270 days — one-a-day is the better trade.
36
- - **Psalms once and Proverbs twice**, interleaved in the third track. Proverbs contributes
37
- 31 × 2 = 62 whole-chapter readings, spaced evenly, which leaves 208 days for the Psalms.
38
- - **Psalm 119 is divided into 11 sections of exactly 16 verses** (176 = 11 × 16 — two of its
39
- eight-verse acrostic stanzas per reading), replacing the previous two-part split.
40
- - **Longer psalms are divided to fill the remaining days.** After Psalm 119's 11 sections, 48 further
41
- divisions are spent on whichever psalm currently carries the heaviest reading, so the longest go
42
- first: 41 psalms end up divided and no single psalm reading exceeds 20 verses.
43
- - Short psalms are no longer merged with a neighbour — the track now needs more readings, not fewer,
44
- so every psalm stands on its own day or is divided. Psalm 117 is a light day (2 verses) on that
45
- track, though the day still carries its OT and NT readings.
46
- - Proverbs 31 lands on day 135 and again on day 270; Psalm 150 on day 269.
47
- - A typical day is now ~119 verses (range 76–203), down from ~157.
48
-
49
- ### Added
50
- - `Plan.psalm_parts`, `psalm_readings`, `proverbs_readings`, `pp_readings`, `proverbs_days`,
51
- `divided_psalms`, `nt_rest_days`, `pp_segment_length`, `format_pp_segment`.
52
- - `totals` now reports `psalms`, `psalm_readings`, `proverbs`, `proverbs_passes`,
53
- `proverbs_readings`, and `nt_rest_days`.
54
-
55
- ### Removed
56
- - `PP_LONG_CHAPTER`, `PP_SPLIT_PARTS`, `PP_MIN_DAY`, `PP_DAY_TARGET` (no more merging or
57
- threshold-based splitting), `pp_base_portions`, `pp_cycle_length`, `format_pp`,
58
- `nt_days_per_pass`, `nt_second_pass_start_day`, `nt_chapters`, and `totals[:nt_chapters_read]`.
59
- - New tuning constants are `PROVERBS_PASSES` and `PSALM_119_SECTION_SIZE`.
51
+ ### Fixed
52
+ - Sign-in was broken: OmniAuth 2.0+ rejects GET on its request phase, so the controls are now POST
53
+ forms with CSRF tokens. Open-redirect hardening on the return-to path, and `reset_session` on
54
+ sign-in and sign-out.
55
+ - `db:migrate` failed with `DuplicateMigrationNameError` the engine both appended its migrations
56
+ to the host's paths and shipped `install:migrations`.
57
+ - Views raised `uninitialized constant Plan`: a template's lexical scope is `Object`, so engine
58
+ constants must be fully qualified.
59
+ - Views raised `undefined method 'b270_*'`: Rails only auto-includes an engine's helpers when the
60
+ controller's superclass is exactly `ActionController::Base`, which it isn't once
61
+ `config.parent_controller` points at the host.
62
+ - Buttons rendered dark-on-dark: `.b270 a{color:inherit}` outranked `.b270-btn`.
63
+ - The generated OmniAuth initializer called `path_prefix`, which `OmniAuth::Builder` does not
64
+ define, and read credentials at boot so a bad master key stopped the app starting.
65
+ - The sign-in email was rendered inside the host's mailer layout, nesting one HTML document in
66
+ another.
67
+ - Ruby 4.0 compatibility: dropped `cgi`, removed from default gems in 4.0.
68
+ - Posting a reflection about the whole day failed with "Track is not included in the list": the
69
+ form's blank option submits an empty string, which `allow_nil` rejects. Blank tracks are now
70
+ normalised to NULL before validation.
71
+
72
+ - `config.email_sign_in_log_link`tri-state: nil logs the sign-in link in development and test
73
+ only, true forces it on (for smoke-testing a production build locally before mail is wired up),
74
+ false disables it. The log also distinguishes sent, rate-limited and failed delivery, which the
75
+ response deliberately cannot.
76
+ - A test asserts every setting the code calls is actually defined on `Configuration`, so a missing
77
+ accessor fails the suite instead of raising `NoMethodError` on whichever request touches it.
60
78
 
61
79
  ### Notes
62
- - A day counts as complete when every track with content is ticked: three normally, two on the 10 NT
63
- rest days. Check-offs are keyed to day and track, so existing rows stay valid — but the readings
64
- those rows point at have changed, so anyone mid-plan is now tracking a different schedule.
80
+ - Table names changed from `bible_reading_plan_*` in the 0.9.0 line; this is a fresh install.
65
81
 
66
- ## [0.7.0] — 2026-07-25
82
+ ## [0.9.0] — 2026-07-25
67
83
 
68
- ### Added
69
- - **`config.mount_at`** — the mount path is now defined in one place, defaulting to `/daily-bread`.
70
- `config/routes.rb` uses `mount Bible270::Engine, at: Bible270.config.mount_at` and
71
- `config/initializers/omniauth.rb` uses `path_prefix Bible270.config.auth_path_prefix`, so moving
72
- the plan is a one-line change. Values are normalised (`"read270"`, `"/read270"`, `"/read270/"` all
73
- become `/read270`); nested paths and mounting at `/` are supported.
74
- - `config.auth_path_prefix`, derived as `"<mount_at>/auth"`. An explicit
75
- `config.omniauth_path_prefix` still takes precedence for unusual setups.
84
+ **[Full Changelog](https://github.com/avonderluft/bible270/compare/v0.6.2...v0.9.0)**
76
85
 
77
86
  ### Changed
78
- - The install generator defaults to `/daily-bread`, writes `config.mount_at` into the engine
79
- initializer, and emits a config-driven `mount` line and `path_prefix` rather than literal paths.
80
- `--mount-at` is still accepted to set the initial value.
81
- - README documents the mount point in one section, including the initializer load-order caveat
82
- (`bible270.rb` must be read before `omniauth.rb`; alphabetical ordering makes the default naming
83
- work) and the two things that still need editing by hand when the path changes: OAuth callback URLs
84
- and any CMS links.
85
-
86
- ### Notes
87
- - The engine's own sign-in paths are built from `request.script_name` at runtime, so they follow the
88
- mount point without configuration.
89
-
90
- ## [0.6.3] — 2026-07-25
91
87
 
92
- ### Fixed
93
- - **`db:migrate` failed with `ActiveRecord::DuplicateMigrationNameError`.** The engine appended its
94
- own `db/migrate` to the host application's migration paths *and* exposed
95
- `bible270:install:migrations`. Using the task — the documented install step — meant every
96
- migration class was defined twice, once in the host's `db/migrate` and once in the gem. The engine
97
- no longer touches the host's migration paths; copying via the task is the single supported path,
98
- which also means the host owns the migrations and they appear in `schema.rb` normally.
99
-
100
- ### Added
101
- - `spec.email` in the gemspec.
102
-
103
- ## [0.6.2] — 2026-07-24
104
-
105
- ### Changed
106
- - Gem metadata now points at the actual repository rather than reusing the homepage:
107
- `source_code_uri`, `bug_tracker_uri`, and `changelog_uri` all resolve to
108
- <https://github.com/avonderluft/bible270>.
109
- - `rubygems_mfa_required` is set, so pushes to rubygems.org require MFA.
88
+ * **The New Testament now has a reading every day — no days off.** 260 chapters over 270 days is reconciled by dividing the 10 longest chapters in two: Luke 1, Matthew 26 and 27, Mark 14, Luke 9, 12 and 22, John 6 and 8, and Acts 7. Luke 1 reads as 1–40 then 41–80. This drops the longest NT reading from 80 verses to 58 (stdev 14.6 → 11.4) and removes the 10 rest days from 0.8.0, so all three tracks are present on all 270 days and every day needs three check-offs.
89
+ * The daily total is now 76–175 verses (was 76–203), averaging ~119.
110
90
 
111
91
  ### Added
112
- - This changelog, packaged with the gem.
113
92
 
114
- ## [0.6.1] 2026-07-24
93
+ * Shared division machinery used by both the NT and the Psalms: `Plan.divide_to_fill`, `expand_readings`, `segment_length`, `format_segment`, `divided`.
94
+ * `Plan.nt_parts`, `nt_readings`, `nt_chapters`, `divided_nt_chapters`, `psalm_chapters`.
95
+ * `totals` reports `nt_readings` (270) and `nt_divided` (10).
115
96
 
116
- ### Changed
117
- - Author and copyright now read "Andrew vonderLuft".
118
- - The display-name-from-email example in the docs and tests uses a neutral address, since the
119
- algorithm can't recover internal capitals and shouldn't be shown rendering a real name wrongly.
120
-
121
- ## [0.6.0] — 2026-07-24
122
-
123
- ### Added
124
- - **Passwordless email sign-in**, so readers without a GitHub/Google/etc. account can take part.
125
- A reader enters their address, receives a single-use link, and clicks it — no password anywhere
126
- in the gem.
127
- - Tokens are 256-bit and URL-safe, expire after 20 minutes (`email_sign_in_ttl`), and are stored
128
- **only as a SHA-256 digest**, so the table is useless to anyone reading the database.
129
- - Claiming a link is a conditional `UPDATE`, so a double-clicked link cannot sign in twice.
130
- - The "check your inbox" response is identical for known, unknown, and rate-limited addresses:
131
- no account enumeration and no signal that a limit was hit.
132
- - Rate limited per address per window (`email_sign_in_max_per_window`, `email_sign_in_window`).
133
- - Readers may choose the display name shown beside their reflections
134
- (`email_sign_in_ask_name`); otherwise it is derived from the address.
135
- - `Bible270::SignInToken.sweep!` clears spent and stale rows from a cron or rake task.
136
- - `Bible270::EmailSignIn` — Rails-free module holding the normalization and token logic, so the
137
- security-relevant parts are unit testable on their own.
138
- - `Bible270::SignInMailer` with text and HTML magic-link templates. The sign-in URL is built by the
139
- controller, so the mailer needs no `default_url_options`.
140
- - `Bible270::Reader.from_email`, using the same identity columns as OmniAuth with `provider: "email"`,
141
- so every reader is treated identically downstream.
142
- - New table: `bible270_sign_in_tokens` (migration `20260101000004`).
143
- - `config.any_sign_in_method?`, letting views detect a deployment with no sign-in configured.
97
+ ### Removed
144
98
 
145
- ### Fixed
146
- - `display_name_from` raised `ArgumentError` on any address containing an underscore:
147
- `tr("._-+", …)` was parsed as a character range. The hyphen now comes last.
99
+ * `Plan.nt_groups`, `format_pp_segment`, `pp_segment_length` (superseded by the shared `format_segment` and `segment_length`), and `totals[:nt_rest_days]`.
100
+ * `nt_rest_days` remains but now always returns an empty array.
148
101
 
149
- ### Requirements
150
- - Email sign-in needs working Action Mailer delivery in the host application. Set
151
- `config.mailer_from`. Delivery is inline by default; set `email_sign_in_deliver_later` if a
152
- queue backend is available.
102
+ ## [0.6.2] — 2026-07-25
153
103
 
154
- ## [0.5.0] 2026-07-24
104
+ This is the initial public release.
155
105
 
156
106
  ### Added
157
- - Built-in OmniAuth sign-in is now fully wired as the primary auth path.
158
- - `config.omniauth_providers` accepts symbols or `[provider, label]` pairs, with labels for common
159
- providers and titleisation for anything custom.
160
- - Sign-in page at `GET <mount>/sign_in` listing every configured provider.
161
- - Sign-in controls carry the current path as `origin`, so a reader who clicks a check-off while
162
- signed out returns to that same day. Origins are validated as local paths only.
163
- - `rails generate bible270:install`, which writes both initializers with OmniAuth's `path_prefix`
164
- already aligned to the mount point, adds the `mount` line, and prints the callback URL to register.
165
- - `omniauth` (>= 2.0) and `omniauth-rails_csrf_protection` (>= 1.0) as runtime dependencies. Provider
166
- strategy gems remain the host's choice.
167
107
 
168
- ### Fixed
169
- - **Sign-in was broken.** The header rendered a GET link to `/auth/github`, but OmniAuth 2.0 disabled
170
- GET on the request phase (CVE-2015-9284). All sign-in controls are now POST forms with CSRF tokens.
171
- The old link also contained a dead ternary and hardcoded the provider.
172
- - Open-redirect hardening on the `origin` parameter: protocol-relative URLs, backslashes (which
173
- browsers may normalise to slashes), and auth routes are all rejected.
174
- - `reset_session` on sign-in and sign-out, against session fixation.
175
- - `Reader.from_omniauth` no longer assumes an `OmniAuth::AuthHash`; it tolerates plain hashes and
176
- missing `info`, and returns `nil` rather than raising on a malformed payload.
108
+ * Initial release of a mountable Rails engine providing a 270-day Bible reading plan with three daily tracks: Old Testament, New Testament, and Psalms/Proverbs.
109
+ * Per-reader check-offs, public per-day reflections, a community leaderboard, and reader profiles.
110
+ * Two identity paths: built-in session sign-in, or bridging the host application's users via `config.current_reader_resolver` and `Reader.for_owner`.
111
+ * A pure, deterministic Ruby schedule; the database stores readers, check-offs, and comments rather than plan rows.
112
+ * `Bible270::Versification`, providing per-chapter verse counts for all 66 books, generated from a public-domain KJV text and validated against canonical anchors.
113
+ * Verse-balanced daily portions rather than chapter-count balancing, so daily reading time is approximately even.
114
+ * Old Testament days grouped to be even in verses, averaging approximately 73 verses per day.
115
+ * Per-track progress bars based on days read rather than chapter totals.
116
+ * The New Testament read twice, with each pass occupying half of the 270-day plan. Whole chapters are verse-balanced within each pass.
117
+ * A Psalms/Proverbs companion plan resolving to exactly 135 portions, making two complete passes across the 270-day plan.
118
+ * Chapters are generally kept whole; Psalm 119 is divided into two readings, while shorter chapters may be combined with a neighboring psalm.
119
+ * Configurable start dates through `config.start_date` and `config.allow_reader_start_date`, including per-reader date management.
120
+ * Calendar mapping functions on `Bible270::Plan`: `date_for`, `day_for`, `end_date_for`, `before_start?`, `after_end?`, and `to_date`.
121
+ * Calendar-aware day pages, including a **Today** badge, a **Go to today** link, and a pace indicator.
122
+ * Built-in OmniAuth sign-in as the primary authentication path.
123
+ * Configurable OmniAuth providers, including labels for common providers and titleisation for custom providers.
124
+ * A sign-in page at `GET <mount>/sign_in`.
125
+ * `rails generate bible270:install`, which creates the initializers, adds the engine mount, configures OmniAuth's path prefix, and prints the callback URL.
126
+ * Passwordless email sign-in using single-use magic links.
127
+ * Secure email sign-in tokens that are 256-bit, URL-safe, expire after 20 minutes, and are stored only as SHA-256 digests.
128
+ * Rate limiting for email sign-in attempts and protection against account enumeration.
129
+ * Optional reader-selected display names for email sign-in.
130
+ * `Bible270::SignInToken.sweep!` for clearing spent and stale tokens.
131
+ * `Bible270::EmailSignIn`, a Rails-free module containing the normalization and token logic.
132
+ * `Bible270::SignInMailer` with text and HTML magic-link templates.
133
+ * `Bible270::Reader.from_email`, using the same identity columns as OmniAuth with `provider: "email"`.
134
+ * The `bible270_sign_in_tokens` table.
135
+ * `config.any_sign_in_method?`.
136
+ * A centralized `config.mount_at` setting, defaulting to `/daily-bread`, with derived `config.auth_path_prefix`.
137
+ * Support for nested mount paths and mounting at `/`.
138
+ * Configuration-driven engine mounting and OmniAuth path prefixes.
139
+ * `spec.email` in the gemspec.
140
+ * Gem metadata pointing to the actual repository for `source_code_uri`, `bug_tracker_uri`, and `changelog_uri`.
141
+ * RubyGems MFA requirement through `rubygems_mfa_required`.
142
+ * This changelog, packaged with the gem.
143
+ * Compatibility notes and tests covering Ruby 4.0 changes, including removal of the `cgi` dependency.
177
144
 
178
145
  ### Changed
179
- - `sign_out` is `DELETE` only (previously `GET` or `DELETE`).
180
- - Guarded actions redirect to the sign-in page instead of `request.referer`.
181
-
182
- ## [0.4.0] — 2026-07-24
183
-
184
- ### Added
185
- - **Configurable start dates.** `config.start_date` sets a community-wide cohort date (accepting a
186
- `Date`, `Time`, or `"YYYY-MM-DD"` string); `config.allow_reader_start_date` controls whether
187
- individuals may set their own. The four combinations give undated, per-reader, community-with-
188
- override, and fully pinned modes.
189
- - Readers manage their own date from the overview (`PATCH`/`DELETE <mount>/start-date`).
190
- - Calendar mapping as pure functions on `Bible270::Plan`: `date_for`, `day_for` (clamped by default,
191
- `clamp: false` to detect out-of-range), `end_date_for`, `before_start?`, `after_end?`, `to_date`.
192
- - Day pages show their calendar date with a **Today** badge; the overview gains a "Go to today" link
193
- and a pace indicator ("3 days behind", "right on pace", "begins in 12 days").
194
-
195
- ### Notes
196
- - Check-offs and comments are keyed to day numbers, never dates, so changing a start date only
197
- re-maps the calendar — no reading history moves or is lost.
198
- - A malformed `config.start_date` degrades to `nil` rather than raising at boot; the controller does
199
- reject bad input with a flash message.
200
146
 
201
- ## [0.3.1] 2026-07-24
147
+ * The project was renamed from `bible_reading_plan` to `bible270`, including the `Bible270` module, database tables, migrations, CSS and helper prefixes, install task, and engine name.
148
+ * The install generator defaults to `/daily-bread`, writes the mount path into the engine initializer, and emits configuration-driven `mount` and `path_prefix` lines.
149
+ * The README documents the mount point, initializer load-order requirements, OAuth callback URLs, and CMS links that may need updating when the mount path changes.
150
+ * The engine's sign-in paths follow the mount point at runtime through `request.script_name`.
151
+ * Author and copyright information now read “Andrew vonderLuft”.
152
+ * The display-name-from-email example uses a neutral address.
153
+ * `sign_out` is `DELETE` only.
154
+ * Guarded actions redirect to the sign-in page.
155
+ * URL escaping uses `URI.encode_www_form_component` rather than `CGI.escape`.
202
156
 
203
157
  ### Fixed
204
- - **Ruby 4.0 compatibility.** Dropped the `cgi` dependency: the CGI library was removed from Ruby's
205
- default gems in 4.0 (only `cgi/escape` remains), so `require "cgi"` emits a deprecation warning
206
- there. URL escaping now uses `URI.encode_www_form_component`, which produces byte-identical output
207
- to `CGI.escape` and relies only on `uri`, a stable default gem.
208
158
 
209
- ### Added
210
- - Regression test asserting the gem never loads the `cgi` library.
211
- - Compatibility notes in the README: audited against the Ruby 4.0 breaking changes (`Set`/`SortedSet`,
212
- `Ractor`, `Net::HTTP`, `Process::Status`, `ObjectSpace`, and the gems promoted from default to
213
- bundled). Every file carries a `frozen_string_literal` comment and the suite passes with
214
- `--enable-frozen-string-literal` forced.
215
-
216
- ## [0.3.0] 2026-07-24
217
-
218
- ### Changed — BREAKING
219
- - **Renamed from `bible_reading_plan` to `bible270`.** Module `Bible270`, tables `bible270_*`,
220
- migrations `CreateBible270*`, CSS and helper prefix `b270`, install task
221
- `bible270:install:migrations`, mount `Bible270::Engine`. Table names changed, so this is a fresh
222
- install rather than an upgrade.
223
- - **The New Testament is now read twice.** Each pass gets its own half of the plan (135 days), so
224
- Revelation lands on day 135 and again on day 270. Whole chapters are verse-balanced within each
225
- pass, tightening NT days from 11–140 verses to 20–104. The NT track now has content every day, so
226
- there are no rest days and all three tracks are present on all 270 days.
227
- - **Chapters are kept whole.** Only a chapter longer than `PP_LONG_CHAPTER` (100 verses) is divided,
228
- which in the whole Psalter and Proverbs is Psalm 119 alone — split into exactly two readings
229
- (1–88, 89–176). Psalms 78 and 89 are no longer split. Short chapters merge with a neighbour, so
230
- Psalm 117 reads as "Psalm 116–117" rather than occupying a two-verse day.
231
- - The Psalms/Proverbs companion resolves to exactly 135 portions, making two complete passes across
232
- 270 days and finishing on Proverbs 31 — so all three tracks finish together at the halfway mark
233
- and at the end.
234
-
235
- ### Added
236
- - `Plan.nt_days_per_pass`, `nt_second_pass_start_day`, `nt_verse_loads`, `pp_cycle_length`,
237
- `pp_base_portions`, and tuning constants documented in the README.
238
-
239
- ## [0.2.0] — 2026-07-24
159
+ * **`db:migrate` failed with `ActiveRecord::DuplicateMigrationNameError`.** The engine appended its own `db/migrate` to the host application's migration paths and also exposed `bible270:install:migrations`. Using the task meant every migration class was defined twice. The engine no longer touches the host's migration paths; copying via the task is the single supported path.
160
+ * Sign-in was broken under OmniAuth 2.0 because the request phase no longer permits GET requests. Sign-in controls now use POST forms with CSRF tokens.
161
+ * Open redirects through the `origin` parameter, including protocol-relative URLs, backslashes, and authentication routes.
162
+ * Session fixation by resetting the session on sign-in and sign-out.
163
+ * `Reader.from_omniauth` now tolerates plain hashes, missing `info`, and malformed payloads without raising.
164
+ * `display_name_from` no longer raises `ArgumentError` for addresses containing underscores.
165
+ * Ruby 4.0 compatibility issues caused by the removed `cgi` default gem.
166
+ * Progress bars that could not reach the correct totals because they compared checked days with chapter totals.
240
167
 
241
- ### Changed
242
- - **Daily portions are balanced by verse count, not chapter count**, so each day takes roughly the
243
- same time to read. Previously a day on Psalm 119 (176 verses) counted the same as a day on Psalm
244
- 117 (2 verses).
245
- - Old Testament days are grouped to be even in verses (avg ~73/day).
246
-
247
- ### Added
248
- - `Bible270::Versification` — per-chapter verse counts for all 66 books, generated from a
249
- public-domain KJV text and validated against canonical anchors (1,189 chapters; Psalms 2,461
250
- verses; Proverbs 915; Psalm 119 = 176; Psalm 117 = 2). Verse counts are facts about the text's
251
- structure, so nothing copyrighted is bundled.
168
+ ### Breaking Changes
252
169
 
253
- ### Fixed
254
- - Per-track progress bars compared days checked against *chapter* totals, so the Old Testament bar
255
- could never exceed ~36%. Renamed `chapters_read_in` to `days_read_in` and made the totals
256
- day-based.
170
+ * The project was renamed from `bible_reading_plan` to `bible270`; this is a fresh install rather than an in-place upgrade because database table names changed.
171
+ * The New Testament schedule changed from a single pass to two verse-balanced passes.
172
+ * The Psalms/Proverbs schedule changed to two complete 135-portion passes.
173
+ * Calendar and reading-plan behavior is based on day numbers rather than stored plan rows.
257
174
 
258
- ## [0.1.0] — 2026-07-24
175
+ ### Requirements
259
176
 
260
- ### Added
261
- - Initial release: a mountable Rails engine providing a 270-day Bible reading plan with three daily
262
- tracks (Old Testament, New Testament, Psalms/Proverbs).
263
- - Per-reader check-offs, public per-day reflections, a community leaderboard, and reader profiles.
264
- - Two identity paths: built-in session sign-in, or bridging the host application's users via
265
- `config.current_reader_resolver` and `Reader.for_owner`.
266
- - The schedule is pure, deterministic Ruby — no rows are stored for the plan itself; the database
267
- holds only readers, check-offs, and comments.
177
+ * Email sign-in requires working Action Mailer delivery in the host application. Set `config.mailer_from`; delivery is inline by default, or set `email_sign_in_deliver_later` when a queue backend is available.
268
178
 
179
+ [0.10.0]: https://github.com/avonderluft/bible270/releases/tag/v0.10.0
269
180
  [0.9.0]: https://github.com/avonderluft/bible270/releases/tag/v0.9.0
270
- [0.8.0]: https://github.com/avonderluft/bible270/releases/tag/v0.8.0
271
- [0.7.0]: https://github.com/avonderluft/bible270/releases/tag/v0.7.0
272
- [0.6.3]: https://github.com/avonderluft/bible270/releases/tag/v0.6.3
273
181
  [0.6.2]: https://github.com/avonderluft/bible270/releases/tag/v0.6.2
274
- [0.6.1]: https://github.com/avonderluft/bible270/releases/tag/v0.6.1
275
- [0.6.0]: https://github.com/avonderluft/bible270/releases/tag/v0.6.0
276
- [0.5.0]: https://github.com/avonderluft/bible270/releases/tag/v0.5.0
277
- [0.4.0]: https://github.com/avonderluft/bible270/releases/tag/v0.4.0
278
- [0.3.1]: https://github.com/avonderluft/bible270/releases/tag/v0.3.1
279
- [0.3.0]: https://github.com/avonderluft/bible270/releases/tag/v0.3.0
280
- [0.2.0]: https://github.com/avonderluft/bible270/releases/tag/v0.2.0
281
- [0.1.0]: https://github.com/avonderluft/bible270/releases/tag/v0.1.0