Skip to content

Commit de4d874

Browse files
committed
Add a comment for dirname vs __dir__ usage
1 parent 5f5aee9 commit de4d874

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

actioncable/lib/action_cable.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
require "active_support/rails"
2828
require "zeitwerk"
2929

30+
# We compute lib this way instead of using __dir__ because __dir__ gives a real
31+
# path, while __FILE__ honors symlinks. If the gem is stored under a symlinked
32+
# directory, this matters.
3033
lib = File.dirname(__FILE__)
34+
3135
Zeitwerk::Loader.for_gem.tap do |loader|
3236
loader.ignore(
3337
"#{lib}/rails", # Contains generators, templates, docs, etc.

0 commit comments

Comments
 (0)