Skip to content

Commit 11cf172

Browse files
jacksonpiresclaude
andcommitted
[Bug Fix] Select only directories in ruby_ui:component:all
The batch generator filtered out only `.rb` files, so any other non-directory entry at the source root (e.g. a macOS `.DS_Store`) survived and was passed as a component name. Since the names are now generated in a single invocation, `validate_components!` would reject the whole batch and abort the entire all-components run. Components are always directories, so select directories only — this excludes `.rb` files, dotfiles, and any stray file at once. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a3c881d commit 11cf172

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

gem/lib/generators/ruby_ui/component/all_generator.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ class AllGenerator < Rails::Generators::Base
1010
def generate_components
1111
say "Generating all components..."
1212

13-
folder_names = Dir.children(self.class.source_root).reject { |folder_name| folder_name.ends_with?(".rb") }
13+
# Each component lives in its own directory; select directories only so stray
14+
# files (e.g. base.rb or a macOS .DS_Store) are never passed as component names.
15+
folder_names = Dir.children(self.class.source_root).select do |entry|
16+
File.directory?(File.join(self.class.source_root, entry))
17+
end
1418

1519
run "bin/rails generate ruby_ui:component #{folder_names.join(" ")} --force #{options["force"]}"
1620
end

0 commit comments

Comments
 (0)