Skip to content

Commit

Permalink
Fixed ClassDir#list_files where the class_dir/ prefix was not bei…
Browse files Browse the repository at this point in the history
…ng removed.
  • Loading branch information
postmodern committed May 10, 2023
1 parent 628252e commit 5898772
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ronin/repos/class_dir.rb
Expand Up @@ -125,8 +125,11 @@ def list_files
modules = Set.new(super)
pattern = File.join(repo_class_dir,"{**/}*.rb")

# the String#slice range to remove the repo_class_dir/ and .rb ext
slice_range = (repo_class_dir.length + 1)...-3

Repos.list_files(pattern).each do |path|
modules << path.chomp('.rb')
modules << path.slice(slice_range)
end

return modules.to_a
Expand Down

0 comments on commit 5898772

Please sign in to comment.