summaryrefslogtreecommitdiff
path: root/lib/irb/ext
AgeCommit message (Collapse)Author
2025-01-24Migrate irb and reline to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12624
2024-04-10[ruby/irb] Command implementation not by methodtomoya ishida
(https://github.com/ruby/irb/pull/824) * Command is not a method * Fix command test * Implement non-method command name completion * Add test for ExtendCommandBundle.def_extend_command * Add helper method install test * Remove spaces in command input parse * Remove command arg unquote in help command * Simplify Statement and handle execution in IRB::Irb * Tweak require, const name * Always install CommandBundle module to main object * Remove considering local variable in command or expression check * Remove unused method, tweak * Remove outdated comment for help command arg Co-authored-by: Stan Lo <[email protected]> --------- https://github.com/ruby/irb/commit/8fb776e379 Co-authored-by: Stan Lo <[email protected]>
2024-03-16[ruby/irb] Use markdown format for docsStan Lo
(https://github.com/ruby/irb/pull/890) * Convert irb.rb's document into markdown format * Hide should-be-private top-level methods from docs * Skip xmp.rb's docs * Declare lib/irb.rb's markup do it works in ruby/ruby too * Ignore docs folder https://github.com/ruby/irb/commit/e9a175e06b
2024-03-01[ruby/irb] Restructure workspace managementStan Lo
(https://github.com/ruby/irb/pull/888) * Remove dead irb_level method * Restructure workspace management Currently, workspace is an attribute of IRB::Context in most use cases. But when some workspace commands are used, like `pushws` or `popws`, a workspace will be created and used along side with the original workspace attribute. This complexity is not necessary and will prevent us from expanding multi-workspace support in the future. So this commit introduces a @workspace_stack ivar to IRB::Context so IRB can have a more natural way to manage workspaces. * Fix pushws without args * Always display workspace stack after related commands are used https://github.com/ruby/irb/commit/61560b99b3
2024-02-23[ruby/irb] Remove useless loaded file checktomoya ishida
(https://github.com/ruby/irb/pull/885) https://github.com/ruby/irb/commit/f6d489658e
2024-02-23[ruby/irb] Turn on frozen literal in filesStan Lo
(https://github.com/ruby/irb/pull/881) https://github.com/ruby/irb/commit/83d90550c2
2024-02-23[ruby/irb] Unroll extension method generationStan Lo
(https://github.com/ruby/irb/pull/882) * Unroll extension method generation Given we only have 2 remaining extension setter methods, both of which only take 1 argument and don't have any alias, the current method generation logic is overly complicated. This commit simplifies the method generation logic by simply defining the methods directly in the `IRB::Context` class. * Fix use_loader extension https://github.com/ruby/irb/commit/67eba5401b
2024-02-16[ruby/irb] Standardize command related namesStan Lo
(https://github.com/ruby/irb/pull/873) * Replace ExtendCommand with Command and standardize command related names 1. Rename lib/irb/extend-command.rb to lib/irb/command.rb 2. Rename lib/irb/cmd/*.rb to lib/irb/command/*.rb 3. Rename test/irb/test_cmd.rb to test/irb/test_command.rb 4. Rename ExtendCommand to Command * Alias ExtendCommand to Command and deprecate it * Rename Command::Nop to Command::Base * Not deprecate old constants just yet * Add lib/irb/cmd/nop.rb back https://github.com/ruby/irb/commit/462c1284af
2024-02-13[ruby/irb] Refactor eval_path and `SourceFinder::Source`Stan Lo
(https://github.com/ruby/irb/pull/870) * Assign `@eval_path` through `irb_path=` method This simplifies the original caching logic for the `eval_path` method and makes it easier to understand. * Refactor SourceFinder::Source https://github.com/ruby/irb/commit/c63e4c4035
2024-02-07[ruby/irb] Polish tracer integration and testsStan Lo
(https://github.com/ruby/irb/pull/864) * Remove useless ivar * Simplify tracer test setup * Treat tracer like a normal development dependency * Only require ext/tracer when value is truthy * Make tracer integration skip IRB traces https://github.com/ruby/irb/commit/a97a4129a7
2024-02-06[ruby/irb] Fix usage of tracer gem and add testsNuno Silva
(https://github.com/ruby/irb/pull/857) The new tests are skipped when ruby below 3.1, as it was a default gem on it, and in a version we do not support. This also move definition of `use_tracer` to module Context instead of monkey patch. https://github.com/ruby/irb/commit/08834fbd5f
2023-07-04[ruby/irb] Refactor eval historyStan Lo
(https://github.com/ruby/irb/pull/623) * Rename `ext/history.rb` to `ext/eval_history.rb` To confusion with `lib/irb/history.rb` * Add eval_history tests * Rename eval_history's History to EvalHistory to avoid confusion
2023-07-03[ruby/irb] Stop treating history-saving logic as extensionStan Lo
(https://github.com/ruby/irb/pull/613) Since `IRB.conf[:SAVE_HISTORY]` is assigned with 1000 by default, history-saving is a feature enabled by default. So it should not be treated as an extension, which adds unnecessary complexity to the code.
2023-06-05[ruby/irb] Refactor ExtendCommand::NopStan Lo
(https://github.com/ruby/irb/pull/598) * Rename conf to irb_context * Drop Nop#irb method because it's only used by irb/ext/loader.rb We don't need to expose this method to all command classes, especially when it's just an alias of `irb_context.irb`.
2023-04-23[ruby/irb] fix typo in tracer (https://github.com/ruby/irb/pull/565)Yusuf Daniju
https://github.com/ruby/irb/commit/2f567f3d3e
2023-04-05[ruby/irb] Drop Ruby 2.6 supportStan Lo
(https://github.com/ruby/irb/pull/555) * Remove all Ruby 2.6 support * Drop Ruby 2.6 specific testing conditions * Only run Ruby 2.7+ on CI * Bump Ruby requirement to 2.7+ https://github.com/ruby/irb/commit/3f714b616c
2023-04-02[ruby/irb] Remove dead code (https://github.com/ruby/irb/pull/554)Stan Lo
* Remove unused ATTR_TTY and ATTR_PLAIN constants They were added in https://github.com/ruby/irb/commit/d7d26b51bf47a52e4e2339e2ad509ace74f0e4c7 But the references were removed in https://github.com/ruby/irb/commit/1c76845cca59635bb0cf386ced721e34b25d7410 Co-authored-by: Alexandre Terrasa <[email protected]> * Remove unused MethodExtender module It was added in https://github.com/ruby/irb/commit/6cc5d718d7045952ef61d504d624f7e70ce828be but it's not used anywhere. Co-authored-by: Alexandre Terrasa <[email protected]> * Remove unused IRB.irb_at_exit It's not used after https://github.com/ruby/irb/commit/aaf4eb4e9830ae71240ca5d2047c5e3ad20a4044 Co-authored-by: Alexandre Terrasa <[email protected]> * Remove unused InputCompletor.ignored_modules It was added in https://github.com/ruby/irb/commit/88311ce3c84251e6f420246cd14efc96e00888be but the reference was removed in https://github.com/ruby/irb/commit/78c74d24254145a39c4d30168dbcd87dbbbc66dc * Remove unused TracerLoadError constant This constant was added in https://github.com/ruby/irb/commit/cb50fa3738121e4d829cb05b4bcb0d5fb43760c5 but never referenced. --------- https://github.com/ruby/irb/commit/7de0234325 Co-authored-by: Alexandre Terrasa <[email protected]>
2023-02-18[ruby/irb] Remove unused context argument from Worksapce#evaluateStan Lo
(https://github.com/ruby/irb/pull/488) The context argument was introduced in this change: https://github.com/ruby/irb/commit/6806669d178f90f38b99c144bdfee06bdb93a229#diff-296327851fb7a2c307c2d0693b769f58c01aaf315972f290500d10081ee200a9 perhaps for potential usages. But after that it's never used.
2023-01-11[ruby/irb] Formatting to header stylesHiroshi SHIBATA
https://github.com/ruby/irb/commit/cef125850d
2023-01-11[ruby/irb] Removed Release Version and Revisions for old VCS softwareHiroshi SHIBATA
https://github.com/ruby/irb/commit/07fae94862
2022-11-30[ruby/irb] Use class methods of `File` over `Kernel.open`Nobuyoshi Nakada
https://github.com/ruby/irb/commit/e0ec5e1bd8
2022-11-15[ruby/irb] Rename leftover Reidline referencesst0012
https://github.com/ruby/irb/commit/0ed8b103ed
2022-10-03[ruby/irb] Remove unnecessary Thread presence checkst0012
They were introduced around 20 years ago, when Thread is not yet stabilized. So we don't need them anymore. https://github.com/ruby/irb/commit/4c75e03b2b
2022-09-14[ruby/irb] Fix the error when LC_MESSAGES config value is nilNobuyoshi Nakada
https://github.com/ruby/irb/commit/6bbde84369
2022-09-14[ruby/irb] Fix history file saving with concurrent irb sessions when history ↵Jeremy Evans
file doesn't exist If history file didn't exist when irb was started, @loaded_history_mtime would be nil. However, if the history file didn't exist before, but it exists when saving history, that means the history file was modified, and we should handle it the same way as we handle the other case where the history file was modified. Fixes #388 https://github.com/ruby/irb/commit/8d277aafcb
2021-03-06[ruby/irb] Make save-history extension safe for concurrent useJeremy Evans
This makes the save-history extension check for modifications to the history file before saving it. If the history file was modified after the history was loaded and before it was saved, append only the new history lines to the history file. This can result in more lines in the history file than SAVE_HISTORY allows. However, that will be fixed the next time irb is run and the history is saved. Fixes [Bug #13654] https://github.com/ruby/irb/commit/041ef53845
2021-02-12[ruby/irb] Fix inverse separator conditionNobuyoshi Nakada
https://github.com/ruby/irb/commit/33f933196f
2021-02-11[ruby/irb] Suppress error when File::ALT_SEPARATOR is nilaycabta
https://github.com/ruby/irb/commit/96accf3b95
2021-01-29Fix absolute path predicate on WindowsNobuyoshi Nakada
A path starts with '/' is not an absolute path on Windows, because of drive letter or UNC. Notes: Merged: https://github.com/ruby/ruby/pull/4127
2021-01-27[ruby/irb] add `IRB::FileInputMethod.open` to ensure closing associated FileNobuhiro IMAI
* tweak some methods not to raise exception after `#close` * use it in `IRB::IrbLoader#{source_file,load_file} https://github.com/ruby/irb/commit/ec2947acbd
2020-08-28[ruby/irb] Discard newlines at end of fileaycabta
https://github.com/ruby/irb/commit/0b2773d91d
2020-08-18[ruby/irb] Workaround a bug of ruby-mode.elNobuyoshi Nakada
https://github.com/ruby/irb/commit/6dfd59400d
2020-08-18[ruby/irb] Yet another unnecessary readlineNobuyoshi Nakada
https://github.com/ruby/irb/commit/933841af11
2020-08-18[ruby/irb] Make history infinite if set SAVE_HISTORY to negativeaycabta
https://github.com/ruby/irb/commit/824473e880
2020-08-18[ruby/irb] Suppress crash when bignum is set to SAVE_HISTORYaycabta
https://github.com/ruby/irb/commit/5044eb2730
2020-04-07[DOC] get rid of parsing as TIDYLINK unintentionallyNobuyoshi Nakada
2020-01-14Use Reline.encoding_system_needs if existsaycabta
2019-11-25Remove e2mmap dependencyaycabta
2019-11-24Remove debug code...aycabta
2019-11-24Disable tracer ext of IRB when tracer doesn't foundaycabta
2019-10-26IRB: Document command evaluation history.zverok
Notes: Merged: https://github.com/ruby/ruby/pull/2615
2019-08-22IRB's multiline history is enable only when Reidline modeaycabta
2019-07-27Ignore history file without saving if permissions cannot be changedJeremy Evans
Fixes [Ruby Bug 13907]
2019-07-15Simplify history saving codeaycabta
2019-07-15Use #to_a for Readline::HISTORY directlyaycabta
2019-07-15Remove debug printaycabta
2019-07-15Support multiline irb_historyaycabta
A history line ends with "\" to escape newline if it's a continuous line.
2019-07-15Suppress warningsMasataka Pocke Kuwabara
2019-05-27Add support for history with Reline backendSutou Kouhei
2018-11-02lib/*: Prefer require_relative over require.marcandre
[#15206] [Fix GH-1976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e