summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2022-11-07[ruby/irb] Don't lazily retrieve gem specs for completionStan Lo
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[ruby/fileutils] Revert "FileUtils.rm* methods swallows only Errno::ENOENT ↵Yusuke Endoh
when force is true" This reverts commit https://github.com/ruby/fileutils/commit/fa65d676ece9. This caused some incompatibility problems in real-world cases. https://bugs.ruby-lang.org/issues/18784#change-98927 https://bugs.ruby-lang.org/issues/18784#change-98967 https://github.com/ruby/fileutils/commit/42983c2553
2022-11-07[rubygems/rubygems] Drop support for IRIXPeter Zhu
The IRIX OS is no longer maintained with the last release being 16 years ago. https://github.com/rubygems/rubygems/commit/5381c6a871
2022-11-07[rubygems/rubygems] Drop support for bitrigPeter Zhu
The bitrig OS is no longer maintained with the last release being 7 years ago. https://github.com/rubygems/rubygems/commit/85ed90ddd0
2022-11-07[rubygems/rubygems] Drop support for HP-UXPeter Zhu
Support for HP-UX was dropped in Ruby in ruby/ruby#5457. https://github.com/rubygems/rubygems/commit/a3a8df3582
2022-11-04[ruby/erb] Avoid using prepend + super for fallbackTakashi Kokubun
(https://github.com/ruby/erb/pull/28) `prepend` is prioritized more than ActiveSupport's monkey-patch, but the monkey-patch needs to work. https://github.com/ruby/erb/commit/611de5a865
2022-11-04[ruby/erb] Copy CGI.escapeHTML to ERB::Util.html_escapeTakashi Kokubun
https://github.com/ruby/erb/commit/ac9b219fa9
2022-11-03[ruby/irb] Allow non-identifier aliases like Pry's @ and $Takashi Kokubun
(https://github.com/ruby/irb/pull/426) * Allow non-identifier aliases * Move the configuration to IRB.conf * Avoid abusing method lookup for symbol aliases * Add more alias tests * A small optimization * Assume non-nil Context * Load IRB.conf earlier https://github.com/ruby/irb/commit/e23db5132e
2022-11-03[ruby/irb] Refactor RubyLex and its testsStan Lo
(https://github.com/ruby/irb/pull/427) * Make sure `RubyLex#set_input`'s context is always present in tests In real-world scenarios, the context should always be non-nil: https://github.com/ruby/irb/blob/master/lib/irb.rb#L489 So we should make sure our test setup reflects that. * Make context a required keyword Since in practice, `set_input`'s context should always be non-nil, its parameters should reflect that. And since `RubyLex#check_state` is only called by `#lex` and `#set_input`, both of which now always require context, we can assume its context should be non-nil too. https://github.com/ruby/irb/commit/1aeeb86203
2022-11-03[ruby/erb] Fix CI for JRubyTakashi Kokubun
https://github.com/ruby/erb/commit/df642335b7
2022-10-31[ruby/error_highlight] Support nodes in `spot`eileencodes
Fixes a bug where `spot` was using the wrong local variable. We want to use error highlight with code that has been eval'd, specifically ERB templates. We can recover the compiled source code of the ERB template but we need an API to pass the node into error highlight's `spot`. Required Ruby PR: https://github.com/ruby/ruby/pull/6593 https://github.com/ruby/error_highlight/commit/0b1b650a59 Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2022-10-29[ruby/optparse] #load() into hashWhyme Lyu
(https://github.com/ruby/optparse/pull/42) OptionParser#load learns .load(into: Hash) https://github.com/ruby/optparse/commit/2ea626fcff Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-10-28[ruby/irb] Do not make non-existent XDG directory on startNobuyoshi Nakada
(https://github.com/ruby/irb/pull/357) https://github.com/ruby/irb/commit/298b134792
2022-10-28[ruby/irb] Update regarding NO_COLOR valueNobuyoshi Nakada
https://no-color.org has been updated (jcs/no_color#83): > Command-line software which adds ANSI color to its output by default should check for a `NO_COLOR` environment variable that, when present and **not an empty string** (regardless of its value), prevents the addition of ANSI color. https://github.com/ruby/irb/commit/46e0f7e370 Co-authored-by: Stan Lo <stan001212@gmail.com>
2022-10-27[ruby/rdoc] Delay `require "readline"` in case the terminal is in raw mode Shugo Maeda
2022-10-25[ruby/erb] Version 3.0.0 Takashi Kokubun
2022-10-25Bundler: update docs for gemfile(5) manpageTakuya Noguchi
- Add mswin/mswin64 to platforms - Use TruffleRuby as example instead of Rubinius Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com> Co-authored-by: André Arko <andre@arko.net>
2022-10-25[ruby/erb] url_encode: use CGI.escapeURIComponentJean Boussier
(https://github.com/ruby/erb/pull/23) Ref: https://github.com/ruby/cgi/pull/26 This native implementation is much faster and available in `cgi 0.3.3`. https://github.com/ruby/erb/commit/2d90e9b010
2022-10-25[ruby/tmpdir] Ignore empty environment variablesNobuyoshi Nakada
Fixes https://github.com/ruby/tmpdir/pull/17 https://github.com/ruby/tmpdir/commit/a79c727a5d
2022-10-25[ruby/tmpdir] Found or raise Nobuyoshi Nakada
2022-10-25[ruby/tmpdir] Update supported and testing ruby versions Nobuyoshi Nakada
2022-10-25[ruby/tmpdir] Make `Dir.tmpdir` more idiomatic and functionalPeter Vandenberk
Use `Enumerable#find` to iterate over the candidates, not `Enumerable.each`. (this makes the code more functional, and - IMO - slightly more idiomatic, as it avoids setting the "global" (by which I mean: non-local) `tmp` variable from inside the block) https://github.com/ruby/tmpdir/commit/d1f20ad694
2022-10-25[ruby/tmpdir] Fix typo Nobuyoshi Nakada
2022-10-25[ruby/tmpdir] [DOC] Improve documentationNobuyoshi Nakada
https://github.com/ruby/tmpdir/commit/b9c880f2b6
2022-10-24[ruby/irb] Move require out of repeated execution pathst0012
SHOW_DOC_DIALOG will be called repeatedly whenever the corresponding key is pressed, but we only need to require rdoc once. So ideally the require can be put outside of the proc. And because when rdoc is not available the entire proc will be nonfunctional, we can stop registering the SHOW_DOC_DIALOG if we failed to require rdoc. https://github.com/ruby/irb/commit/b1278b7320
2022-10-24Set timestamp path for the target path to TARGET_SO_DIR_TIMESTAMPNobuyoshi Nakada
2022-10-24[ruby/net-http] Bump version to 0.3.0 Hiroshi SHIBATA
2022-10-22[rubygems/rubygems] Allow upcoming JRuby to pass keywords for Kernel#warnThomas E. Enebo
jruby-head (which will be JRuby 9.4.0.0) can now properly process the keywords to Kernel#warn. I cannot think of any capability based test for this so I constrained it using a version guard. Only JRuby will ever hit the version guard. https://github.com/rubygems/rubygems/commit/cd468c7e0f
2022-10-21[ruby/net-http] Revert "Replace Timeout.timeout in Net:HTTP#connect"Hiroshi SHIBATA
This reverts commit https://github.com/ruby/net-http/commit/753cae3bbccc. https://github.com/ruby/net-http/commit/98caa38204
2022-10-18[rubygems/rubygems] Bundler: github DSL has used https protocol over gitTakuya Noguchi
This behavior change was done in Bundler 2.2.0. https://github.com/rubygems/bundler/pull/7142 Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com> https://github.com/rubygems/rubygems/commit/9510190be1
2022-10-18Merge RubyGems/Bundler masterHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/6214d00b2315ed37c76b1fbc1c72f61f92ba5a65 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Materialize platforms strictly on Windows tooDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ab11545f80 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove unnecessary receiverDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ba9d9b1890 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove unnecessary genericDavid Rodríguez
I didn't realize how the `Bundler::GemHelpers.generic` method works when I added this. It already matches this and other java platforms properly. https://github.com/rubygems/rubygems/commit/5f0f0c678c Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Simplify fetching spec group dependenciesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/62c2edd255 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Simplify SpecGroup creationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/788e46e152 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Inline helper methodDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e60459d6b6 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Use `flat_map`David Rodríguez
https://github.com/rubygems/rubygems/commit/b31308fb4c Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove one more `expand_dependencies` callDavid Rodríguez
https://github.com/rubygems/rubygems/commit/996fd81871 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove now unnecessary parameter to `expand_dependencies`David Rodríguez
We just call it once for resolution, so we can simplify things. https://github.com/rubygems/rubygems/commit/99c144fbe3 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove another `expand_dependencies` instanceDavid Rodríguez
https://github.com/rubygems/rubygems/commit/33769ddb07 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove another unnecessary dependency expansionDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b4a0fcd2d2 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Avoid unnecessary dependency expansionDavid Rodríguez
https://github.com/rubygems/rubygems/commit/426748ed06 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove unused parameter to `SharedHelpers.pretty_dependency`David Rodríguez
https://github.com/rubygems/rubygems/commit/665051d085 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[rubygems/rubygems] Remove dead codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/999b644708 Notes: Merged: https://github.com/ruby/ruby/pull/6578
2022-10-18[ruby/irb] Assert lvars_code doesn't include \nTakashi Kokubun
Removing /\A.+\n/ could have an unexpected impact, depending on how RubyLex.generate_local_variables_assign_code is implemented. It feels like a too much assumption and the intention isn't immediately clear, so I added these changes. https://github.com/ruby/irb/commit/ccc07a35ce
2022-10-18[ruby/irb] Always use local variables in current context to parse code ↵tomoya ishida
(https://github.com/ruby/irb/pull/397) * Use local_variables for colorize, code_block_open check, nesting_level and assignment_expression check * Check if expression is an assignment BEFORE evaluating it. evaluate might define new localvars and change result of assignment_expression? * Add local_variables dependent code test * pend local variable dependent test on truffleruby code_block_open is not working on truffleruby * Always pass context to RubyLex#lex * Rename local_variable_assign_code generator method name * Add assignment expression truncate test * Add Context#local_variables and make generate_local_variables_assign_code more simple * Update lib/irb/input-method.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Add a comment why assignment expression check should be done before evaluate https://github.com/ruby/irb/commit/c8b3877281 Co-authored-by: Stan Lo <stan001212@gmail.com> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2022-10-18[ruby/irb] Fix code terminated check with heredoc and backtick ↵tomoya ishida
(https://github.com/ruby/irb/pull/390) * Fix backtick method def method call handled as backtick open * Fix handling heredoc in check_string_literal * Sort result of lexer.parse by pos in ruby<2.7. It's not sorted when the given code includes heredoc. * Update lib/irb/ruby-lex.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Update lib/irb/ruby-lex.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Add check_string_literal test for heredoc code that does not end with newline https://github.com/ruby/irb/commit/44bc712460 Co-authored-by: Stan Lo <stan001212@gmail.com>
2022-10-15[ruby/delegate] Fix DelegateClass block "method redefined" warningJonathan Hefner
This commit prevents "method redefined" warnings when overriding methods within a `DelegateClass` block, such as in the following example: ```ruby Base = Class.new do def foo "foo" end end Overridden = DelegateClass(Base) do def foo super + "!" end end ``` Fixes https://bugs.ruby-lang.org/issues/19047. https://github.com/ruby/delegate/commit/214fae86de
2022-10-14[ruby/pp] [Feature #19045] Add support Data#pretty_printmanga_osyo
https://github.com/ruby/pp/commit/343a20d721