Граф коммитов

12747 Коммитов

Автор SHA1 Сообщение Дата
Vinicius Stock dedca31804 [ruby/prism] Fix `full_name` for constant path targets
https://github.com/ruby/prism/commit/84c10f3a2d
2024-02-13 14:09:19 +00:00
Stan Lo 2f0f95235a [ruby/irb] Fix SourceFinder's constant evaluation issue
(https://github.com/ruby/irb/pull/869)

Currently, if the signature's constant part is not defined, a NameError
would be raised.

```
irb(main):001> show_source Foo
(eval):1:in `<top (required)>': uninitialized constant Foo (NameError)

Foo
^^^
        from (irb):1:in `<main>'
```

This commit fixes the issue and simplifies the `edit` command's implementation.

https://github.com/ruby/irb/commit/8c16e029d1
2024-02-13 13:36:32 +00:00
Stan Lo ec26786b1a [ruby/irb] Refactor eval_path and `SourceFinder::Source`
(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-13 13:33:36 +00:00
Otávio Schwanck dos Santos e848848b58
[ruby/reline] C for vi mode
(https://github.com/ruby/reline/pull/472)

https://github.com/ruby/reline/commit/d197be7c44
2024-02-13 18:57:17 +09:00
License Update 785aa47cd6 [rubygems/rubygems] Update SPDX license list as of 2024-02-08
https://github.com/rubygems/rubygems/commit/ec3de95d79
2024-02-13 01:27:18 +00:00
tomoya ishida 7af97dc71f [ruby/irb] Powerup show_source by enabling RubyVM.keep_script_lines
(https://github.com/ruby/irb/pull/862)

* Powerup show_source by enabling RubyVM.keep_script_lines

* Add file_content field to avoid reading file twice while show_source

* Change path passed to eval, don't change irb_path.

* Encapsulate source coloring logic and binary file check insode class Source

* Add edit command testcase when irb_path does not exist

* Memoize irb_path existence to reduce file existence check calculating eval_path

https://github.com/ruby/irb/commit/239683a937
2024-02-12 18:38:30 +00:00
Kevin Newton 94bc5ad30a [ruby/prism] ruby_parser translator
https://github.com/ruby/prism/commit/1925b970c7
2024-02-12 17:54:54 +00:00
Noah Gibbs 16b39072a5 [ruby/prism] Move Prism::RipperCompat to Prism::Translation::Ripper
https://github.com/ruby/prism/commit/c0331abe4f
2024-02-12 15:57:57 +00:00
tomoya ishida 06995eb45b [ruby/irb] Fix exit! command warning and method behavior
(https://github.com/ruby/irb/pull/868)

* Fix exit! command warning and method behavior

* Remove arg(0) from Kernel.exit and Kernel.exit!

https://github.com/ruby/irb/commit/372bc59bf5
2024-02-12 11:28:54 +00:00
KJ Tsanaktsidis 1d467f2255 Burn default ASAN options into the built Ruby
* We always need use_sigaltstack=0 because Ruby registers sigaltstack
  handlers
* We also need to disable leak detection (unless RUBY_FREE_AT_EXIT is
  set - I might experiment later with automatically enabling leak
  detection if RUBY_FREE_AT_EXIT is set).

Burning it into the built ruby binary in this way avoids people needing
to remember to start their Ruby program with these flags all the time.

We also need a small fix in mkmf to make sure that test programs also
don't have leak detection enabled (this is never desirable)

[Bug #20256]
2024-02-12 10:51:46 +11:00
Nobuyoshi Nakada c9006ddb88 [ruby/optparse] [DOC] Add description of OptionParser#define_by_keywords
https://github.com/ruby/optparse/commit/451dea51a0
2024-02-11 16:55:41 +00:00
Nobuyoshi Nakada bbccabe6d6 [ruby/optparse] [DOC] Add missing documents
https://github.com/ruby/optparse/commit/33956ce93f
2024-02-11 16:08:14 +00:00
Stan Lo 5c4657f883 [ruby/irb] Polish the exit! command and its tests
(https://github.com/ruby/irb/pull/867)

* Remove IRB.irb_exit! method

It's not necessary to introduce a new method just for the exit! command
at this moment.

* Rename ExitForcedAction to ForceExit

* Move force exit tests to a dedicated file

* Fix nested history saving with exit! command

Because we switched to use `Kernel#exit` instead of `exit!`, the outer
session's ensure block in `Irb#run` will be run, which will save the
history. This means the separate check to save history when force exiting
is no longer necessary.

* execute_lines helper should also capture IRB setup's output

This prevents setup warnings from being printed to test output
while allowing those output to be tested.

* Update readme

https://github.com/ruby/irb/commit/899d10ade1
2024-02-11 05:17:40 +00:00
Ignacio Chiazzo Cardarello 429eeb09f2 [ruby/irb] Introduce exit! command
(https://github.com/ruby/irb/pull/851)

* Added failing test for when writing history on exit

* Save history on exit

* Exit early when calling Kernel.exit

* use status 0 for kernel.exit

* Added test for nested sessions

* Update lib/irb.rb

---------

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

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-02-10 22:07:53 +00:00
Nobuyoshi Nakada f960fbc102 [ruby/optparse] Search exactly when `require_exact`
To work with options defined as `--[no]-something`.

Fix https://bugs.ruby-lang.org/issues/20252
Fix https://github.com/ruby/optparse/pull/60

https://github.com/ruby/optparse/commit/78afdab307
2024-02-11 00:47:41 +09:00
Noah Gibbs 8688256522 [ruby/prism] Update lib/prism/ripper_compat.rb
https://github.com/ruby/prism/commit/2c53e017c1

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-09 19:49:27 +00:00
Noah Gibbs f635b4dd0e [ruby/prism] RipperCompat: add array-refs, assigns, symbols, strings
https://github.com/ruby/prism/commit/b771c7f2ec
2024-02-09 19:49:27 +00:00
Kevin Newton cf1cd215c0 [ruby/prism] Significantly faster offset cache for parser
https://github.com/ruby/prism/commit/8cd92eef79
2024-02-09 16:27:05 +00:00
Nobuyoshi Nakada db73226bf6 [ruby/optparse] Adjust arguments for lambda-callbacks
Rake uses [lambda] as callbacks.
Calling it without omitted argument raises an `ArgumentError`.

lambda: https://github.com/ruby/rake/blob/master/lib/rake/application.rb#L543

https://github.com/ruby/optparse/commit/213cb03b59
2024-02-09 19:58:31 +09:00
Nobuyoshi Nakada 2c6767b71e [ruby/optparse] Respect default values in block parameters
Fix https://github.com/ruby/optparse/pull/55

https://github.com/ruby/optparse/commit/9d53e74aa4
2024-02-09 19:58:19 +09:00
fatkodima f7a407cabd [ruby/optparse] Fix `require_exact` to work with options defined as `--[no]-something`
https://github.com/ruby/optparse/commit/4e346ad337
2024-02-09 03:31:13 +00:00
Nobuyoshi Nakada 50bcaa6286 [ruby/optparse] Escape backslashes
https://github.com/ruby/optparse/commit/b14c2c644d
2024-02-09 03:21:24 +00:00
Petrik 2a57e6e6ed [ruby/rdoc] Don't document aliases with trailing `:nodoc` directive
Attribute readers and writers can be marked as `:nodoc` to keep them
undocumented:

```ruby
attr_reader :name # :nodoc:
```

For aliases this behaviour should be the same:

```ruby
alias_method :old :new # :nodoc:
```

https://github.com/ruby/rdoc/commit/30f14e8271
2024-02-09 01:07:17 +00:00
Noah Gibbs 1983949811 [ruby/prism] Looks like Symbol#name wasn't a thing in 2.7, so need to switch back to to_s
https://github.com/ruby/prism/commit/0b90c9a398
2024-02-08 16:02:06 +00:00
Noah Gibbs 0c73553052 [ruby/prism] Add Kevin's visit_all change and change the parent class to Compiler.
https://github.com/ruby/prism/commit/bbdba3f42d

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-02-08 16:02:06 +00:00
Noah Gibbs f8b8a6780c [ruby/prism] Update lib/prism/ripper_compat.rb
https://github.com/ruby/prism/commit/03addf2d3d

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08 16:02:05 +00:00
Noah Gibbs 3f0aa55449 [ruby/prism] Update lib/prism/ripper_compat.rb
https://github.com/ruby/prism/commit/5eac08f699

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08 16:02:05 +00:00
Noah Gibbs c1aba5d97b [ruby/prism] Update lib/prism/ripper_compat.rb
https://github.com/ruby/prism/commit/8271ce5ec9

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08 16:02:05 +00:00
Noah Gibbs 70bc4ce34f [ruby/prism] Update lib/prism/ripper_compat.rb
https://github.com/ruby/prism/commit/6e2bf9c8cd

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08 16:02:05 +00:00
Noah Gibbs 6aceb91de0 [ruby/prism] Update lib/prism/ripper_compat.rb
https://github.com/ruby/prism/commit/bce0a5c916

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-02-08 16:02:04 +00:00
Noah Gibbs 366af4679e [ruby/prism] RipperCompat: support for more features.
* add bin/prism ripper to compare Ripper output
* block arg handling is quirky, do it per-call-site
* block required params
* boolean values
* various assign-operator support
* breaks, early fragile begin/rescue/end
* more fixtures being checked

https://github.com/ruby/prism/commit/31732cb720
2024-02-08 16:02:04 +00:00
Hiroshi SHIBATA 70bb9cf065 [rubygems/rubygems] rake vendor:install
https://github.com/rubygems/rubygems/commit/c38a96ceae
2024-02-08 15:27:01 +09:00
Hiroshi SHIBATA 75c5e1a136 [rubygems/rubygems] Removed unnecessary disabling of Style/RedundantParentheses
https://github.com/rubygems/rubygems/commit/2361527c45
2024-02-08 15:27:00 +09:00
David Rodriguez c236212600
[rubygems/rubygems] Use deprecation helper for deprecation warning
https://github.com/rubygems/rubygems/commit/d1963bf1a6
2024-02-08 14:43:56 +09:00
David Rodríguez 24d5e7176e
[rubygems/rubygems] Refactor lockfile generation
https://github.com/rubygems/rubygems/commit/6a0c03c77f
2024-02-08 14:43:56 +09:00
David Rodríguez debc5aaee5
[rubygems/rubygems] Remove unused parameter
https://github.com/rubygems/rubygems/commit/085eda7147
2024-02-08 14:43:56 +09:00
Kevin Newton 0e1f22ac7e [ruby/prism] Dev-only CLI
We keep adding more scripts to /bin that are doing the same kinds
of processing. Instead, this commit consolidates them all into a
single CLI that shares the same logic so that we can consistently
read files in the same way.

It keeps around 2 binstubs for bin/lex and bin/parse since those
are the most used and I'm sure people have built up muscle memory
for those. Those scripts are now just wrappers for forwarding to
bin/prism.

https://github.com/ruby/prism/commit/bddcb9bf17
2024-02-07 21:26:14 +00:00
Noah Gibbs 1b68b459ca [ruby/prism] Commit Kevin's suggestion to simplify grabbing the operator.
https://github.com/ruby/prism/commit/874ba7a1f4

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2024-02-07 19:42:14 +00:00
Noah Gibbs 5b7baa0486 [ruby/prism] More different block-call syntaxes, support more types of method calls
https://github.com/ruby/prism/commit/40cf114a24
2024-02-07 19:42:13 +00:00
Noah Gibbs 73d222e1ef [ruby/prism] Support &. calls and calling with blocks, test with fixtures
https://github.com/ruby/prism/commit/e346fa583a
2024-02-07 19:42:13 +00:00
Noah Gibbs b1310940e3 [ruby/prism] RipperCompat: support more kinds of method calls and operators.
Add tests. Start parsing some simpler fixture code.

https://github.com/ruby/prism/commit/997f4191d8
2024-02-07 19:42:13 +00:00
Kevin Newton fcc8df622a
Bump prism version 2024-02-07 13:36:06 -05:00
Stan Lo 0b7f516834 [ruby/irb] Bump version to v1.11.2
(https://github.com/ruby/irb/pull/865)

https://github.com/ruby/irb/commit/afe1f459cc
2024-02-07 16:57:33 +00:00
Kevin Newton aad3c36bdf [ruby/prism] Support for Ruby 2.7
https://github.com/ruby/prism/commit/1a15b70a8e
2024-02-07 16:54:34 +00:00
Stan Lo 5f4245e74b [ruby/irb] Polish tracer integration and tests
(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-07 14:59:10 +00:00
Kevin Newton 164c18af7b [ruby/prism] Correct handle recover parameters on tokenize for parser translation
https://github.com/ruby/prism/commit/63979de21d
2024-02-07 14:44:36 +00:00
Kim Emmanuel 0edf5a714b [rubygems/rubygems] #to_spec must fallback for prereleases always
https://github.com/rubygems/rubygems/commit/6302798a32
2024-02-07 05:46:50 +00:00
Kim Emmanuel 5ddf4f5c95 [rubygems/rubygems] fix Gem::Dependency#to_spec returning nil when prerelease is the only available version
https://github.com/rubygems/rubygems/commit/a7dcc7214b
2024-02-07 05:46:49 +00:00
Kevin Newton 2dba441397 [ruby/prism] Even more ripper compat
https://github.com/ruby/prism/commit/47a602dc1c
2024-02-07 03:21:02 +00:00
Noah Gibbs e34505c631 [ruby/prism] More visitors and tests for RipperCompat
Part of issue #2354

https://github.com/ruby/prism/commit/cb28edae34
2024-02-07 01:49:54 +00:00