Module: Hibiki::Rails::Generators::NestedInjections
- Included in:
- NestedGenerator
- Defined in:
- lib/generators/hibiki/rails/nested_injections.rb
Overview
What hibiki:rails:nested writes into files the app already owns. Every injection is guarded by a wired? probe, so a re-run is a no-op, and every missing anchor downgrades to a manual_wiring notice rather than a half-edit. Anchors that could collide are line-anchored regexes matching exactly once (Thor's insert_into_file replaces EVERY match, and a bare-string anchor also matches as a substring — the 0.7.0 trap).
Constant Summary collapse
- CHANNEL_ANCHOR =
" include Hibiki::Rails::Channel\n"- FORM_ANCHOR =
The whole reactive_attributes statement, continuation lines included: minimal lines up to the first blank one.
/^[ \t]*reactive_attributes\b(?:.*\n)+?\n/- FILE_END =
The class's own closing end — the only
endat column zero. /^end\n\z/- REMAINING_ANCHOR =
/^ @remaining = Hibiki::Derived\.new [^\n]*\n/- URL_PARAMS_ANCHOR =
/^ url_params: query_url_params/- ERB_FIELDSET_CLOSE =
" a blank line follows.
The fieldset's close in the ERB row form: the one "