Skip to content

Commit

Permalink
Pass parent to relative_cpath in set_autoloads_in_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Jan 28, 2023
1 parent 5b7095e commit 485dcc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 0.2.2 (2023-1-28
* Pass `parent` to `relative_cpath` in `set_autoloads_in_dir`.

## 0.2.1 (2023-1-28
* Fix absolute cpath reference in `autoload_subdir`.

Expand Down
4 changes: 2 additions & 2 deletions lib/im/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def all_dirs

private # -------------------------------------------------------------------------------------

# @sig (String, Module) -> void
# @sig (String, Module?) -> void
def set_autoloads_in_dir(dir, parent = self)
ls(dir) do |basename, abspath|
begin
Expand Down Expand Up @@ -390,7 +390,7 @@ def set_autoloads_in_dir(dir, parent = self)
def autoload_subdir(parent, cname, subdir)
if autoload_path = autoload_path_set_by_me_for?(parent, cname)
absolute_cpath = cpath(parent, cname)
relative_cpath = relative_cpath(absolute_cpath, cname)
relative_cpath = relative_cpath(parent, cname)
register_explicit_namespace(cpath, relative_cpath) if ruby?(autoload_path)

# We do not need to issue another autoload, the existing one is enough
Expand Down

0 comments on commit 485dcc3

Please sign in to comment.