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

11787 Коммитов

Автор SHA1 Сообщение Дата
Sutou Kouhei 73c56e06c4 [ruby/csv] CSV#read consumes the same lines with other methods like CSV#shift
GitHub: fix https://github.com/ruby/csv/pull/258

Reported by Lhoussaine Ghallou. Thanks!!!

https://github.com/ruby/csv/commit/71e6d24e28
2023-05-25 01:44:17 +09:00
Mau Magnaguagno a0709d0aae [ruby/csv] Remove no longer required refinements
(https://github.com/ruby/csv/pull/250)

Since PR #159, the minimum Ruby version is 2.5.0, a version which no
longer requires refinements for String#delete_suffix?, String#match? and
Regexp#match?.
2023-05-25 01:44:17 +09:00
Jenny Shen 061e01ee50 [rubygems/rubygems] Remove forward slash in key regardless if it contains __
https://github.com/rubygems/rubygems/commit/33a02eec00
2023-05-23 18:37:09 +00:00
Jenny Shen e854b050cc [rubygems/rubygems] Modify invalid key check to accept keys with colons
https://github.com/rubygems/rubygems/commit/413033198b

Co-authored-by: Eric Herscovich <eric.herscovich@shopify.com>
2023-05-23 18:37:08 +00:00
TSUYUSATO Kitsune 92d6c9a7b1 [ruby/irb] Allow `show_source` for private methods
(https://github.com/ruby/irb/pull/589)

* Allow `show_source` for private methods

Fix https://github.com/ruby/irb/pull/577

* Pend tests on TruffleRuby

It seems `eval(..., __LINE__ + 1)` does not work.
Other similar tests are also pended on TruffleRuby, so I think it
is acceptable.

* Use `private_method_defined?` instead of `defined?`
2023-05-23 16:16:37 +00:00
Hiroshi SHIBATA a7d7032100
Manually merge syntax_suggest-1.1.0 2023-05-23 10:05:47 +09:00
schneems c638ffa700
[ruby/syntax_suggest] Fix
https://github.com/ruby/syntax_suggest/pull/187 Handle if/else with
empty/comment
line

Reported in #187 this code:

```
class Foo
  def foo
    if cond?
      foo
    else
      # comment
    end
  end

  # ...

  def bar
    if @recv
    end_is_missing_here
  end
end
```

Triggers an incorrect suggestion:

```
Unmatched keyword, missing `end' ?
   1  class Foo
   2    def foo
>  3      if cond?
>  5      else
   8    end
  16  end
```

Part of the issue is that while scanning we're using newlines to determine when to stop and pause. This is useful for determining logically smaller chunks to evaluate but in this case it causes us to pause before grabbing the "end" that is right below the newline. This problem is similar to https://github.com/ruby/syntax_suggest/pull/179.

However in the case of expanding same indentation "neighbors" I want to always grab all empty values at the end of the scan. I don't want to do that when changing indentation levels as it affects scan results.

There may be some way to normalize this behavior between the two, but the tests really don't like that change.

To fix this issue for expanding against different indentation I needed a way to first try and grab any additional newlines with the ability to rollback that guess. In #192 I experimented with decoupling scanning from the AroundBlockScan logic. It also added the ability to take a snapshot of the current scanner and rollback to prior changes.

With this ability in place now we:

- Grab extra empties before looking at the above/below line for the matching keyword/end statement
- If there's a match, grab it
- If there's no match, discard the newlines we picked up in the evaluation

That solves the issue.

https://github.com/ruby/syntax_suggest/commit/513646b912
2023-05-23 10:05:47 +09:00
schneems aaf815c626
[ruby/syntax_suggest] Refactor Scanner logic out of AroundBlockScan introduce history
AroundBlockScan started as a utility class that was meant to be used as a DSL for scanning and making new blocks. As logic got added to this class it became hard to reason about what exactly is being mutated when. I pulled the scanning logic out into it's own class which gives us a clean separation of concerns. This allowed me to remove a lot of accessors that aren't core to the logic provided by AroundBlockScan.

In addition to this refactor the ScanHistory class can snapshot a scan. This allows us to be more aggressive with scans in the future as we can now snapshot and rollback if it didn't turn out the way we wanted.

The change comes with a minor perf impact:

before: 5.092678   0.104299   5.196977 (  5.226494)
after: 5.128536   0.099871   5.228407 (  5.249542)

This represents a 0.996x change in speed (where 1x would be no change and 2x would be twice as fast). This is a 0.38% decrease in performance which is negligible. It's likely coming from the extra blocks being created while scanning. This is negligible and if the history feature works well we might be able to make better block decisions which is means fewer calls to ripper which is the biggest bottleneck.

While this doesn't fix https://github.com/ruby/syntax_suggest/issues/187 it's a good intermediate step that will hopefully make working on that issue easier.

https://github.com/ruby/syntax_suggest/commit/ad8487d8aa
2023-05-23 10:05:47 +09:00
schneems b8bf0a5272
[ruby/syntax_suggest] Fix warning message
The env var DEBUG does not work to produce detailed output. It is SYNTAX_SUGGEST_DEBUG. It was changed as part of the dead_end to syntax_suggest migration for Ruby 3.2

https://github.com/ruby/syntax_suggest/commit/c41da7aab7
2023-05-23 10:05:47 +09:00
ima1zumi 8db13c179e [ruby/reline] Bump version to 0.3.4
(https://github.com/ruby/reline/pull/538)

https://github.com/ruby/reline/commit/1fb0753bc1
2023-05-20 09:31:43 +00:00
tomoya ishida e8c9f727e8 [ruby/irb] Simplify each_top_level_statement
(https://github.com/ruby/irb/pull/576)

* Simplify each_top_level_statement, reduce instance vars

* Update lib/irb/ruby-lex.rb

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Remove unused ltype from TestRubyLex#check_state response

* Remove unnecessary const path of TerminateLineInput

* Combine duplicated code state check into method

---------

https://github.com/ruby/irb/commit/172453cec4

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-05-19 13:48:08 +00:00
Adam Daniels b54b388f2a [ruby/irb] Display mod key as `Option` on Darwin platforms
(https://github.com/ruby/irb/pull/584)

Check RUBY_PLATFORM for `darwin` and modify the mod key from `Alt` to
`Option`.
2023-05-19 01:33:32 +00:00
Stan Lo cfb7997353 [ruby/irb] Refactor RubyLex's input/io methods
(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`.
2023-05-18 19:00:33 +00:00
Stan Lo b695f58d52 [ruby/irb] Print deprecation warning for `help` command
(https://github.com/ruby/irb/pull/567)

* Give show_doc its own command class

* Print deprecation warning for `help` command
2023-05-18 03:28:31 +00:00
Hiroshi SHIBATA 5f411b9b3e [rubygems/rubygems] Bump up thor-1.2.2
https://github.com/rubygems/rubygems/commit/d9a003b4e7
2023-05-13 02:21:33 +00:00
Hiroshi SHIBATA 0ef6e718d9
Merge https://github.com/rubygems/rubygems/pull/6655 manually. 2023-05-10 15:02:29 +09:00
Samuel Giddins 9ed189e9aa
Update SPDX license list 2023-05-10 14:58:55 +09:00
Takumasa Ochi 5831f7c831 [rubygems/rubygems] Simplify code by Gem::Specification#runtime_dependencies
https://github.com/rubygems/rubygems/commit/324139af8f
2023-05-08 08:56:22 +00:00
tomoya ishida 5eca327fc5 [ruby/reline] Fix dialog corrupts rendering by pushing up input line
too much
(https://github.com/ruby/reline/pull/524)

* Do not render dialog where it overflows screen

* Dialog rendering should Scroll down only when needed

* Refactor screen_y_range calculation

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

https://github.com/ruby/reline/commit/bc0e3d1310

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-05-07 13:18:13 +00:00
zzak 8b2884c0b5 [ruby/rdoc] Isolate root dir if specified
This ensures only files from the root directory are chosen, in order to allow a clean build from outside the source directory.

https://github.com/ruby/rdoc/commit/f3b389aa9e
2023-05-06 07:39:24 +00:00
Nobuyoshi Nakada 40438fc4d3 [ruby/rdoc] Drop the support for 2.5 or earlier because of CVE-2021-31799
https://github.com/ruby/rdoc/commit/26136138aa
2023-05-05 14:01:50 +00:00
Nobuyoshi Nakada cfa6a892d0
Redirect to `IO::NULL` for the portability 2023-05-05 18:52:36 +09:00
Nobuyoshi Nakada 32cc6301b3 [ruby/rdoc] [DOC] stop documenting fallback `MatchData#match_length`
Also empty document of `Object`.

https://github.com/ruby/rdoc/commit/ce32a3102b
2023-05-02 17:06:36 +00:00
Nobuyoshi Nakada e47aa27dc7 [ruby/rdoc] Section may not have `label`
https://github.com/ruby/rdoc/commit/945f0cb3e9
2023-05-02 05:42:37 +00:00
Nobuyoshi Nakada 3833d0fee6 [ruby/rdoc] Fix references to nested label in table_of_contents
Fixes https://github.com/ruby/rdoc/pull/1000

https://github.com/ruby/rdoc/commit/291e2b7e8b
2023-05-02 04:19:46 +00:00
tomoya ishida 13dfbcf7bf [ruby/reline] Rewrite dialog rendering
(https://github.com/ruby/reline/pull/492)

* Rewrite dialog rendering

* Fix failing test of dialog with small screen

* Add multiple-dialog rendering test

* Add description comments for each part of render_dialog_changes
2023-05-01 12:20:20 +00:00
Nobuyoshi Nakada dd5ba1b725
Update generate_spdx_license_list.rb
- Follow up RegexpLiteral at 9264d834215aa7ce14b0273032a7686c20141db9.
- Split the code to be generated so that `REGEXP` does not need
  escapes.
- Use `REGEXP.match?` since support for Ruby 2.3 or earlier has been
  dropped.
2023-05-01 17:40:02 +09:00
Nobuyoshi Nakada c2871161b4 [ruby/rdoc] Fix polynominal backtracking
Fix https://github.com/ruby/rdoc/pull/995

https://github.com/ruby/rdoc/commit/1311ca8c50
2023-04-29 16:55:37 +00:00
Nobuyoshi Nakada 85a9fd1902 [ruby/rdoc] Fix polynominal backtracking
Fix https://github.com/ruby/rdoc/pull/995

https://github.com/ruby/rdoc/commit/adfa7db5b9
2023-04-29 16:55:36 +00:00
Stan Lo e9930b51b2 [ruby/irb] Retire magic-file.rb
(https://github.com/ruby/irb/pull/574)

`MagicFile` was introduced around v0.9.6, which was like 14~15 years ago.
It was needed because back then we needed to read a file's magic comment
to determine the encoding of it, and read it with that encoding.

Commit: 3ee79e89

But now we expect files to be encoded in UTF-8 and don't specify encoding
through magic comments anymore, `MagicFile` can be retired.
2023-04-28 17:20:20 +00:00
Takashi Kokubun d4dc149c3c Update an Intel SDM link [ci skip] 2023-04-28 10:09:52 -07:00
Nobuyoshi Nakada 7ba37cb7aa [ruby/resolv] Prefer `Array#concat` over `#+=` on `Array`
Fix https://bugs.ruby-lang.org/issues/19621

https://github.com/ruby/resolv/commit/7faaa78847
2023-04-28 11:29:02 +00:00
Stan Lo 5cd4f35da6 [ruby/irb] Simplify Locale#load
(https://github.com/ruby/irb/pull/571)

* Simplify Locale#load

Instead of loading file content with `MagicFile` and then evaluting it,
we can just use `Kernel.load` to load the file.

* Remove unused optional argument

* Remove unused Locale#require and #toplevel_load
2023-04-27 15:42:21 +00:00
Stan Lo a58cae77f7 [ruby/irb] Stop using MagicFile for printing help messages
(https://github.com/ruby/irb/pull/573)

`MagicFile` was introduced around v0.9.6, which was like 14~15 years ago.
It was needed because back then we needed to read a file's magic comment
to determine the encoding of it, and read it with that encoding.

Commit: 3ee79e89ad

But now both EN and JA's help-message file are UTF-8 and have removed the
encoding comment, we don't need to open them with `MagicFile` anymore.
2023-04-27 11:07:05 +00:00
Takashi Kokubun cbfb5fbb25 RJIT: Fix unspecified_bits with locals 2023-04-26 18:12:53 -07:00
Stan Lo fe0b23b42f [ruby/irb] Remove encoding_aliases.rb
(https://github.com/ruby/irb/pull/569)

We don't have to load another file to define the legacy encoding aliases
map because there's only one definition of it. We can define it in
locale.rb directly.
2023-04-26 15:06:05 +00:00
Stan Lo 299d17a2f1
[ruby/irb] Fix Locale's encoding lookup for Japanese encodings
(https://github.com/ruby/irb/pull/568)

In 3ee79e89ad,
`encoding_aliases.rb` was introduced to return the correct encoding object for
`ujis` and `euc` encodings.

However, the return value of `@@legacy_encoding_alias_map[@encoding_name]`
is always overridden by a second look up with `Encoding.find(@encoding_name)`.
So the logic didn't work as expected.

This commit fixes the problem.
2023-04-26 13:13:25 +09:00
schneems 3d5febf65b [ruby/syntax_suggest] Clean up output
I previously left a comment stating I didn't know why a certain method existed. In investigating the code in `CaptureCodeContext#capture_before_after_kws` I found that it was added as to give a slightly less noisy output.

The docs for AroundBlockScan#capture_neighbor_context only describe keywords as being a primary concern. I modified that code to only include lines that are keywords or ends. This reduces the output noise even more.

This allows me to remove that `start_at_next_line` method.

One weird side effect of the prior logic is it would cause this code to produce this output:

```
        class OH
          def hello

          def hai
          end
        end
```

```
          1  class OH
        > 2    def hello
          4    def hai
          5    end
          6  end
```

But this code to produce this output:

```
        class OH
          def hello
          def hai
          end
        end
```

```
          1  class OH
        > 2    def hello
          4    end
          5  end
```
Note the missing `def hai`. The only difference between them is that space.

With this change, they're now both consistent.

https://github.com/ruby/syntax_suggest/commit/4a54767a3e
2023-04-25 14:43:06 +09:00
Akinori MUSHA ed887cbb4c [ruby/set] Update lib/set.rb
https://github.com/ruby/set/commit/bc59f85f2f
2023-04-25 01:58:12 +00:00
Hiroshi SHIBATA 15796ae1e8 [ruby/set] Expose Set::VERSION
https://github.com/ruby/set/commit/d39b33f463
2023-04-25 01:58:12 +00:00
Akinori MUSHA c301ba0a66 [ruby/abbrev] Update lib/abbrev.rb
https://github.com/ruby/abbrev/commit/6fa790eac1
2023-04-25 01:55:57 +00:00
Hiroshi SHIBATA 8b9b075b83 [ruby/abbrev] Expose Abbrev::VERSION
https://github.com/ruby/abbrev/commit/255ca681c3
2023-04-25 01:55:56 +00:00
Carl Brasic 8a132358d7 [ruby/reline] Revert #335 (Trap TSTP to handle C-z)
(https://github.com/ruby/reline/pull/535)

This PR was an effort to address #321 (ed_quoted_insert doesn't work
properly) but per the reporter it did not work correctly.

Moreover, it introduced a major regression: Shell job control stopped
working in all applications that use reline, notably IRB.

Bash and other shells send SIGTSTP in response to C-z to implement job
suspension. Handling SIGSTP opts out of this functionality. For a
line oriented terminal program this should be avoided (not to mention,
this behavior diverges from readline's)

https://github.com/ruby/reline/commit/26383d25b8

Co-authored-by: Carl Brasic <cbrasic@drwholdings.com>
2023-04-24 16:31:13 +00:00
Stan Lo 73fc81199d [ruby/irb] Simplify the help command's implementation
(https://github.com/ruby/irb/pull/564)

The current method-redefining approach brings little benefit, makes it
harder to understand the code, and causes warnings like:

> warning: method redefined; discarding old execute

This patch simplifies it while displaying more helpful message when rdoc
couldn't be loaded.
2023-04-24 14:10:36 +00:00
Stan Lo 805899dda2 [ruby/irb] Filter out top-level methods when using `ls
<Class/Module>`
(https://github.com/ruby/irb/pull/562)

Instead of always printing methods inherited from Class or Module, IRB by
default should filter them out unless `<Class/Module>` is specified to be
either of those.
2023-04-24 14:05:16 +00:00
Yusuf Daniju ec211ad54d [ruby/irb] fix typo in tracer (https://github.com/ruby/irb/pull/565)
https://github.com/ruby/irb/commit/2f567f3d3e
2023-04-23 18:41:40 +00:00
Hiroshi SHIBATA 94a418d0bb [ruby/rinda] Expose Rinda::VERSION
https://github.com/ruby/rinda/commit/fa3865ac48
2023-04-21 06:22:52 +00:00
Hiroshi SHIBATA ce38ad6963 [rubygems/rubygems] util/rubocop -A
https://github.com/rubygems/rubygems/commit/784e5e2fe5
2023-04-20 01:57:17 +00:00
Hiroshi SHIBATA b42f0094ce [rubygems/rubygems] Support Symbol and URL keys
https://github.com/rubygems/rubygems/commit/3bda049c73
2023-04-20 01:57:17 +00:00
Hiroshi SHIBATA 4bb0e01da2 [rubygems/rubygems] warn message when RubyGems handle invalid yaml like 'invalid: foo: bar'
https://github.com/rubygems/rubygems/commit/b8d0c25b7e
2023-04-20 01:57:17 +00:00
Hiroshi SHIBATA 7477284043
Hide Gem::MockGemUi. It's only used by tests 2023-04-19 15:59:59 +09:00
Hiroshi SHIBATA d1c42da7a1 [rubygems/rubygems] To use Gem::YAMLSerializer in Bundler
https://github.com/rubygems/rubygems/commit/5351e01b32
2023-04-19 06:56:24 +00:00
Hiroshi SHIBATA 40d1a00040 [rubygems/rubygems] Copy YAMLSerializer from Bundler
https://github.com/rubygems/rubygems/commit/6a97346708
2023-04-19 06:56:23 +00:00
Hiroshi SHIBATA 8b95b33a9d [rubygems/rubygems] Bundler::YAMLSerializer.load couldn't raise error when invalid yaml was provided
https://github.com/rubygems/rubygems/commit/cfcfde04c7
2023-04-19 06:56:22 +00:00
Hiroshi SHIBATA ef54a9aeb6 [rubygems/rubygems] Introduce self.load_with_rubygems_config_hash
https://github.com/rubygems/rubygems/commit/9175b8cf2a
2023-04-19 06:56:21 +00:00
Hiroshi SHIBATA 644d7df021 [rubygems/rubygems] Introduce self.dump_with_rubygems_yaml
https://github.com/rubygems/rubygems/commit/3d3b0d80a1
2023-04-19 06:56:21 +00:00
Hiroshi SHIBATA 45655089da [rubygems/rubygems] Removed trailing-slash for domain
https://github.com/rubygems/rubygems/commit/81ba58f445
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA cdc2e3de10 [rubygems/rubygems] Wrap self.convert_rubygems_config_hash from Bundler::YAMLSerializer.load
https://github.com/rubygems/rubygems/commit/080880ac23
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA 7b959f6288 [rubygems/rubygems] Move all changes only in RubyGems
https://github.com/rubygems/rubygems/commit/d842e2092f
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA 30b3290f26 [rubygems/rubygems] Added guard condition for replacing __ variable in YAML keys
https://github.com/rubygems/rubygems/commit/e7d31405ea
2023-04-19 06:56:19 +00:00
Hiroshi SHIBATA bf8d8ce1ee [rubygems/rubygems] Keep compatiblity of Bundler specs
https://github.com/rubygems/rubygems/commit/b211eeacba
2023-04-19 06:56:18 +00:00
Hiroshi SHIBATA 364c2fea34 [rubygems/rubygems] Replaced empty hash to nil value in YAML
https://github.com/rubygems/rubygems/commit/8771fbf53d
2023-04-19 06:56:17 +00:00
Hiroshi SHIBATA 7e537e9613 [rubygems/rubygems] Only convert old URL key name when it's contained double underscore
https://github.com/rubygems/rubygems/commit/a4bfa2ef94
2023-04-19 06:56:17 +00:00
Hiroshi SHIBATA e684eb9e61 [rubygems/rubygems] Added missing require for Bundler::YAMLSerializer
https://github.com/rubygems/rubygems/commit/55ef32fdd7
2023-04-19 06:56:16 +00:00
Hiroshi SHIBATA 9365492f63 [rubygems/rubygems] Fix regexp for Symbol
https://github.com/rubygems/rubygems/commit/9a3ed682a0
2023-04-19 06:56:16 +00:00
Hiroshi SHIBATA 1225eff38f [rubygems/rubygems] Don't use Psych
https://github.com/rubygems/rubygems/commit/d6555aaa28
2023-04-19 06:56:15 +00:00
Hiroshi SHIBATA 038c6e773f [rubygems/rubygems] Added explicitly loading for Gem::SafeYAML
https://github.com/rubygems/rubygems/commit/3d9d587dd7
2023-04-19 06:56:15 +00:00
Hiroshi SHIBATA 2c91ec0869 [rubygems/rubygems] We need to convert empty string for nil value
https://github.com/rubygems/rubygems/commit/348c82311f
2023-04-19 06:56:15 +00:00
Hiroshi SHIBATA fd981ebf4c [rubygems/rubygems] Handle Symbol value
https://github.com/rubygems/rubygems/commit/c98677d073
2023-04-19 06:56:14 +00:00
Hiroshi SHIBATA 2014dc5e3a [rubygems/rubygems] Handle Symbol key and Interger and Boolean values
https://github.com/rubygems/rubygems/commit/63efdac045
2023-04-19 06:56:14 +00:00
Hiroshi SHIBATA 6f50ecfe66 [rubygems/rubygems] Try to use pure-ruby YAML serializer for configuration
https://github.com/rubygems/rubygems/commit/3268d40974
2023-04-19 06:56:13 +00:00
Aaron Patterson bdffcd6df3 Update RJIT to support newarray_send
This also adds max / hash support
2023-04-18 17:16:22 -07:00
tomoya ishida 19aa30d5d5 [ruby/reline] Change Reline.add_dialog_proc(name, nil) to properly
remove dialog_proc
(https://github.com/ruby/reline/pull/532)

https://github.com/ruby/reline/commit/43283b2f37
2023-04-15 09:32:05 +00:00
Hiroshi SHIBATA 6beb755d81 [ruby/prettyprint] Expose PrettyPrint::VERSION
https://github.com/ruby/prettyprint/commit/c6f3947e96
2023-04-14 01:52:08 +00:00
Hiroshi SHIBATA 3f8756484f [ruby/pp] Expose PP::VERSION
https://github.com/ruby/pp/commit/3d0e65e79f
2023-04-14 01:49:51 +00:00
Hiroshi SHIBATA 652f273308 [ruby/resolv] Expose Resolv::VERSION
https://github.com/ruby/resolv/commit/6ab2385e89
2023-04-14 01:46:38 +00:00
Hiroshi SHIBATA ebe620def6 [ruby/securerandom] Expose SecureRandom::VERSION
https://github.com/ruby/securerandom/commit/2e6434331d
2023-04-14 01:43:47 +00:00
卜部昌平 64e503eb62 avoid seeding
OpenSSL's man page previously stated that "the application is
responsible for seeding the PRNG by calling RAND_add" (see [1]).
So we had this code.  However things changed.  They no longer
say so, instead "manual (re-)seeding of the default OpenSSL
random generator is not necessary" now (see [2]).  It seems all
OpenSSL versions that we support now already behaves like this.
Let's follow that.

[1]: https://www.openssl.org/docs/man1.0.2/man3/RAND_add.html
[2]: https://www.openssl.org/docs/manmaster/man3/RAND_add.html
2023-04-13 19:50:00 +09:00
Hiroshi SHIBATA f09638fe25 [ruby/time] Expose Time::VERSION
https://github.com/ruby/time/commit/32793b56b7
2023-04-13 18:51:18 +09:00
Hiroshi SHIBATA cf77f7b5e7 [ruby/time] Bump version to 0.2.2
https://github.com/ruby/time/commit/5f080cf700
2023-04-13 18:51:18 +09:00
Hiroshi SHIBATA 8b924ebdf2 [ruby/tempfile] Expose Tempfile::VERSION
https://github.com/ruby/tempfile/commit/6aa1f37dc4
2023-04-13 09:49:14 +00:00
Hiroshi SHIBATA 84d11498c2 [ruby/shellwords] Expose Shellwords::VERSION
https://github.com/ruby/shellwords/commit/e38b8b026a
2023-04-13 09:48:55 +00:00
Hiroshi SHIBATA 61bd69470a [ruby/open-uri] Expose OpenURI::VERSION
https://github.com/ruby/open-uri/commit/666768d960
2023-04-13 09:47:40 +00:00
Hiroshi SHIBATA 76aaaf6434 [ruby/un] Expose UN::VERSION
https://github.com/ruby/un/commit/47bcad1804
2023-04-13 09:47:22 +00:00
John Hawthorn be08e1b14c RJIT: argc check in known cfuncs 2023-04-12 17:48:34 -07:00
Marcin Rozmus c8d8207aea [rubygems/rubygems] Fix broken hyperlinks in bundle cache documentation
https://github.com/rubygems/rubygems/commit/1ff3e7450a
2023-04-12 20:27:39 +00:00
Ashley Ellis Pierce 851344965a
Ensure api_key is sent if basic auth not provided on webauthn_verification_url
Co-authored-by: Jenny Shen <jenny.shen@shopify.com>
2023-04-12 12:00:25 +09:00
Eric Herscovich 1b1485ae4d
Add message for otp bypass
Update tests

Fix wording of message
2023-04-12 11:59:18 +09:00
Jenny Shen b909ca94bd
Terminate interaction after wait for otp thread completes to support jruby 2023-04-12 11:58:03 +09:00
Jenny Shen c7a8d63df8
Terminate interaction when rescuing WebauthnVerificationError during wait_for_otp
Co-authored-by: Betty Li <makewithbetty@gmail.com>
2023-04-12 11:57:43 +09:00
Jenny Shen cd60113faa
Use Webauthn Listener in wait_for_otp 2023-04-12 11:57:15 +09:00
Jenny Shen b6e860ba1b
Add wait for webauthn otp when fetching otp
Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2023-04-12 11:57:11 +09:00
Ashley Ellis Pierce 774d1f1a00
Merge lines 2023-04-12 11:56:33 +09:00
Jenny Shen 096f6eec3e [rubygems/rubygems] Refactor Webauthn listener response - Makes the response class a wrapper around Net::HTTPResponse - Builds a Net::HTTPResponse upon initialization - to_s returns a string representation of the response to send - Adds a Socket Responder class to send responses given a socket
https://github.com/rubygems/rubygems/commit/7513c220b6

Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2023-04-12 11:51:07 +09:00
Jenny Shen ef85b6de42 [rubygems/rubygems] Add access control headers for all requests to allow RubyGems.org to render the response
https://github.com/rubygems/rubygems/commit/22b329eb60
2023-04-12 11:51:06 +09:00
Jenny Shen 353f9adccc [rubygems/rubygems] Add otp command tests
https://github.com/rubygems/rubygems/commit/c494112063
2023-04-12 11:51:05 +09:00
Jenny Shen 6e7bf0677d [rubygems/rubygems] Add WebauthnListener class
https://github.com/rubygems/rubygems/commit/d42ddbb73c

Co-authored-by: Ashley Ellis Pierce <anellis12@gmail.com>
Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2023-04-12 11:51:04 +09:00
Jenny Shen 354a5c646e [rubygems/rubygems] Add WebauthnVerificationError Exception
https://github.com/rubygems/rubygems/commit/932c111f2c
2023-04-12 11:51:03 +09:00
Jenny Shen 332c4b6726 [rubygems/rubygems] Add WebauthnListener response classes
https://github.com/rubygems/rubygems/commit/0e9a26acb1
2023-04-12 11:51:03 +09:00
Ashley Ellis Pierce ea95ec5443 [rubygems/rubygems] Clarify message
https://github.com/rubygems/rubygems/commit/d94173be49
2023-04-12 11:51:02 +09:00
Ashley Ellis Pierce 6275284f02 [rubygems/rubygems] Ask user to otp at webauthn verification url
https://github.com/rubygems/rubygems/commit/004eadb0c5
2023-04-12 11:51:01 +09:00
Hiroshi SHIBATA d89cc317c6
util/rubocop -A --only Style/NumericLiteralPrefix 2023-04-11 19:12:28 +09:00
ima1zumi f7c8d3bf96 [ruby/irb] Bump version to 1.6.4
(https://github.com/ruby/irb/pull/560)

https://github.com/ruby/irb/commit/01328da9b6
2023-04-09 13:44:12 +00:00
Kasumi Hanazuki 957595f218 [ruby/resolv] Do not compress domain name in SRV RDATA
[RFC2782] prohibits use of name compression for the target host name
in the RDATA of a SRV record.

[RFC2782]: https://datatracker.ietf.org/doc/rfc2782/

Closes: https://github.com/ruby/resolv/issues/29

https://github.com/ruby/resolv/commit/ac85724e17
2023-04-08 14:16:59 +00:00
Stan Lo e7f77e1e89 [ruby/irb] Simplify command method definition
(https://github.com/ruby/irb/pull/559)

* Remove unnecessary command argument generation code

Now that all the supported Ruby versions handle splat args and splat kwargs,
we don't need that args generation code anymore.

* Remove unused command definition code

If we look at `@EXTEND_COMMANDS`, all commands are defined in a file, which
means the `if load_file` branch is always executed. Therefore we can drop
the else branch of that condition.

* Avoid defining unnecessary command methods

There's no need to define another command method just to call `Command.execute`.
2023-04-08 10:11:50 +00:00
David Rodríguez 4df7c3946a [rubygems/rubygems] Remove one fallback to full indexes on big gemfiles
If Gemfile has a lot of dependencies, we have an optimization that uses
the full index in that case, assuming it's going to be faster.

I think this is an old optimization that predates compact index API
times, I believe we no longer need it these days.

Also, since a few releases ago we check for circular dependencies when
resolving by looping through all versions of each name and removing
those that have circular dependencies that would trip up the resolver.

This loop becomes actually very slow when full indexes are used because
to find dependencies of a gemspec, we need to explicitly fetch the
marshaled gemspec (`gemspec.rz` endpoint) for it, so the optimization
has the opposite effect of making things very slow.

https://github.com/rubygems/rubygems/commit/2f46289bd3
2023-04-07 13:53:00 +00:00
Hiroshi SHIBATA 250e97c0fb [rubygems/rubygems] util/rubocop -A --only Style/FormatString
https://github.com/rubygems/rubygems/commit/132a56569d
2023-04-07 05:13:05 +00:00
Hiroshi SHIBATA fb822076d7 [rubygems/rubygems] util/rubocop -A --only Style/LineEndConcatenation
https://github.com/rubygems/rubygems/commit/67ece7b8b6
2023-04-06 23:33:20 +00:00
Hiroshi SHIBATA 70371aa071
Revert accidentally commit of wrong file
Revert "[ruby/syntax_suggest] Remove unnecessary `--color` option"

  This reverts commit 588dd44d41.
2023-04-06 16:30:00 +09:00
schneems 7ab640d9dd
v1.0.4 2023-04-06 15:49:26 +09:00
schneems 8d72d6159c
v1.0.3
Fix a CI error and add a test to ensure we're testing the current version:

```
Run bundle exec rake test
bundler: failed to load command: rake (/home/runner/work/syntax_suggest/syntax_suggest/vendor/bundle/ruby/3.2.0/bin/rake)
/opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated syntax_suggest 1.0.2, but your Gemfile requires syntax_suggest 1.0.3. Since syntax_suggest is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports syntax_suggest as a default gem. (Gem::LoadError)
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:25:in `block in setup'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/spec_set.rb:138:in `each'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/spec_set.rb:138:in `each'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:24:in `map'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:24:in `setup'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler.rb:151:in `setup'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/setup.rb:20:in `block in <top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/ui/shell.rb:136:in `with_level'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/ui/shell.rb:88:in `silence'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/setup.rb:20:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/cli/exec.rb:56:in `require_relative'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/cli/exec.rb:56:in `kernel_load'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/cli/exec.rb:23:in `run'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/cli.rb:483:in `exec'
	from /opt/hostedtoolcache/Ruby/3.2.1/x64/lib/ruby/gems/3.2.0/gems/bundler-2.3.14/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
```
2023-04-06 15:47:04 +09:00
Yusuke Endoh d511e6960f [ruby/syntax_suggest] The annotation must end with a new line
syntax_suggest did not work great when there is no new line at the end
of the input file.

Input:
```
def foo
end
end # No newline at end of file
```

Previous output:
```
$ ruby test.rb
test.rb: --> test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
> 1  def foo
> 2  end
> 3  end # No newline at end of filetest.rb:3: syntax error, unexpected `end' (SyntaxError)
end # No newline at end of file
^~~
```

Note that "test.rb:3: ..." is appended to the last line of the
annotation.

This change makes sure that the annotation ends with a new line.

New output:
```
$ ruby test.rb
test.rb: --> test.rb
Unmatched `end', missing keyword (`do', `def`, `if`, etc.) ?
> 1  def foo
> 2  end
> 3  end # No newline at end of file
test.rb:3: syntax error, unexpected `end' (SyntaxError)
end # No newline at end of file
^~~
```

https://github.com/ruby/syntax_suggest/commit/db4cf9147d
2023-04-06 15:45:30 +09:00
schneems 63ea6b0cf2 [ruby/syntax_suggest] Rollback comment indentation behavior
Originally I fixed https://github.com/ruby/syntax_suggest/pull/177 by making the process of comment removal indentation aware. The next commit is the more general fix and means we don't need to carry that additional logic/overhead.

Also: Update syntax via linter
2023-04-06 15:45:29 +09:00
schneems 2acbcec056 [ruby/syntax_suggest] Add comments and refactor AroundBlockScan methods
https://github.com/ruby/syntax_suggest/commit/cecd12292c
2023-04-06 15:45:29 +09:00
schneems 5487ee4fe8 [ruby/syntax_suggest] Fix sibling bug to #177
While #177 is reported as being caused by a comment, the underlying behavior is a problem due to the newline that we generated (from a comment). The prior commit fixed that problem by preserving whitespace before the comment. That guarantees that a block will form there from the frontier before it will be expanded there via a "neighbors" method. Since empty lines are valid ruby code, it will be hidden and be safe.

## Problem setup

This failure mode is not fixed by the prior commit, because the indentation is 0. To provide good results, we must make the algorithm less greedy. One heuristic/signal to follow is developer added newlines. If a developer puts a newline between code, it's more likely they're unrelated. For example:

```
port = rand(1000...9999)
stub_request(:any, "localhost:#{port}")

query = Cutlass::FunctionQuery.new(
  port: port
).call

expect(WebMock).to have_requested(:post, "localhost:#{port}").
  with(body: "{}")
```

This code is split into three chunks by the developer. Each are likely (but not guaranteed) to be intended to stand on their own (in terms of syntax). This behavior is good for scanning neighbors (same indent or higher) within a method, but bad for parsing neighbors across methods.

## Problem

Code is expanded to capture all neighbors, and then it decreases indent level which allows it to capture surrounding scope (think moving from within the method to also capturing the `def/end` definition. Once the indentation level has been increased, we go back to scanning neighbors, but now neighbors also contain keywords.

For example:

```
  1 def bark
  2
  3 end
  4
  5 def sit
  6 end
```

In this case if lines 4, 5, and 6 are in a block when it tries to expand neighbors it will expand up. If it stops after line 2 or 3 it may cause problems since there's a valid kw/end pair, but the block will be checked without it.

TLDR; It's good to stop scanning code after hitting a newline when you're in a method...it causes a problem scanning code between methods when everything inside of one of the methods is an empty line.

In this case it grabs the end on line 3 and since the problem was an extra end, the program now compiles correctly. It incorrectly assumes that the block it captured was causing the problem.

## Extra bit of context

One other technical detail is that after we've decided to stop scanning code for a new neighbor block expansion, we look around the block and grab any empty newlines. Basically adding empty newlines before of after a code block do not affect the parsing of that block.

## The fix

Since we know that this problem only happens when there's a newline inside of a method and we know this particular failure mode is due to having an invalid block (capturing an extra end, but not it's keyword) we have all the metadata we need to detect this scenario and correct it.

We know that the next line above our block must be code or empty (since we grabbed extra newlines). Same for code below it. We can count all the keywords and ends in the block. If they are balanced, it's likely (but not guaranteed) we formed the block correctly. If they're imbalanced, look above or below (depending on the nature of the imbalance), check to see if adding that line would balance the count.

This concept of balance and "leaning" comes from work in https://github.com/ruby/syntax_suggest/pull/152 and has proven useful, but not been formally introduced into the main branch.

## Outcome

Adding this extra check introduced no regressions and fixed the test case. It might be possible there's a mirror or similar problem that we're not handling. That will come out in time. It might also be possible that this causes a worse case in some code not under test. That too would come out in time.

One other possible concern to adding logic in this area (which is a hot codepath), is performance. This extra count check will be performed for every block. In general the two most helpful performance strategies I've found are reducing total number of blocks (therefore reducing overall N internal iterations) and making better matches (the parser to determine if a close block is valid or not is a major bottleneck. If we can split valid code into valid blocks, then it's only evaluated by the parser once, where as invalid code must be continuously re-checked by the parser until it becomes valid, or is determined to be the cause of the core problem.

This extra logic should very rarely result in a change, but when it does it should tend to produce slightly larger blocks (by one line) and more accurate blocks.

Informally it seems to have no impact on performance:

``
This branch:
DEBUG_DISPLAY=1 bundle exec rspec spec/ --format=failures  3.01s user 1.62s system 113% cpu 4.076 total
```

```
On main:
DEBUG_DISPLAY=1 bundle exec rspec spec/ --format=failures  3.02s user 1.64s system 113% cpu 4.098 total
```

https://github.com/ruby/syntax_suggest/commit/13739c6946
2023-04-06 15:45:28 +09:00
schneems e5236471c3 [ruby/syntax_suggest] Preserve whitespace in front of comments
When removing comments I previously replaced them with a newline. This loses some context and may affect the order of the indent search which in turn affects the final result. By preserving whitespace in front of the comment, we preserve the "natural" indentation order of the line while also allowing the parser/lexer to see and join naturally consecutive (method chain) lines.

close https://github.com/ruby/syntax_suggest/pull/177
2023-04-06 15:45:28 +09:00
schneems 33cfd262fc [ruby/syntax_suggest] Handle alias already exists when debugging
When `tmp/alias` already exists, I'm now getting phantom folders in the directory pointing at older aliases which is distracting/confusing. By checking and removing that alias before symlinking we can prevent this strange behavior (possibly caused by newer Mac OS?).
2023-04-06 15:45:27 +09:00
Nobuyoshi Nakada 588dd44d41 [ruby/syntax_suggest] Remove unnecessary `--color` option
It is enabled automatically if possible.  Forcing this option makes
https://github.com/rspec/rspec-core/pull/3017 useless.

https://github.com/ruby/syntax_suggest/commit/8e7141b472
2023-04-06 15:45:27 +09:00
Vít Ondruch 69460791cc
[rubygems/rubygems] Improve comment explaining the neccessity of `write_default_spec` method.
The intention is not obvious from the commit log and it might avoid
temptation to remove the method without further consideration.

https://github.com/rubygems/rubygems/commit/8e17c50f64
2023-04-06 13:07:16 +09:00
David Rodríguez f3d69bed62
[rubygems/rubygems] Fix resolver hangs when dealing with an incomplete lockfile
While working on locking multiple platforms by default, I got an
infinite resolution loop in one of our resolver specs.

The culprit ended up being that when dealing with lockfile specs with
incomplete dependencies (spec appears in lockfile, but its dependencies
don't), those specs were not being properly expired and that tripped up
resolution.

The issue for some reason only manifests when dealing with multiple
lockfile platforms, that's why it only manifested when working on
locking multiple platforms by default.

https://github.com/rubygems/rubygems/commit/4ca72913bb
2023-04-06 13:07:16 +09:00
David Rodríguez c257380965
Revert "Refactor incomplete specs handling"
This reverts commit 69580f8b72f41c58cae57d1ada4db909922b3891.
2023-04-06 13:07:16 +09:00
David Rodríguez 192a3a6bfb
[rubygems/rubygems] Revert "Reuse `SpecSet#materialize` logic"
This reverts commit https://github.com/rubygems/rubygems/commit/a20585b4512d.

https://github.com/rubygems/rubygems/commit/aa9102659e
2023-04-06 13:07:16 +09:00
Stan Lo 2f8e5c80e6 [ruby/irb] Drop Ruby 2.6 support
(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-05 21:40:40 +00:00
Hiroshi SHIBATA e003784fc8 [rubygems/rubygems] util/rubocop -A --only Style/RegexpLiteral
https://github.com/rubygems/rubygems/commit/9264d83421
2023-04-05 09:50:29 +00:00
Takashi Kokubun 65d27d3c0a RJIT: Skip a class guard if known to be T_STRING 2023-04-05 00:46:10 -07:00
Takashi Kokubun 9bef39de74 RJIT: Handle include_all argument of respond_to? 2023-04-05 00:38:38 -07:00
Takashi Kokubun 66fe64b269 RJIT: Remove unused variables 2023-04-04 23:55:19 -07:00
Takashi Kokubun 2ddf6079f1 RJIT: Always use guard_two_fixnums 2023-04-04 23:52:14 -07:00
Takashi Kokubun 4e9c3b4518 RJIT: Eliminate known-result guards for blockarg 2023-04-04 23:42:14 -07:00
Takashi Kokubun 4f77d1cdb8 RJIT: Eliminate known-result branches 2023-04-04 23:30:26 -07:00
Takashi Kokubun e06bebff5e RJIT: Propagate argument types on method calls 2023-04-04 22:13:25 -07:00
Takashi Kokubun 6d8875b5d7 RJIT: Fix mapping offsets in stack_swap 2023-04-04 22:05:45 -07:00
Étienne Barrié 52ff2ce9da
Use `em_delete` in `key_delete` (#504)
* Test existing behavior

Typing Ctrl-D ends editing but typing <Del> does not.

Also renamed a test that is not testing ed_delete_next_char but
key_delete.

* Check if line empty first in em_delete

By distributivity of AND over OR, we can factor out this condition. This
will make the next commit simpler.

* Use em_delete in key_delete

When the editing mode is emacs, use `em_delete` in `key_delete`. We need
to add a condition though to `em_delete`, because it implements both
`delete-char` and `end-of-file`. We only want the `end-of-file` behavior
is the key is really Ctrl-D.

This matches the behavior of the <Del> key with readline, i.e. deleting
the next character if there is one, but not moving the cursor, while not
finishing the editing if there are no characters.
2023-04-05 08:59:12 +09:00
Jeremy Evans bb927acd3b [ruby/optparse] Document requires needed for Date/DateTime/Time/URI/Shellwords support
Fixes [Bug #19566]

https://github.com/ruby/optparse/commit/fb91d97c10
2023-04-04 23:43:58 +00:00
Peter Zhu 1da2e7fca3
[Feature #19579] Remove !USE_RVARGC code (#7655)
Remove !USE_RVARGC code

[Feature #19579]

The Variable Width Allocation feature was turned on by default in Ruby
3.2. Since then, we haven't received bug reports or backports to the
non-Variable Width Allocation code paths, so we assume that nobody is
using it. We also don't plan on maintaining the non-Variable Width
Allocation code, so we are going to remove it.
2023-04-04 17:30:06 -04:00
Hiroshi SHIBATA 06da0d1456 [rubygems/rubygems] util/rubocop -A
https://github.com/rubygems/rubygems/commit/8c9ea5d180
2023-04-04 12:20:43 +00:00
Hiroshi SHIBATA a881b33818 [rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
2023-04-04 12:20:43 +00:00
Takashi Kokubun 51b2f4c0f5 RJIT: Fix the argument of shift_stack 2023-04-04 01:17:23 -07:00
Takashi Kokubun 98f0e2c330 RJIT: Fix the argument for defined 2023-04-04 00:41:58 -07:00
Takashi Kokubun 19506650ef RJIT: Add --rjit-verify-ctx option 2023-04-04 00:35:29 -07:00
Takashi Kokubun 2c560b976e RJIT: Fix arguments to SPECIAL_CONST_P 2023-04-04 00:30:57 -07:00
Takashi Kokubun 6a4087702b RJIT: Update type information on setlocal 2023-04-03 22:42:21 -07:00
Takashi Kokubun 6ab86e4626 RJIT: Fix arguments for shift_stack 2023-04-03 21:26:40 -07:00
Takashi Kokubun 3cb5e7558d Fix a test_rubyoptions failure 2023-04-03 08:44:16 -07:00
Takashi Kokubun 46e93ef53d RJIT: Propagate self's type information 2023-04-03 00:49:10 -07:00
Takashi Kokubun ca8102355a RJIT: Upgrade type on jit_guard_known_class 2023-04-03 00:39:29 -07:00
Takashi Kokubun 1d452c2cf8 RJIT: Upgrade type to Fixnum after guard 2023-04-03 00:02:45 -07:00
Takashi Kokubun 0abe9d8b32 RJIT: Upgrade type to String after guard 2023-04-02 23:54:08 -07:00
Takashi Kokubun f0b69eb14f RJIT: Upgrade type to Array after guard 2023-04-02 23:49:55 -07:00
Takashi Kokubun d876c008ec RJIT: Limit the number of versions per block 2023-04-02 23:37:15 -07:00
Takashi Kokubun 3bacc3877a RJIT: Find a best matching block version 2023-04-02 23:24:14 -07:00
Takashi Kokubun eb51248c4c RJIT: Upgrade type to UnknownHeap after guard 2023-04-02 23:11:18 -07:00
Takashi Kokubun be4e16bc1a RJIT: Update type information on setn insn 2023-04-02 23:07:58 -07:00
Takashi Kokubun 50285d2864 RJIT: Swap type information on swap insn 2023-04-02 23:06:30 -07:00
git 0276c1d935 * remove trailing spaces. [ci skip] 2023-04-03 05:32:32 +00:00
Takashi Kokubun d546f8c518 RJIT: Store type information in Context 2023-04-02 22:32:16 -07:00
Hiroshi SHIBATA 6fb6d85aee [ruby/fileutils] Bump up v1.7.1
https://github.com/ruby/fileutils/commit/7138d85156
2023-04-03 05:19:00 +00:00
Hiroshi SHIBATA 27f709aa3c
Rename YAML::VERSION. It's conflict with Psych::VERSION 2023-04-03 12:43:11 +09:00
Hiroshi SHIBATA b5c8c73f66
Fixed version detection paths in ruby repository 2023-04-03 12:00:59 +09:00
Hiroshi SHIBATA 14f442a958 [ruby/base64] Expose Base64::VERSION
https://github.com/ruby/base64/commit/dda85a0839
2023-04-03 02:45:42 +00:00
Hiroshi SHIBATA ba4f01f0a0 [ruby/yaml] Expose YAML::VERSION
https://github.com/ruby/yaml/commit/8776bc2634
2023-04-03 02:45:18 +00:00
Hiroshi SHIBATA 6dcd399976 [ruby/tsort] Expose TSort::VERSION
https://github.com/ruby/tsort/commit/09f2275958
2023-04-03 02:41:44 +00:00
Hiroshi SHIBATA a70653ca7f [ruby/find] Expose Find::VERSION
https://github.com/ruby/find/commit/a24124a08a
2023-04-03 02:40:37 +00:00
Takashi Kokubun 8968b47ba8 RJIT: Refactor getlocal and setlocal 2023-04-02 16:50:54 -07:00
Takashi Kokubun 6002b12611 RJIT: Support entry with different PCs 2023-04-02 15:27:40 -07:00
Takashi Kokubun 4fc336127e RJIT: Support has_opt ISEQs 2023-04-02 14:47:23 -07:00
Takashi Kokubun ad2b719fc2 RJIT: C::FL_TEST_RAW returns RBOOL 2023-04-02 14:32:51 -07:00
Takashi Kokubun 57ee627929 RJIT: Lazily guard block arg
to simplify the implementation
2023-04-02 14:22:42 -07:00
Takashi Kokubun 66f8efc342 RJIT: Simplify cfunc implementation 2023-04-02 13:58:39 -07:00
Takashi Kokubun 284a0ff96c RJIT: Remove an unneeded branch 2023-04-02 12:28:49 -07:00
Takashi Kokubun 3fe134759c Skip assert_linear_performance for RJIT 2023-04-02 12:23:23 -07:00
Takashi Kokubun bf7587748d RJIT: Simplify invokesuper implementation 2023-04-02 11:42:16 -07:00
Takashi Kokubun 5cc644b147 RJIT: Group blockarg exit reasons 2023-04-02 11:01:23 -07:00
Takashi Kokubun cd1cd8030c RJIT: Support splat args 2023-04-02 10:55:03 -07:00
Takashi Kokubun 6f2535deda RJIT: Prefix a constant with C namespace 2023-04-02 10:40:37 -07:00
Takashi Kokubun 7778c292c4 RJIT: Support keyword arguments 2023-04-02 10:26:22 -07:00
Stan Lo cd94bcdc46 [ruby/irb] Don't check RUBY_ENGINE when deciding whether to accept kargs
Ruby implementations like JRuby and TruffleRuby already indicate their
compatibility target with RUBY_VERSION. We don't need to exclude
them from accepting keyword arguments as long as they target 2.7+.

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

Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
2023-04-02 15:34:28 +00:00
Stan Lo f25791884c [ruby/irb] Remove dead code (https://github.com/ruby/irb/pull/554)
* Remove unused ATTR_TTY and ATTR_PLAIN constants

They were added in d7d26b51bf

But the references were removed in 1c76845cca

Co-authored-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>

* Remove unused MethodExtender module

It was added in 6cc5d718d7
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 aaf4eb4e98

Co-authored-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>

* Remove unused InputCompletor.ignored_modules

It was added in 88311ce3c8
but the reference was removed in 78c74d2425

* Remove unused TracerLoadError constant

This constant was added in cb50fa3738
but never referenced.

---------

https://github.com/ruby/irb/commit/7de0234325

Co-authored-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
2023-04-02 14:11:12 +00:00
Takashi Kokubun 1b475fcd10 Remove an unneeded function copy 2023-04-01 23:09:05 -07:00
Takashi Kokubun a077b7e36b RJIT: Support rest args 2023-04-01 23:00:36 -07:00
Takashi Kokubun 87dc06ed24 RJIT: Comment a location for each block 2023-04-01 22:39:16 -07:00
Takashi Kokubun bf2617b8a6 RJIT: Fix has_rest exit conditions 2023-04-01 21:47:28 -07:00
Takashi Kokubun ee52255f93 RJIT: Return CantCompile early for arg0 splat 2023-04-01 21:42:34 -07:00
Takashi Kokubun 2ce5cfa2be RJIT: Save PC on String#concat 2023-04-01 21:34:19 -07:00
Takashi Kokubun e45ed2da50 RJIT: Rewind stack_size on CantCompile and side exits
so that we can take an exit whenever we want.

As a starter, this commit also pops blockarg earlier than some
CantCompile exits.
2023-04-01 21:30:42 -07:00
Takashi Kokubun 90cdc5b8ba RJIT: Let the caller of jit_push_frame handle stack_pop
because we want to do this way earlier for other types of calls.
2023-04-01 21:13:15 -07:00
Takashi Kokubun 28db75af66 RJIT: Check stackoverflow earlier for ISEQ 2023-04-01 21:03:10 -07:00
Takashi Kokubun 249fe18e8f RJIT: Remove unused counters 2023-04-01 17:24:45 -07:00
Takashi Kokubun f42cf3fd1e RJIT: Migrate invokeblock to jit_call_iseq 2023-04-01 17:17:41 -07:00
Takashi Kokubun cfea319772 RJIT: Migrate bmethod to jit_call_iseq 2023-04-01 17:03:45 -07:00
Takashi Kokubun 0973b93e49 RJIT: Start moving away from VM-like ISEQ handling 2023-04-01 16:56:05 -07:00
Hiroshi SHIBATA bc0a7a641b [ruby/net-http] typofix
https://github.com/ruby/net-http/commit/4d31bde125
2023-03-31 03:47:56 +00:00
NAKAMURA Usaku eedcd696a5 [ruby/net-http] Fix previous commit
https://github.com/ruby/net-http/commit/1b276e2654
2023-03-31 03:22:41 +00:00
NAKAMURA Usaku d8b8294c28 [ruby/net-http] Limit header length
https://github.com/ruby/net-http/commit/c245f7f9c8
2023-03-31 03:22:40 +00:00
Nobuyoshi Nakada cd65e4adca [ruby/rdoc] Use `File.binread`
https://github.com/ruby/rdoc/commit/987c609df9
2023-03-31 01:14:34 +00:00
Nobuyoshi Nakada cbfd029985 [ruby/time] Make RFC2822 regexp linear
https://hackerone.com/reports/1485501

https://github.com/ruby/time/commit/51034bda4c
2023-03-30 10:44:39 +00:00
Nobuyoshi Nakada aa3885501f [ruby/time] Fix quadratic backtracking on invalid time
https://hackerone.com/reports/1485501

https://github.com/ruby/time/commit/2444456fc1
2023-03-30 10:44:38 +00:00
Stan Lo b168141c78 [ruby/reline] Drop Dialog#scrollbar_pos as we can store it in a
local variable
(https://github.com/ruby/reline/pull/529)

https://github.com/ruby/reline/commit/d0139975fd

Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>
2023-03-29 13:51:27 +00:00
Stan Lo 02ecdf85c5 [ruby/reline] Drop Unicode.take_range's optional arg as it's never
used
(https://github.com/ruby/reline/pull/528)

https://github.com/ruby/reline/commit/428fed4a6a
2023-03-29 10:20:29 +00:00
Takashi Kokubun 9a1f6975c5 RJIT: Propagate a set of args as a CallingInfo 2023-03-29 00:44:31 -07:00
tomoya ishida e26908dc4b [ruby/reline] Improve OSC sequence regexp. OSC sequence can end with
ST(ESC\) and it should not to include \a and \e inside.
(https://github.com/ruby/reline/pull/527)

https://github.com/ruby/reline/commit/a88052adec
2023-03-29 06:54:08 +00:00
Stan Lo 1e9a218ade [ruby/reline] Expand the scanned array to later case statement more
straightforward
(https://github.com/ruby/reline/pull/526)

* Improve test coverage on Unicode.take_range

* Add test for Unicode.calculate_width

* Expand the scanned array to later case statement more straightforward
2023-03-28 12:49:49 +00:00
Hiroshi SHIBATA d766d5346b [rubygems/rubygems] Partly reverted
https://github.com/rubygems/rubygems/pull/6541

https://github.com/rubygems/rubygems/commit/21e07a04a1
2023-03-28 07:26:46 +00:00
Hiroshi SHIBATA 80be2e6c9a
Use URI-0.12.1 2023-03-28 15:27:58 +09:00
Josef Šimánek 1cbb501127
Onboard Rubocop Naming/MemoizedInstanceVariableName rule to RubyGems. 2023-03-28 15:27:35 +09:00
Hiroshi SHIBATA cd4b4ac737 [rubygems/rubygems] Use double-quotes instead of single-quotes in warnings
https://github.com/rubygems/rubygems/commit/c7f1cb9941
2023-03-28 15:25:45 +09:00
Josef Šimánek 9cfd8330ca [rubygems/rubygems] Onboard Rubocop Naming/MemoizedInstanceVariableName rule to Bundler.
https://github.com/rubygems/rubygems/commit/d768be0c65
2023-03-28 15:25:44 +09:00
David Rodríguez 4d4743f7e3 [rubygems/rubygems] Fix installing plugins in frozen mode
Plugins don't use a lockfile, so ignore frozen related settings.

https://github.com/rubygems/rubygems/commit/f17a3bb81f
2023-03-28 15:25:42 +09:00
David Rodríguez 674c960513 [rubygems/rubygems] Fix incorrect removal of "ruby" platform from lockfile
When dependencies have changed, we'll be re-resolving, and we can't
really know whether the resolution will be valid or invalid for the Ruby
platform, so skip the removal in that case.

The fix worked, but made some other specs fail, and surfaced that the
`@dependencies_changed` attribute was actually being incorrect set when
explicitly unlocking. Fixed that with an early return.

https://github.com/rubygems/rubygems/commit/20d8f5e5d9
2023-03-28 15:25:42 +09:00
David Rodríguez ed868f9a71 [rubygems/rubygems] Fix unnecessary downgrade of top level dependency when unlocking
Bundler is very conservative by default, trying to preserve versions
from the lockfile as possible, and never downgrading them. However, when
it runs into a resolution error, it still tries to find a valid
resolution.

This fallback behavior was too "brute-force" though, completely
unrestricting any gem found in the resolution conflict, and that could
lead to direct dependencies being downgraded in some edge cases.

Instead, unlock things a bit more carefully:

* First try unlocking fully pinned indirect dependencies, but leave a
  lower bound requirement in place to prevent downgrades.
* Then try unlocking any fully pinned dependency, also leaving a lower
  bound requirement in place.
* Finally completely unrestrict dependencies if nothing else worked.

https://github.com/rubygems/rubygems/commit/7f55ed8302
2023-03-28 15:25:41 +09:00
David Rodríguez eaddd386ec [rubygems/rubygems] Also set min locked requirements when not unlocking
https://github.com/rubygems/rubygems/commit/3561ac23d6
2023-03-28 15:25:40 +09:00
Takashi Kokubun 7600e6bc19 RJIT: Optimize definedivar using shapes 2023-03-27 21:56:39 -07:00
Hiroshi SHIBATA 120d8d0ae2 [ruby/uri] Bump version to 0.12.1
https://github.com/ruby/uri/commit/5c4f7d04bf
2023-03-28 02:12:22 +00:00
Nobuyoshi Nakada 23f4904f4e [ruby/uri] Fix quadratic backtracking on invalid URI
https://hackerone.com/reports/1444501

https://github.com/ruby/uri/commit/2f9585de17
2023-03-28 02:12:22 +00:00
Michael Siegfried 67f37b010a Consider prereleases regardless of whether locked
Prereleases are NOT considered even when the dependency specification
includes a prerelease segment, if the dependency is not locked. To me
that doesn't make sense, because I could create a Gemfile with say gem
"rails", ">= 7.0.0.beta1" and I'd expect prereleases considered there
even if there's no lock file yet.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2023-03-28 01:18:50 +00:00
ima1zumi ec14b381c1 [ruby/reline] Bump version to 0.3.3
(https://github.com/ruby/reline/pull/525)

https://github.com/ruby/reline/commit/8ce176271f
2023-03-27 15:14:56 +00:00
tomoya ishida 8f569d41cb [ruby/reline] Fix cursor position overrun
(https://github.com/ruby/reline/pull/515)

* Fix cursor position overrun

* Remove unnecessary local variable

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

https://github.com/ruby/reline/commit/d4ad9b96c8

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-03-27 13:57:16 +00:00
Hiroshi SHIBATA 36254c5ddf [rubygems/rubygems] Use append_cflags instead of directly append for CFLAGS
https://github.com/rubygems/rubygems/commit/61ec0c8389
2023-03-27 09:47:20 +00:00
Takashi Kokubun 3352e76441 RJIT: Implement leaf builtin call 2023-03-26 19:25:17 -07:00
Takashi Kokubun ff44e32f92 RJIT: Store caller sp after stack overflow check
and share some code between ISEQ and C calls.
2023-03-26 18:32:01 -07:00
Takashi Kokubun dc270fc632 RJIT: Implement attr_writer 2023-03-26 18:02:25 -07:00
Takashi Kokubun ddb77dd11e RJIT: Put a guard for splat w/ var-arg cfunc 2023-03-25 22:14:07 -07:00
Takashi Kokubun a624a5d709 RJIT: Scope down send_iseq_complex_has_block exit 2023-03-25 21:57:04 -07:00
Takashi Kokubun 1396b83153 RJIT: Fix jit_array_ptr
array_reg was clobbered before being used by heap_ptr_opnd.
heap_ptr_opnd should be loaded before array_reg is clobbered.
2023-03-25 21:43:15 -07:00
tomoya ishida 60ca800d4f [ruby/reline] Fix split_by_width to retain color sequences
(https://github.com/ruby/reline/pull/490)

* Fix split_by_width to retain color sequences

* Add OSC escape sequence testcase of Reline::Unicode.split_by_width
2023-03-25 15:01:35 +00:00
Takashi Kokubun 9bc2dbd33c RJIT: Support optional params on splat 2023-03-25 01:17:05 -07:00
Takashi Kokubun 85a55d3e75 RJIT: Remove send_iseq_complex_splat exit 2023-03-25 00:59:47 -07:00
Takashi Kokubun 314c7dd6d1 RJIT: Support splat for cfunc 2023-03-25 00:52:07 -07:00
Takashi Kokubun 1dd65f7c55 RJIT: Initial support of splat 2023-03-25 00:31:11 -07:00
Jean Boussier 276f4be96d [rubygems/rubygems] Generate native gems with `-fvisibility=hidden`
I recently ran into very nasty issues with dynamic symbols clashing between
two native gems.

I believe the overwhelming majority of native gems don't want to export
their symbols, so hidding them by default would make sense to me.

https://github.com/rubygems/rubygems/commit/449624aa54
2023-03-25 00:31:46 +00:00
Nobuyoshi Nakada 310af50c3b [ruby/time] Update required ruby version
`Regexp#match?` which is introduced at ruby 2.4 is used since https://github.com/ruby/time/pull/1852.

https://github.com/ruby/time/commit/b0a965dcaa
2023-03-23 11:45:58 +00:00
David Rodríguez a9146bd81e Don't suggest `--full-index` on API Response mismatch errors
I've never seen this error in real life, and if it was happening, I
think it's either some server side issue that would need to be fixed or
some transient issue. We should move away from the full index, since
it's slow, so let's stop recommending it.
2023-03-23 17:18:49 +09:00
David Rodríguez c3fa6679e6 Don't suggest retrying with `--full-index` on gemspec errors
We're actually already using the full index here, so it makes no sense
to suggest retrying the same thing.
2023-03-23 17:18:49 +09:00
David Rodríguez 164dc58008 Fix logging the fallback to the full index on GemspecError's
The debug message suggests retrying using `--full-index`, but the retry
is happening automatically. Just log that we are falling back to the
full index, like we do with other errors.
2023-03-23 17:18:49 +09:00
Mau Magnaguagno 069640d355 Avoid intermediate array in TarHeader#calculate_checksum
String#sum(0) sums the character bytes without a modulo.
Follow-up of #6476 based on comment from @nobu.
2023-03-23 17:18:49 +09:00
David Rodríguez a9fd1860dd Fix flaky when making materialized specs uniq
Sometimes we'll have an heterogenous array of specs which include
`Gem::Specification` objects, which don't define `#identifier`. Let's
use `#full_name` consistently.
2023-03-23 17:18:49 +09:00
なつき 1b408e659a Refactor and fix usage of Gem.ruby 2023-03-23 17:18:49 +09:00
なつき 22d037f4cc Move duplicated logic to parent class 2023-03-23 17:18:49 +09:00
なつき e46d473396 Make sure native extensions are loaded correctly in ext_conf builder 2023-03-23 17:18:49 +09:00
なつき f8ecf145ce Make sure native extensions are loaded correctly in rake builder 2023-03-23 17:18:49 +09:00
David Rodríguez a757e21bc0 Reuse `SpecSet#materialize` logic 2023-03-23 17:18:49 +09:00
David Rodríguez ebebc90ec2 Refactor incomplete specs handling
Recent bugs fixed made me realize we were relying on state too much
here. We only need to keep incomplete specs to be able to expire them
and retry resolution without them locked. If we use a separate class, we
can do that more transparently and handle them just like we handle
"missing specs".
2023-03-23 17:18:49 +09:00
David Rodríguez 8e6bbc032c Don't remove RUBY platform when healing a lockfile with missing specs 2023-03-23 17:18:49 +09:00
David Rodríguez 4e7c39f98c Don't remove RUBY platform when healing a lockfile with missing specs 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA acf12b6dfd util/rubocop -A --only Style/AsciiComments 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA f24a86d83f util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 4dd418f877 util/rubocop -A --only Style/FrozenStringLiteralComment 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 50a03035ee util/rubocop -A --only Lint/NonLocalExitFromIterator 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 2e3cd1dc3e [rubygems/rubygems] Enabled Style/RedundantReturn cop
https://github.com/rubygems/rubygems/commit/05cc97bdf8
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA a3670249fa [rubygems/rubygems] util/rubocop -A --only Lint/Void
https://github.com/rubygems/rubygems/commit/9d25906e44
2023-03-23 17:18:49 +09:00