diff options
Diffstat (limited to 'lib/irb')
| -rw-r--r-- | lib/irb/completion.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 385957c3f1..9a5d8580ac 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -38,8 +38,21 @@ module IRB BASIC_WORD_BREAK_CHARACTERS = " \t\n`><=;|&{(" + def self.retrieve_gem_and_system_load_path + gem_paths = Gem::Specification.latest_specs(true).map { |s| + s.require_paths.map { |p| + if File.absolute_path?(p) + p + else + File.join(s.full_gem_path, p) + end + } + }.flatten + (gem_paths + $LOAD_PATH).uniq.sort + end + def self.retrieve_files_to_require_from_load_path - @@files_from_load_path ||= $LOAD_PATH.flat_map { |path| + @@files_from_load_path ||= retrieve_gem_and_system_load_path.flat_map { |path| begin Dir.glob("**/*.{rb,#{RbConfig::CONFIG['DLEXT']}}", base: path) rescue Errno::ENOENT |
