1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib
Stan Lo ca0b592673 [ruby/irb] Don't lazily retrieve gem specs for completion
There are a few downsides of the current approach:

1. Because gem specs are lazily retrieved, this computation happens in
   every irb completion test case, which is not necessary. (In tests we
   don't cache the result of `retrieve_files_to_require_from_load_path`)
2. Gem::Specification.latest_specs is sensible to the content of
   LOAD_PATH. And when combined with 1, tests fail "randomly" if they
   try to mutate LOAD_PATH, even though the test subject it's something
   else.

So by pre-computing and storing the gem paths in a constant, it guarantees
that the computation only happens once and it doesn't get affected by test
cases.

One argument could be made against the change is that, it'll store
unnecessary data for users that disable autocompletion. But the
counter-arguments are:

1. Since autocompletion is enabled by default, this should not be the
   case for most users.
2. For users with autocompletion enabled, IRB already caches the
   result of `retrieve_files_to_require_from_load_path` in memory, which
   should have a similar size of GEM_SPECS. And we currently haven't
   received any report about problems caused by such memory consumption.

https://github.com/ruby/irb/commit/c671d39020
2022-11-07 14:44:25 +00:00
..
benchmark [ruby/benchmark] Freeze VERSION 2021-12-18 08:38:58 +09:00
bundler [rubygems/rubygems] Drop support for IRIX 2022-11-07 10:52:14 +00:00
cgi [ruby/cgi] Implement CGI.url_encode and CGI.url_decode 2022-08-16 19:12:03 +09:00
csv [DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 13:30:25 +09:00
delegate
did_you_mean [ruby/did_you_mean] Fixed correction duplicates in VariableNameChecker 2022-09-01 19:47:39 +09:00
drb lib/drb/drb.rb: Prevent a "warning: assigned but unused variable" 2022-01-17 14:56:11 +09:00
erb [ruby/erb] Version 3.0.0 2022-10-25 23:14:09 +00:00
error_highlight [ruby/error_highlight] Support nodes in spot 2022-10-31 04:58:38 +00:00
forwardable [ruby/forwardable] Move :stopdoc: directive 2022-03-14 14:44:46 +09:00
getoptlong
irb [ruby/irb] Don't lazily retrieve gem specs for completion 2022-11-07 14:44:25 +00:00
logger [ruby/logger] Enhanced RDoc for Logger 2022-05-13 22:52:53 +09:00
mjit Only expose Ruby Shape API if VM_CHECK_MODE is enabled 2022-10-13 13:11:01 -07:00
net [ruby/net-http] Bump version to 0.3.0 2022-10-24 05:45:44 +00:00
observer
open3 Fixed filename for Open3::VERSION 2021-12-09 19:48:22 +09:00
optparse [ruby/optparse] Add rdoc options 2022-01-12 21:16:01 +09:00
ostruct [ruby/ostruct] Drop unused directives from gemspec (https://github.com/ruby/ostruct/pull/39) 2022-03-07 20:08:29 +09:00
pstore
racc Update parser-text.rb with 4ecc13c9cb 2022-07-29 19:10:10 +09:00
random [ruby/securerandom] Use String#unpack1 2021-12-14 11:59:22 +09:00
rdoc [ruby/rdoc] Delay require "readline" in case the terminal is in raw mode 2022-10-27 08:16:06 +00:00
reline [ruby/reline] PR changes 2022-09-22 22:28:38 +09:00
rinda
rubygems [rubygems/rubygems] Drop support for bitrig 2022-11-07 10:52:14 +00:00
set [ruby/set] Bump version to 1.0.3 2022-09-06 10:41:20 +09:00
singleton
syntax_suggest syntax_suggest moved under the ruby organization from zombocom 2022-09-27 12:44:30 +09:00
timeout [ruby/timeout] gemspec: Drop unused directives "executables" 2022-07-14 16:21:25 +09:00
unicode_normalize [DOC] hide UnicodeNormalize in module index 2022-03-14 15:01:20 +09:00
uri [ruby/uri] Fix splitting relative URI 2022-10-13 16:24:53 +09:00
weakref
yaml
abbrev.gemspec
abbrev.rb
base64.gemspec
base64.rb
benchmark.rb
bundler.rb Merge RubyGems/Bundler master 2022-10-18 16:33:15 +09:00
cgi.rb [ruby/cgi] Bump up 0.3.3 2022-09-22 17:29:55 +09:00
csv.rb [ruby/csv] Add handling for ambiguous parsing options (https://github.com/ruby/csv/pull/226) 2021-12-24 14:35:33 +09:00
delegate.rb [ruby/delegate] Fix DelegateClass block "method redefined" warning 2022-10-15 00:08:44 +09:00
did_you_mean.rb Sync did_you_mean 2021-12-24 23:20:30 +09:00
drb.rb
English.gemspec [ruby/English] gemspec: Remove unused "executables" configuration 2021-12-09 19:28:53 +09:00
English.rb
erb.gemspec [ruby/erb] Copy CGI.escapeHTML to ERB::Util.html_escape 2022-11-04 07:07:23 +00:00
erb.rb [ruby/erb] Avoid using prepend + super for fallback 2022-11-04 16:46:29 +00:00
error_highlight.rb
fileutils.gemspec
fileutils.rb [ruby/fileutils] Revert "FileUtils.rm* methods swallows only Errno::ENOENT when force is true" 2022-11-07 11:25:25 +00:00
find.gemspec
find.rb
forwardable.rb [ruby/forwardable] Freeze VERSION and FORWARDABLE_VERSION to improve Ractor-compliance 2022-09-08 14:31:42 +09:00
getoptlong.rb [ruby/getoptlong] Fixup https://github.com/ruby/getoptlong/commit/39faa7b390f0 2022-05-09 07:26:29 +09:00
ipaddr.gemspec Support directory layout of ruby/ruby repository 2022-02-10 17:18:05 +09:00
ipaddr.rb [ruby/ipaddr] Improve Ractor-compliance 2022-09-08 14:09:06 +09:00
irb.rb [ruby/irb] Allow non-identifier aliases like Pry's @ and $ 2022-11-03 22:09:55 +00:00
logger.rb [DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00
mkmf.rb Set timestamp path for the target path to TARGET_SO_DIR_TIMESTAMP 2022-10-24 17:48:00 +09:00
mutex_m.gemspec
mutex_m.rb [ruby/mutex_m] Make VERSION shareable 2021-10-22 19:49:34 +09:00
observer.rb
open-uri.gemspec [ruby/open-uri] Remove unused files from the packages 2022-10-11 10:44:42 +09:00
open-uri.rb Add :ssl_min_version and :ssl_max_version options 2022-10-12 10:36:51 +09:00
open3.rb [ruby/open3] Update to match JRuby 9.4 2021-12-09 19:28:54 +09:00
optionparser.rb
optparse.rb [ruby/optparse] #load() into hash 2022-10-29 13:46:27 +00:00
ostruct.rb [ruby/ostruct] v0.5.5 2022-04-01 00:18:36 +09:00
pp.gemspec [ruby/pp] Bump version to 0.3.0 2021-12-20 12:44:31 +09:00
pp.rb [ruby/pp] [Feature #19045] Add support Data#pretty_print 2022-10-14 21:31:24 +09:00
prettyprint.gemspec
prettyprint.rb
pstore.rb [DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00
racc.rb
rdoc.rb [ruby/rdoc] Relative loading for easier development (https://github.com/ruby/rdoc/pull/821) 2022-02-12 15:06:06 +09:00
readline.gemspec [ruby/readline] Bump version to 0.0.3 2021-12-24 17:54:09 +09:00
readline.rb [ruby/readline] Suppress constant redefinition warning 2021-11-29 18:50:27 +09:00
reline.rb [ruby/reline] Support dumb terminal 2022-09-01 16:36:16 +09:00
resolv-replace.gemspec
resolv-replace.rb
resolv.gemspec
resolv.rb [ruby/resolv] Support more characters in link local addresses 2022-01-12 10:49:57 +09:00
ruby2_keywords.gemspec
rubygems.rb Merge rubygems/bundler HEAD. 2022-08-09 12:05:19 +09:00
securerandom.gemspec [ruby/securerandom] Bump up v0.2.0 2022-02-28 20:08:58 +09:00
securerandom.rb lib/securerandom.rb: Fix the check of availability of Random.urandom 2022-02-16 16:32:28 +09:00
set.rb [DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00
shellwords.gemspec
shellwords.rb
singleton.rb
syntax_suggest.rb Sync SyntaxSuggest 2022-08-19 10:02:24 +09:00
tempfile.gemspec [ruby/tempfile] Drop unused gemspec directives 2022-05-20 17:49:14 +09:00
tempfile.rb [DOC] Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00
time.gemspec
time.rb fix typo in Time#xmlschema documentation 2022-07-29 19:10:10 +09:00
timeout.rb [ruby/timeout] Explicit add the timeout thread to default ThreadGroup 2022-09-28 01:59:35 +09:00
tmpdir.gemspec [ruby/tmpdir] Update supported and testing ruby versions 2022-10-25 06:59:30 +00:00
tmpdir.rb [ruby/tmpdir] Ignore empty environment variables 2022-10-25 07:54:40 +00:00
tsort.gemspec
tsort.rb [ruby/tsort] Small tweaks for easier vendoring 2022-04-18 09:40:07 +09:00
un.gemspec
un.rb [ruby/un] Support FileUtils.cp_lr 2022-07-14 16:26:47 +09:00
uri.rb [ruby/uri] Feat: Support WSS 2022-04-22 11:59:54 +09:00
weakref.rb [DOC] Remove outdated note from WeakRef#initialize 2022-03-14 10:50:52 +01:00
yaml.rb [ruby/yaml] Add JRuby-specific warning when psych fails 2022-01-27 17:16:05 +09:00