Skip to content

fix(generator): Exclude *_docs.rb from eject by default (but keep --with-docs)#349

Open
djalmaaraujo wants to merge 1 commit intomainfrom
djalma/rui-3
Open

fix(generator): Exclude *_docs.rb from eject by default (but keep --with-docs)#349
djalmaaraujo wants to merge 1 commit intomainfrom
djalma/rui-3

Conversation

@djalmaaraujo
Copy link
Contributor

Summary

Closes RUI-3

Documentation files (*_docs.rb) are only useful for the RubyUI website and should not be ejected into consumer codebases by default.

  • Adds --with-docs boolean flag to the component generator (default: false)
  • By default, *_docs.rb files are excluded from eject
  • Pass --with-docs to include them (useful for the web repo)

Behavior

  • rails g ruby_ui:component Link → ejects only view + stimulus (no docs)
  • rails g ruby_ui:component Link --with-docs → ejects everything including link_docs.rb

Changes

  • lib/generators/ruby_ui/component_generator.rb: added class_option :with_docs and updated components_file_paths method
  • test/generators/component_generator_test.rb: added test suite covering both default (no docs) and --with-docs behaviors

…ocs flag

Closes RUI-3

Documentation files (*_docs.rb) are only useful for the RubyUI website and
should not be ejected into consumer codebases by default. This adds a
--with-docs boolean flag (default: false) to the component generator so that
docs files are excluded unless explicitly requested.

- `rails g ruby_ui:component Link` → ejects only view + stimulus (no docs)
- `rails g ruby_ui:component Link --with-docs` → ejects everything including link_docs.rb
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner February 26, 2026 18:16
@djalmaaraujo djalmaaraujo changed the title fix(generator): exclude *_docs.rb from eject by default fix(generator): Exclude *_docs.rb from eject by default (but keep --with-docs) Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant