Skip to content

Commit 0ea891b

Browse files
Use absolute paths for internal autoloads
So that we don't need to rely on the LOAD_PATH.
1 parent 69a70e1 commit 0ea891b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/thor/base.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
require_relative "util"
99

1010
class Thor
11-
autoload :Actions, "thor/actions"
12-
autoload :RakeCompat, "thor/rake_compat"
13-
autoload :Group, "thor/group"
11+
autoload :Actions, File.expand_path("actions", __dir__)
12+
autoload :RakeCompat, File.expand_path("rake_compat", __dir__)
13+
autoload :Group, File.expand_path("group", __dir__)
1414

1515
# Shortcuts for help.
1616
HELP_MAPPINGS = %w(-h -? --help -D)

lib/thor/shell.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ module Shell
2424
SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
2525
attr_writer :shell
2626

27-
autoload :Basic, "thor/shell/basic"
28-
autoload :Color, "thor/shell/color"
29-
autoload :HTML, "thor/shell/html"
27+
autoload :Basic, File.expand_path("shell/basic", __dir__)
28+
autoload :Color, File.expand_path("shell/color", __dir__)
29+
autoload :HTML, File.expand_path("shell/html", __dir__)
3030

3131
# Add shell to initialize config values.
3232
#

0 commit comments

Comments
 (0)