Skip to content

Package missing template for Rails generator - #215

Open
David Elner (delner) wants to merge 1 commit into
mainfrom
fix/package-rails-generator-template
Open

David Elner (delner) wants to merge 1 commit into
mainfrom
fix/package-rails-generator-template

Conversation

@delner

Copy link
Copy Markdown
Collaborator

Problem

spec.files globbed lib/**/*.rb, so the one non-Ruby file under lib/ never shipped: lib/braintrust/contrib/rails/server/templates/initializer.rb.tt.

rails g braintrust:server fails with Could not find "initializer.rb.tt" in any of your source paths, so config/initializers/braintrust_server.rb is never written, the engine is never configured, and eval runs break. Only reproduces from the installed gem, never from a repo checkout, which is why tests missed it.

Fix

Glob lib/**/* instead of lib/**/*.rb, filtered to files. Chose the broad glob over adding *.tt so the next runtime asset does not reintroduce the bug; Dir.glob skips dotfiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants