<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/irb/color.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/irb] Assert lvars_code doesn't include \n</title>
<updated>2022-10-18T06:03:23+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-10-18T06:00:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=931bcd1b6315de5407a73019482bd3919f16820d'/>
<id>931bcd1b6315de5407a73019482bd3919f16820d</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Always use local variables in current context to parse code (https://github.com/ruby/irb/pull/397)</title>
<updated>2022-10-18T05:44:07+00:00</updated>
<author>
<name>tomoya ishida</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2022-10-18T05:44:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a09f764ce52838a363b006ea434287eca431dbae'/>
<id>a09f764ce52838a363b006ea434287eca431dbae</id>
<content type='text'>
* 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 &lt;stan001212@gmail.com&gt;

* Add a comment why assignment expression check should be done before evaluate

https://github.com/ruby/irb/commit/c8b3877281

Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;
Co-authored-by: Takashi Kokubun &lt;takashikkbn@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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 &lt;stan001212@gmail.com&gt;

* Add a comment why assignment expression check should be done before evaluate

https://github.com/ruby/irb/commit/c8b3877281

Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;
Co-authored-by: Takashi Kokubun &lt;takashikkbn@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Rewrite on_scan proc to be more readable.</title>
<updated>2022-09-21T15:37:40+00:00</updated>
<author>
<name>tompng</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2022-09-19T05:14:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=369f1668cd9dd4f361d9082bb729aa510835126b'/>
<id>369f1668cd9dd4f361d9082bb729aa510835126b</id>
<content type='text'>
https://github.com/ruby/irb/commit/da54e7f081
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/irb/commit/da54e7f081
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Scan every single characters in IRB::Color.scan</title>
<updated>2022-09-21T15:37:38+00:00</updated>
<author>
<name>tompng</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2022-08-07T11:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9f686878794291b088d07866c00f8056a0c7dec7'/>
<id>9f686878794291b088d07866c00f8056a0c7dec7</id>
<content type='text'>
https://github.com/ruby/irb/commit/d14e56a65d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/irb/commit/d14e56a65d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Color.colorable? needs to consider the condition when irb is not loaded</title>
<updated>2022-06-28T13:57:17+00:00</updated>
<author>
<name>st0012</name>
<email>stan001212@gmail.com</email>
</author>
<published>2022-06-28T13:47:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7d211c93af2253c5f5a4eb988a362f3220965980'/>
<id>7d211c93af2253c5f5a4eb988a362f3220965980</id>
<content type='text'>
ruby/debug uses `irb/color` selectively:
https://github.com/ruby/debug/blob/0ac22406bb8f65bc76f9f5576a00c729cac693af/lib/debug/color.rb#L4

And in that case, `IRB.conf` won't be defined. So Color.colorable? needs
to consider that.

This also fixes the Ruby trunk CI.

https://github.com/ruby/irb/commit/b2cd07e795
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ruby/debug uses `irb/color` selectively:
https://github.com/ruby/debug/blob/0ac22406bb8f65bc76f9f5576a00c729cac693af/lib/debug/color.rb#L4

And in that case, `IRB.conf` won't be defined. So Color.colorable? needs
to consider that.

This also fixes the Ruby trunk CI.

https://github.com/ruby/irb/commit/b2cd07e795
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Centralize coloring control (https://github.com/ruby/irb/pull/374)</title>
<updated>2022-06-28T13:30:42+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2022-06-28T13:30:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=44c1316293f80abaa0e76b3818322544b9372a97'/>
<id>44c1316293f80abaa0e76b3818322544b9372a97</id>
<content type='text'>
* 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Use require_relative to require lib files</title>
<updated>2022-01-17T05:23:40+00:00</updated>
<author>
<name>st0012</name>
<email>stan001212@gmail.com</email>
</author>
<published>2022-01-16T22:20:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=81b604fb005b2dfa9601e0dabcdacfca6d8f3fba'/>
<id>81b604fb005b2dfa9601e0dabcdacfca6d8f3fba</id>
<content type='text'>
1. `require` can mislead Ruby to load system irb's files and cause
   constant redefined warnings as other code loads the same module/class
   from lib folder.
2. Most files already use `require_relative`.

https://github.com/ruby/irb/commit/848d339f2e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. `require` can mislead Ruby to load system irb's files and cause
   constant redefined warnings as other code loads the same module/class
   from lib folder.
2. Most files already use `require_relative`.

https://github.com/ruby/irb/commit/848d339f2e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Added `colorable` keyword option</title>
<updated>2021-04-26T12:14:52+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-04-07T16:01:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8fdc45c8941da7559eb61666284c38b7f72ccfbf'/>
<id>8fdc45c8941da7559eb61666284c38b7f72ccfbf</id>
<content type='text'>
Currently `IRB::Color.colorize` and `IRB::Color.colorize_code`
refer `$stdin.tty?` internally.
This patch adds `colorable` keyword option which overrides it.

https://github.com/ruby/irb/commit/402e3f1907
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently `IRB::Color.colorize` and `IRB::Color.colorize_code`
refer `$stdin.tty?` internally.
This patch adds `colorable` keyword option which overrides it.

https://github.com/ruby/irb/commit/402e3f1907
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Ripper::Lexer::Elem#state is defined since Ruby 2.5</title>
<updated>2021-04-08T11:42:14+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-04-07T03:07:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3816157e5d955da422d717f278bd3d4551447348'/>
<id>3816157e5d955da422d717f278bd3d4551447348</id>
<content type='text'>
And the required ruby version is 2.5 or later.

https://github.com/ruby/irb/commit/ac496d4c78
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
And the required ruby version is 2.5 or later.

https://github.com/ruby/irb/commit/ac496d4c78
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Colorize `__END__` as keyword</title>
<updated>2021-04-02T01:52:53+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-04-01T12:09:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=79af8ce6d7f46e7e79180dbd6bef6681c1329bd9'/>
<id>79af8ce6d7f46e7e79180dbd6bef6681c1329bd9</id>
<content type='text'>
https://github.com/ruby/irb/commit/9b84018311
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/irb/commit/9b84018311
</pre>
</div>
</content>
</entry>
</feed>
