Commit 7b1a6c3
committed
Use Dir.glob in find_root_with_flag to return correct case
As of Ruby 2.2, Dir.glob returns matches with the correct case as opposed
to in previous versions where the matches were returned with the case of
the pattern. In certain scenarios on Mac OS X the app can be booted with
the incorrect case, e.g. incorrect case on Pow symlink). This is because
the app is built by Rack::Builder evaluating a string from the config.ru
file and passing the incorrectly cased path to the eval method.
As Dir.glob is the only method in Ruby 2.2 that appears to do this case
correction currently we need to rewrite the find_root_with_flag method
to use it so that it corrects the case for when the applications paths
instance is created.
Fixes rails#18660.1 parent c99bea1 commit 7b1a6c3
File tree
4 files changed
+51
-6
lines changed- actionpack/lib/action_controller/metal
- railties
- lib/rails
- test/application
4 files changed
+51
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| 666 | + | |
666 | 667 | | |
667 | | - | |
668 | | - | |
669 | | - | |
| 668 | + | |
| 669 | + | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
673 | 677 | | |
674 | 678 | | |
675 | | - | |
| 679 | + | |
676 | 680 | | |
677 | 681 | | |
678 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
43 | 77 | | |
0 commit comments