| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/784)
* Page evaluation result's output
This will make it easier to work with long output that exceeds the terminal's height.
* Use consistent TERM in rendering tests
This makes sure we get consistent result on all platforms.
https://github.com/ruby/irb/commit/4fedce93d3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
prompt
(https://github.com/ruby/irb/pull/791)
Currently, IRB just terminates if `main.to_s` raises while IRB
constructs the prompt string. This can easily happen if the user wants
to start an IRB session in the instance scope of an uninitialized
object, for example:
```
class C
def initialize
binding.irb
@values = []
end
def to_s = @values.join(',') # raises if uninitialized
end
C.new
```
This patch makes IRB rescue from such an exception and displays the
class name of the exception instead of `main.to_s` to indicate some
error has occurred.
We may display more detailed information about the exception, but this
patch chooses not to do so because 1) the prompt has limited space,
2) users can evaluate `to_s` in IRB to examine the error if they want,
and 3) obtaining the details can also raise, which requires nested
exception handling and can be complicated.
https://github.com/ruby/irb/commit/412ab26067
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/782)
https://github.com/ruby/irb/commit/fa9ecf9a5b
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/780)
https://github.com/ruby/irb/commit/d42138c477
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/708)
* Add completor using prism and rbs
* Add TypeCompletion test
* Switchable completors: RegexpCompletor and TypeCompletion::Completor
* Add completion info to irb_info
* Complete reserved words
* Fix [*] (*) {**} and prism's change of KeywordParameterNode
* Fix require, frozen_string_literal
* Drop prism<=0.16.0 support
* Add Completor.last_completion_error for debug report
* Retrieve `self` and `Module.nesting` in more safe way
* Support BasicObject
* Handle lvar and ivar get exception correctly
* Skip ivar reference test of non-self object in ruby < 3.2
* BaseScope to RootScope, move method objects constant under Methods
* Remove unused Splat struct
* Drop deeply nested array/hash type calculation from actual object. Now, calculation depth is 1
* Refactor loading rbs in test, change preload_in_thread not to cache Thread object
* Use new option added in prism 0.17.1 to parse code with localvars
* Add Prism version check and warn when :type completor cannot be enabled
* build_type_completor should skip truffleruby (because endless method definition is not supported)
https://github.com/ruby/irb/commit/1048c7ed7a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/736)
* Remove dead method
* Simplify IRB.version
* Move private Irb methods together
* Centralise @CONF initialization/assignment in init.rb
* Move attr_* calls above initialize method
https://github.com/ruby/irb/commit/cf23be4395
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/701)
* Remove instance variable prompt and line_no from RubyLex
* Fix prompt test
* Rename prompt generating method and make it private
https://github.com/ruby/irb/commit/1ceb97fe2e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/684)
After this change, `RubyLex` will not interact with `Context` directly
in any way. This decoupling has a few benefits:
- It makes `RubyLex` easier to test as it no longer has a dependency on
`Context`. We can see this from the removal of `build_context` from
`test_ruby_lex.rb`.
- It will make `RubyLex` easier to understand as it will not be affected
by state changes in `Context` objects.
- It allows `RubyLex` to be used in places where `Context` is not available.
https://github.com/ruby/irb/commit/d5b262a076
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/696)
https://github.com/ruby/irb/commit/59bcc07def
|
|
|
|
|
|
|
|
| |
* Remove unused method and constant from IRB::Debug
* Update comments
https://github.com/ruby/irb/commit/98914a963c
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/685)
https://github.com/ruby/irb/commit/66e69fa0dc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/683)
* Add a test case for Ctrl-C handling
* Test symbol aliases with integration tests
There are a few places that also need to check symbol aliases before
`Irb#eval_input`. But since the current command test skip them, we
don't have test coverage on them.
* Move each_top_level_statement and readmultiline to Irb
This will save RubyLex from knowning information about commands and aliases.
https://github.com/ruby/irb/commit/69cb5b5615
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/682)
* Introduce Statement class
* Split Statement class for better clarity
https://github.com/ruby/irb/commit/65e8e68690
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/681)
It shouldn't be `RubyLex`'s responsibility to handle IO. So this moves
the configuration to `IRB::Irb`.
https://github.com/ruby/irb/commit/daff750076
|
|
|
|
|
|
|
|
|
|
|
| |
INF_RUBY prompt
(https://github.com/ruby/irb/pull/679)
* Drop showing indent level number in DEFAULT prompt and INF_RUBY prompt
* Update prompt part of test_rendering's expected result
https://github.com/ruby/irb/commit/3847532e54
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/670)
Since assignment check relies on tokenization with `Ripper`, it feels like
the responsibility of `RubyLex`. `Irb#eval_input` should simply get the result
when calling `each_top_level_statement` on `RubyLex`.
https://github.com/ruby/irb/commit/89d1adb3fd
|
|
|
|
|
|
|
| |
semicolon
(https://github.com/ruby/irb/pull/669)
https://github.com/ruby/irb/commit/50185c2833
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/652)
1. Dynamically including `HistorySavingAbility` makes things unnecessarily
complicated and should be avoided.
2. Because both `Reline` and `Readline` use a single `HISTORY` constant
to store history data. When nesting IRB sessions, only the first IRB
session should handle history loading and saving so we can avoid
duplicating history.
3. History saving callback should NOT be stored in `IRB.conf` as it's
recreated every time `IRB.setup` is called, which would happen when
nesting IRB sessions.
https://github.com/ruby/irb/commit/0fef0ae160
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/618)
* Test last value is assigned with measure enabled
* Remove unnecessary `result` variable
`Context#evaluate` always assigns the result of the evaluation to `_` so
we don't need to do it in `Irb#eval_input`.
* Move benchmarking logic into `Context#evaluate`
Current location of the benchmarking logic is too high up and includes
operations like command loading and argument transformation, which should
be excluded. So this commit moves it into `Context#evaluate` to reduce the
noise.
We don't move it further down to `Workspace#evaluate` because `Context`
is an argument of the measure block, which is not available in `Workspace`.
|
| |
|
|
|
|
|
|
|
| |
the value is always nil
(https://github.com/ruby/irb/pull/617)
https://github.com/ruby/irb/commit/62691384f8
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/615)
This makes sure `Context#evaluate` really just evaluates the input.
It will also make #575's implementation cleaner.
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/583)
1. Make `RubyLex#set_input` simply assign the input block. This matches
the behavior of `RubyLex#set_prompt`.
2. Merge `RubyLex#set_input`'s IO configuration logic with `#set_auto_indent`
into `#configure_io`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 <alexandre.terrasa@shopify.com>
* 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 <alexandre.terrasa@shopify.com>
* Remove unused IRB.irb_at_exit
It's not used after https://github.com/ruby/irb/commit/aaf4eb4e9830ae71240ca5d2047c5e3ad20a4044
Co-authored-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
* 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 <alexandre.terrasa@shopify.com>
|
|
|
|
|
|
|
|
|
|
|
| |
string
(https://github.com/ruby/irb/pull/528)
* Handle long inspect and control characters in prompt string
* Add constants for prompt truncate length, omission and replace pattern
* Simply compare string instead of regexp in prompt truncation test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some background for this refactor:
1. Through a RubyLex instance's lifetime, the context passed to its methods
should be the same.
Given that `Context` is only initialised in `Irb#initialize`,
this should be true.
2. When `RubyLex` is initialised, the context object should be accessible.
This is also true in all 3 of `RubyLex.new`'s invocations.
With the above observations, we should be able to store the context in `RubyLex`
as an instance variable. And doing so will make `RubyLex`'s instance methods
easier to use and maintain.
https://github.com/ruby/irb/commit/5c8d3df2df
|
|
|
|
| |
https://github.com/ruby/irb/commit/cef125850d
|
|
|
|
| |
https://github.com/ruby/irb/commit/07fae94862
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/449)
* Seamlessly integrate a few debug commands
* Improve the break command support
* Utilize skip_src option if available
* Add step and delete commands
* Write end-to-end tests for each debugger command
* Add documentation
* Add backtrace, info, catch commands
https://github.com/ruby/irb/commit/976100c1c2
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/451)
* Document a full list of commands
* Document debug as well
* Make it less duplicated
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/452)
https://github.com/ruby/irb/commit/e6b4917750
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/447)
* Minor fixes on debug command
* Update lib/irb/cmd/debug.rb
|
|
|
|
| |
https://github.com/ruby/irb/commit/30faa13fa3
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/444)
for debug.gem's `irb` command
|
|
|
|
|
| |
Because it has reached EOL for more than 1.5 years and it won't be
supported by the next reline version either.
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/437)
* Transform ls's --grep/-G option to keyword args
* Make --grep less flexible
* Support -g instead of --grep
* Suppress warnings from symbol aliases
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/377)
* Include updated help message
https://github.com/ruby/irb/commit/ff129f3794
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
https://github.com/ruby/irb/commit/3ddc89e38c
|
|
|
|
| |
https://github.com/ruby/irb/commit/af99c01b0d
|
|
|
|
|
|
| |
it for tests
https://github.com/ruby/irb/commit/de561cafeb
|
|
|
|
| |
https://github.com/ruby/irb/commit/b5f953dc33
|
|
|
|
| |
https://github.com/ruby/irb/commit/ac3d4b9e79
|
|
|
|
|
|
|
|
|
|
|
|
| |
From Reidline to Reline
Update description used in take_corresponding_syntax_to_kw_do and is_the_in_correspond_to_a_for methods
Use possessive noun correctly
Second element
https://github.com/ruby/irb/commit/4fa9714d6f
|