Commit dfe3c9e
Fix edge case and timing issues in locale generation
1. Fixed critical edge case in files_are_outdated:
- Changed to return false when locale_files is empty
- Prevents generation of empty translation files when no source YAML exists
- Previously returned true (outdated), which would trigger empty generation
2. Improved user message clarity:
- Updated message to show exact rake task syntax
- Changed from "Use force=true" to "Use 'rake react_on_rails:locale force=true'"
- Helps users understand how to pass the parameter correctly
3. Fixed timing-dependent test flake:
- Added 10ms sleep in spec to ensure different timestamps on fast filesystems
- Prevents CI failures where file regeneration happens within same timestamp
- Test was failing in CI due to mtime equality instead of greater-than
All tests pass and RuboCop clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent f2813a9 commit dfe3c9e
File tree
2 files changed
+6
-2
lines changed- lib/react_on_rails/locales
- spec/react_on_rails
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
0 commit comments