aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/workspace.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/irb] Support seamless integration with ruby/debugStan Lo2023-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | (https://github.com/ruby/irb/pull/575) * Support native integration with ruby/debug * Prevent using multi-irb and activating debugger at the same time Multi-irb makes a few assumptions: - IRB will manage all threads that host sub-irb sessions - All IRB sessions will be run on the threads created by IRB itself However, when using the debugger these assumptions are broken: - `debug` will freeze ALL threads when it suspends the session (e.g. when hitting a breakpoint, or performing step-debugging). - Since the irb-debug integration runs IRB as the debugger's interface, it will be run on the debugger's thread, which is not managed by IRB. So we should prevent the 2 features from being used at the same time. To do that, we check if the other feature is already activated when executing the commands that would activate the other feature. https://github.com/ruby/irb/commit/d8fb3246be
* [ruby/irb] Add a comment about Rails' patch onStan Lo2023-02-271-0/+2
| | | | | | | | | | | | | | | | | Workspace#filter_backtrace (https://github.com/ruby/irb/pull/526) * Add a comment about Rails' patch on Workspace#filter_backtrace * Update lib/irb/workspace.rb Co-authored-by: Sorah Fukumori <sora134@gmail.com> --------- https://github.com/ruby/irb/commit/9443d911fc Co-authored-by: Sorah Fukumori <sora134@gmail.com>
* [ruby/irb] Remove unused context argument from Worksapce#evaluateStan Lo2023-02-181-1/+1
| | | | | | | | | | (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.
* [ruby/irb] Formatting to header stylesHiroshi SHIBATA2023-01-111-4/+0
| | | | https://github.com/ruby/irb/commit/cef125850d
* [ruby/irb] Removed Release Version and Revisions for old VCS softwareHiroshi SHIBATA2023-01-111-2/+0
| | | | https://github.com/ruby/irb/commit/07fae94862
* [ruby/irb] workspace.rb cleanupStan Lo2023-01-041-8/+1
| | | | | | | | | | | | | | | | | | | | (https://github.com/ruby/irb/pull/489) * Remove unnecessary Binding#source_location check `Binding#source_location` was added in 2.6, which is the minimum supported version now. So this check is no longer necessary. * Remove unused IRB.delete_caller This method was added in the earliest version of IRB: https://github.com/ruby/irb/commit/f47808999d24865fba1929dea1a7011ff5a517d6 But it's not currently referenced by anything. We can verify this with a org-wide search result: https://github.com/search?q=org%3Aruby+delete_caller&type=code
* [ruby/irb] Centralize coloring control (https://github.com/ruby/irb/pull/374)Stan Lo2022-06-281-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use colorable: argument as the only coloring control * Centalize color controling logic at Color.colorable? There are 2 requirements for coloring output: 1. It's supported on the platform 2. The user wants it: `IRB.conf[:USE_COLORIZE] == true` Right now we check 1 and 2 separately whenever we colorize things. But it's error-prone because while 1 is the default of `colorable` parameter, 2 always need to manually checked. When 2 is overlooked, it causes issues like https://github.com/ruby/irb/pull/362 And there's 0 case where we may want to colorize even when the user disables it. So I think we should merge 2 into `Color.colorable?` so it can be automatically picked up. * Add tests for all inspect modes * Simplify inspectors' coloring logic * Replace use_colorize? with Color.colorable? * Remove Context#use_colorize cause it's redundant https://github.com/ruby/irb/commit/1c53023ac4
* [ruby/irb] Move IRB::TOPLEVEL_BINDING from exe/irb to lib/irb/workspace.rbaycabta2021-09-101-1/+2
| | | | https://github.com/ruby/irb/commit/e736a77076
* [ruby/irb] Avoid loading files' local variables [Bug #17623]Marc-Andre Lafortune2021-09-101-0/+2
| | | | https://github.com/ruby/irb/commit/b12f0cb8e2
* [ruby/irb] Suppress colorize on Windows testsaycabta2021-02-111-1/+1
| | | | https://github.com/ruby/irb/commit/5be9354cf9
* irb: Drop lines from backtrace for tests in Ruby repositoryaycabta2021-01-081-0/+1
|
* [ruby/irb] Change context-mode's default to new mode 4.Marc-Andre Lafortune2020-12-171-1/+3
| | | | | | This new mode uses a copy of the TOPLEVEL_BINDING. This is compatible with refinements (contrary to mode 3), while keeping nested IRB sessions separate https://github.com/ruby/irb/commit/25c731cb2f
* Separate `send` into `public_send` and `__send__`Nobuyoshi Nakada2020-10-271-1/+1
|
* Remove e2mmap dependencyaycabta2019-11-251-1/+1
|
* Use more strict regexp to avoid to match naninanirb.rbKazuhiro NISHIYAMA2019-11-211-2/+2
|
* Refactor filter_backtraceY. Ushiki2019-11-211-13/+3
|
* Fix filter_backtrace for context-mode 0Y. Ushiki2019-11-211-1/+2
|
* Handle binding.irb for frozen objects and BasicObjects using a delegateJeremy Evans2019-08-271-1/+30
| | | | Fixes Ruby Bug 13264
* Move private call without arguments inside methodJeremy Evans2019-08-271-1/+1
| | | | | | This code did not have the desired effect. I'm not sure if irb_binding is supposed to be private or not. If not, the private call can just be removed.
* Do not rely on IRB.conf[:MAIN_CONTEXT] before initializeTakashi Kokubun2019-05-301-2/+5
| | | | so that we can colorize binding.irb source lines.
* Check whether IRB.conf is nil in IRB::WorkSpace#code_around_bindingaycabta2019-05-211-2/+6
|
* Add --colorize and --nocolorize options to IRBaycabta2019-05-211-2/+6
|
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-271-1/+1
| | | | Backport changes from ruby/irb.
* suppress redefinition warningsnaruse2019-04-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-261-2/+6
| | | | from https://github.com/ruby/irb/commit/e6739d8c66dc78562930adb0b96935c9b38acf74
* Colorize IRB's code_around_bindingTakashi Kokubun2019-04-261-4/+7
| | | | Closes: https://github.com/ruby/ruby/pull/2150
* suppress redefinition warningsnaruse2019-04-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* irb/{context,workspace}.rb: use local_variable_setnobu2018-04-141-1/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (bind_location): Add Binding#source_locationmame2017-12-261-1/+1
| | | | | | Fixes #14230 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix TOCTTOU and avoid to read existing unreadable filekazu2017-11-241-2/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* workspace.rb: one more spacenobu2017-11-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* workspace.rb: fix SCRIPT_LINES__nobu2017-11-241-9/+7
| | | | | | | | | * lib/irb/workspace.rb (code_around_binding): `SCRIPT_LINES__` values are arrays of lines. get file and line at once. moved loop-invariant format string. join without extra strings by `$,`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* irb.rb: show source around binding.irb on startk0kubun2017-11-241-0/+21
| | | | | | [Feature #14124] [ruby-dev:50319] [close GH-1764] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove unnecessary `require 'thread'`kazu2017-10-081-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use qualified namesnobu2016-08-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cmath.rb: fixed indent.hsbt2014-08-091-57/+57
| | | | | | | * lib/drb/ssl.rb: ditto. * lib/irb/**/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/irb/inspector.rb: [DOC] Fix typo (s/dependant/dependent/)a_matsuda2013-11-301-1/+1
| | | | | | * lib/irb/workspace.rb: [DOC] Fix typo (s/binging/binding/) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2012-12-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/irb/workspace.rb: define method to private on top-level irbkeiju2012-12-251-2/+2
| | | | | | | | [Bug #5776]. Patch by davidbalbert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/irb.rb, lib/irb/*: Documentation for IRBzzak2012-12-211-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/irb*: merge doc from doc/irb/ird.rd and improve overallzzak2012-12-131-2/+4
| | | | | | | | documentation of IRB * doc/irb/irb.rd: remove stale documentation git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/core.rb: Use symbols instead of strings formarcandre2012-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | {const_,instance_variable_}{get,set}. [#7161] * lib/drb/drb.rb: ditto. * lib/ipaddr.rb: ditto. * lib/irb/workspace.rb: ditto. * lib/monitor.rb: ditto. * lib/rss/maker/base.rb: ditto. * lib/rss/rss.rb: ditto. * lib/xmlrpc/parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/irb/workspace.rb: fix BUG#4793.keiju2011-06-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bin/irb, lib/irb.rb lib/irb/*: irb-0.9.6, extend inspect-modekeiju2009-07-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/irb.rb (IRB::Irb::eval_input): SyntaxError should not bematz2008-03-041-0/+2
| | | | | | | | | considered as IRB bug. [ruby-dev:33991] * lib/irb/workspace.rb (IRB::WorkSpace::filter_backtrace): should filter 'irb.rb' as well for context mode 2 and 3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/json/lib/json/pure/generator.rb,naruse2008-02-121-1/+1
| | | | | | | | | | | | | | | ext/json/lib/json/pure/parser.rb, ext/openssl/lib/openssl/x509.rb, ext/win32ole/sample/olegen.rb, lib/date/format.rb, lib/irb/context.rb, lib/irb/workspace.rb, lib/net/http.rb, lib/net/imap.rb, lib/rdoc/generator.rb, lib/rdoc/markup/to_html.rb, lib/rdoc/markup/to_latex.rb, lib/rdoc/parsers/parse_c.rb, lib/rdoc/ri/formatter.rb, lib/rexml/parsers/baseparser.rb, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb, lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb, lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb, lib/yaml/encoding.rb: performance tuning arround String#gsub. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bin/irb lib/irb.rb lib/irb/...: IRB 0.9.5.keiju2005-04-131-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e