Commit graph

12164 commits

Author SHA1 Message Date
Nobuyoshi Nakada
e47aa27dc7 [ruby/rdoc] Section may not have label
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

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

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

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

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.

4a54767a3e
2023-04-25 14:43:06 +09:00
Akinori MUSHA
ed887cbb4c [ruby/set] Update lib/set.rb
bc59f85f2f
2023-04-25 01:58:12 +00:00
Hiroshi SHIBATA
15796ae1e8 [ruby/set] Expose Set::VERSION
d39b33f463
2023-04-25 01:58:12 +00:00
Akinori MUSHA
c301ba0a66 [ruby/abbrev] Update lib/abbrev.rb
6fa790eac1
2023-04-25 01:55:57 +00:00
Hiroshi SHIBATA
8b9b075b83 [ruby/abbrev] Expose Abbrev::VERSION
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)

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)
2f567f3d3e
2023-04-23 18:41:40 +00:00
Hiroshi SHIBATA
94a418d0bb [ruby/rinda] Expose Rinda::VERSION
fa3865ac48
2023-04-21 06:22:52 +00:00
Hiroshi SHIBATA
ce38ad6963 [rubygems/rubygems] util/rubocop -A
784e5e2fe5
2023-04-20 01:57:17 +00:00
Hiroshi SHIBATA
b42f0094ce [rubygems/rubygems] Support Symbol and URL keys
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'
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
5351e01b32
2023-04-19 06:56:24 +00:00
Hiroshi SHIBATA
40d1a00040 [rubygems/rubygems] Copy YAMLSerializer from Bundler
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
cfcfde04c7
2023-04-19 06:56:22 +00:00
Hiroshi SHIBATA
ef54a9aeb6 [rubygems/rubygems] Introduce self.load_with_rubygems_config_hash
9175b8cf2a
2023-04-19 06:56:21 +00:00
Hiroshi SHIBATA
644d7df021 [rubygems/rubygems] Introduce self.dump_with_rubygems_yaml
3d3b0d80a1
2023-04-19 06:56:21 +00:00
Hiroshi SHIBATA
45655089da [rubygems/rubygems] Removed trailing-slash for domain
81ba58f445
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA
cdc2e3de10 [rubygems/rubygems] Wrap self.convert_rubygems_config_hash from Bundler::YAMLSerializer.load
080880ac23
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA
7b959f6288 [rubygems/rubygems] Move all changes only in RubyGems
d842e2092f
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA
30b3290f26 [rubygems/rubygems] Added guard condition for replacing __ variable in YAML keys
e7d31405ea
2023-04-19 06:56:19 +00:00
Hiroshi SHIBATA
bf8d8ce1ee [rubygems/rubygems] Keep compatiblity of Bundler specs
b211eeacba
2023-04-19 06:56:18 +00:00
Hiroshi SHIBATA
364c2fea34 [rubygems/rubygems] Replaced empty hash to nil value in YAML
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
a4bfa2ef94
2023-04-19 06:56:17 +00:00
Hiroshi SHIBATA
e684eb9e61 [rubygems/rubygems] Added missing require for Bundler::YAMLSerializer
55ef32fdd7
2023-04-19 06:56:16 +00:00
Hiroshi SHIBATA
9365492f63 [rubygems/rubygems] Fix regexp for Symbol
9a3ed682a0
2023-04-19 06:56:16 +00:00
Hiroshi SHIBATA
1225eff38f [rubygems/rubygems] Don't use Psych
d6555aaa28
2023-04-19 06:56:15 +00:00
Hiroshi SHIBATA
038c6e773f [rubygems/rubygems] Added explicitly loading for Gem::SafeYAML
3d9d587dd7
2023-04-19 06:56:15 +00:00
Hiroshi SHIBATA
2c91ec0869 [rubygems/rubygems] We need to convert empty string for nil value
348c82311f
2023-04-19 06:56:15 +00:00
Hiroshi SHIBATA
fd981ebf4c [rubygems/rubygems] Handle Symbol value
c98677d073
2023-04-19 06:56:14 +00:00
Hiroshi SHIBATA
2014dc5e3a [rubygems/rubygems] Handle Symbol key and Interger and Boolean values
63efdac045
2023-04-19 06:56:14 +00:00
Hiroshi SHIBATA
6f50ecfe66 [rubygems/rubygems] Try to use pure-ruby YAML serializer for configuration
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)

43283b2f37
2023-04-15 09:32:05 +00:00