Commit graph

14659 commits

Author SHA1 Message Date
ima1zumi
519a945efc [ruby/reline] Execute compress_meta_key if convert_meta is on
fix `#357`

When using 8-bit characters, it is better not to use `compress_meta_key`.
I believe not to use `compress_meta_key` unless `set convert-meta on` is written in the `.inputrc`.

The following is a quote from tmtm's comments.

> The behavior of this compress_meta_key method is similar to the behavior of convert-meta=on in readline, but readline turns off convert-meta if the locale contains 8bit characters.

> In readline(3):

> convert-meta (On)
> If set to On, readline will convert characters with the eighth
> bit set to an ASCII key sequence by stripping the eighth bit and
> prefixing it with an escape character (in effect, using escape
> as the meta prefix). The default is On, but readline will set
> it to Off if the locale contains eight-bit characters.

9491cc8542

Co-authored-by: TOMITA Masahiro <tommy@tmtm.org>
2021-12-10 22:19:14 +09:00
YO4
3a2ae5bb19 [ruby/reline] unleash real pasting speed
2700msec -> 410msec

read 80 console inputs at once

eb3ef7af98
2021-12-10 22:18:26 +09:00
YO4
74765a5a36 [ruby/reline] unleash pasting speed
074e407c62
2021-12-10 22:18:25 +09:00
YO4
aed21d6574 [ruby/reline] support input surrogate paird codepoint
support surrogate pair input

0b4acedc6a
2021-12-10 22:16:46 +09:00
YO4
66e14e2076 [ruby/reline] follow consolemode change
fix 'https://github.com/ruby/reline/issues/300'

b2cc6805a8
2021-12-10 22:15:56 +09:00
Kevin Logan
eb2d3c19fe [rubygems/rubygems] Properly fetch Gem#latest_spec_for with multiple sources
a93ec63df3
2021-12-10 20:54:29 +09:00
David Rodríguez
0e60bc118b [rubygems/rubygems] Ignore dependencies not actually locked from frozen check
Only needed if there can be no explicit global source (bundler < 3).

73923f4af5
2021-12-10 19:09:55 +09:00
Nobuyoshi Nakada
30268d1de6
Prefer flat_map 2021-12-10 18:39:48 +09:00
Nobuyoshi Nakada
12a0a89e22 [ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190]
1e57277b9e
2021-12-09 20:26:44 +09:00
Hiroshi SHIBATA
4258c8df86
Fixed filename for Open3::VERSION 2021-12-09 19:48:22 +09:00
Hiroshi SHIBATA
d74fe2061d
Adjust gemspec location of default gems 2021-12-09 19:28:55 +09:00
Hiroshi SHIBATA
f5d80c26d4
Removed JRuby specific helper for open3 2021-12-09 19:28:54 +09:00
Charles Oliver Nutter
eb06b37c46
[ruby/open3] Update to match JRuby 9.4
This allows the wrapper functions in the main open3 to be defined
while using our ProcessBuilder logic for the internal popen
implementation.

Note this adds logic to reject redirects from a numeric fd to a
live IO object (or not a String or to_path object) since we cannot
support direct IO redirects with ProcesBuilder.

This patch allows tests to complete with the ProcessBuilder impl.
Only three tests fail:

* test_numeric_file_descriptor2 and test_numeric_file_descriptor2
  fail due to redirecting streams to a pipe IO.
* test_pid fails expecting a real PID which we cannot provide via
  ProcessBuilder.

73f986c233
2021-12-09 19:28:54 +09:00
Charles Oliver Nutter
01febcab3e
[ruby/open3] Add JRuby's Windows (JDK non-native) Open3 support
This adds JRuby's logic used on platforms where we do not have
native access to posix_spawn and related posix functions needed
to do fully-native subprocess launching and management. The code
here instead uses the JDK ProcessBuilder logic to simulate most
of the Open3 functionality.

This code does not pass all tests, currently, but provides most of
the key functionality on pure-Java (i.e. no native FFI) platforms.

689da19c42
2021-12-09 19:28:54 +09:00
Olle Jonsson
d150b8d06f
[ruby/open-uri] gemspec: This gem exposes 0 executables
This just makes that fact more explicit.

ffbfba5d69
2021-12-09 19:28:54 +09:00
Olle Jonsson
dd8b9c1d03
[ruby/English] gemspec: Remove unused "executables" configuration
This gem exposes no executables.

bb1ce0af20
2021-12-09 19:28:53 +09:00
aycabta
2e50989ad3 [ruby/rdoc] Resolve class and method of the same name correctly
1e16284fe5
2021-12-09 18:16:05 +09:00
Marc-André Lafortune
c47e821b89 [ruby/ostruct] Bump version to 0.5.2 2021-12-08 14:47:46 -05:00
Koichi Sasada
9c26931635 [ruby/ostruct] Proc's self should be shareable.
To fix the issue https://bugs.ruby-lang.org/issues/18243
we need to make sure the Proc's self is shareable.
These procs are used by `define_method` and it doesn't use
Proc's self, so `nil` is enough.
2021-12-08 14:47:46 -05:00
David Rodríguez
852ea1e893 [rubygems/rubygems] Remove unnecessary comment
5e50f12e7a
2021-12-08 07:59:35 +09:00
David Rodríguez
76cad13759 [rubygems/rubygems] Don't add custom github source to bundle init Gemfile
It's provided by bundler.

25ccaab46b
2021-12-08 07:59:34 +09:00
David Rodríguez
f0ef9ffed1 [rubygems/rubygems] Cancel deprecation of custom git sources
99cd6e0627
2021-12-08 07:59:34 +09:00
Simon Fish
1b12ebb94e [rubygems/rubygems] Add require parameter to bundle add`
Test and ensure "false" is handled

Don't use yield_self to operate on autorequire

Remove duplicate autorequire

Add banner to require option

Don't use json to break down require params

Pass linter

a4f2f8ac17
2021-12-08 01:49:20 +09:00
David Rodríguez
26303c31f0 [rubygems/rubygems] Pass "--" to git commands to separate positional and optional args
To make sure git uri's specified in Gemfile are never misinterpreted as
optional arguments, potentially allowing for local code execution.

90b1ed8b9f
2021-12-07 23:27:59 +09:00
Marc-André Lafortune
ad4ac68c7b [ruby/ostruct] ostruct v0.5.1 2021-12-06 23:21:24 -05:00
Marc-André Lafortune
95d9bcf2b2 [ruby/ostruct] Alias less methods
Skips methods that do not end with letter (in particular `!~` and `=~`)
For JRuby, also skip `instance_exec`, `instance_eval` and `eval`
2021-12-06 23:21:07 -05:00
David Rodríguez
526c9359ca [rubygems/rubygems] Don't cleanup paths from gems already activated from $LOAD_PATH
This way, if some default gem has been required before bundler, and
rubygems has enhanced the `$LOAD_PATH` to use the latest version in the
system, further requires of that default gem after bundler has been
activated will use the same version and don't cause redefinition
warnings or worse problems derived from the fact of mixing up two
different versions. That, unless the gem is a `Gemfile` dependency. In
that case, we'll get a mismatch error anyways as we do now.

This fix doesn't mean that all default gems internally used by
bundler/rubygems are now supported inside `Gemfile`'s. That should be
handled case by case, but it will now bite people only when they try to
add the gem to their `Gemfile`, not before.

7325530547
2021-12-07 01:53:39 +09:00
Jean Boussier
715a51a0d6 [rubygems/rubygems] Feature: accept pull request URLs as github source
Very often github source is used to temporarily use a modified gem
while a PR upstream is being reviewed.

So for instance https://github.com/ruby/bigdecimal/pull/211 will look like:

```ruby
gem "bigdecimal", github: "casperisfine/bigdecimal", branch: "git-gem" # https://github.com/ruby/bigdecimal/pull/200
```

It's annoying because you have to fiddle with the branch name, which is copied as `casperisfine:git-gem`, etc etc.

If I could simply use the PR URL like this:

```
gem "bigdecimal", github: "https://github.com/ruby/bigdecimal/pull/211"
```

It would make a very common task for me so much simpler.

517c527751
2021-12-06 20:27:29 +09:00
David Rodríguez
d044ffd77f [rubygems/rubygems] Allow using Gem::Version without loading the rest of rubygems
1b862537a5
2021-12-06 18:43:29 +09:00
Josef Šimánek
25423f0918 [rubygems/rubygems] Add --version parameter to bundle info command.
7d9fdd908d
2021-12-06 18:03:54 +09:00
Colby Swandale
9c0c66f721 [rubygems/rubygems] add login & logout for the signin & signout commands respectively
49b491970b
2021-12-06 17:42:56 +09:00
David Rodríguez
a72aecac3a [rubygems/rubygems] Don't write outside of destdir when regenerating plugins
141ef4cb9a
2021-12-05 05:47:46 +09:00
David Rodríguez
9dc76e102e [rubygems/rubygems] Don't write outside of destdir when installing default bundler
a62d00c5e8
2021-12-05 05:47:45 +09:00
David Rodríguez
ec28771fde [rubygems/rubygems] Fold a line that got out of hand
49317d8beb
2021-12-05 05:47:45 +09:00
David Rodríguez
ed7a50015a [rubygems/rubygems] Fix binstubs and plugins regeneration with --destdir is used
7079de16fa
2021-12-05 05:47:44 +09:00
David Rodríguez
c38c1d82b1 [rubygems/rubygems] Let original EACCES error be raised
This block of code already wraps file operations with
`SharedHelpers.filesystem_access`, which rescues and re-raises more
friendly errors. Also, I'm not fully sure creating a temporary directory
can end up raising an `Errno::EACCES` error from reading `tmpdir`
sources. Finally, this rescue block apparently leads to some false
positives when firewall is blocking the ruby executable on Windows, or
at least that's what we've got reported.

In any case, I think it's best to let the original error be raised.

f7dbe54404
2021-12-04 05:18:11 +09:00
David Rodríguez
0073f624f0 [rubygems/rubygems] Don't unnecessarily loop twice through dependencies
06b4a7994d
2021-12-03 20:00:51 +09:00
David Rodríguez
4c5e862434 [rubygems/rubygems] Improve source gemfile/lockfile equivalence checks
Since we no longer have multiple global sources, each top level dependency is
always pinned to a single source, so it makes little sense to talk about
adding or removing a source. Instead, source changes always mean to
change the source one or more dependencies are pinned to. This logic can
now be much simpler.

f1d33fa0df
2021-12-03 20:00:51 +09:00
David Rodríguez
248fae0ec4 [rubygems/rubygems] Improve sources representation
We have two representations of a source. Once used for sorting, which
should not depend on the source's state, but solely on its static
information, like remotes. Another one used for error and informational
messages, which should properly inform about the exact state of the
source when the message is printed.

This commit makes the latter be the default implementation of `to_s`, so
that error and informational messages are more accurate by default.

b5f2b88957
2021-12-03 20:00:50 +09:00
David Rodríguez
7d974cc56f [rubygems/rubygems] Don't overwrite locked dependency sources too early
Otherwise we hide some useful message about dependency source changes.

c926673c5b
2021-12-03 20:00:50 +09:00
David Rodríguez
aa87780f8f [rubygems/rubygems] Fix incorrect order in changed sources message
6f1b5f68de
2021-12-03 20:00:49 +09:00
David Rodríguez
ca65f7bb8a [rubygems/rubygems] Remove unnecessary code
Somehow this is trying to relax frozen mode constraints for path
sources. It doesn't make sense to me and it's not covered by any spec so
I'm killing it.

17c978e161
2021-12-03 20:00:49 +09:00
David Rodríguez
d19c266b49 [rubygems/rubygems] Reuse locked_dependencies helper
It makes the code more consistent with the above line.

f28d05a548
2021-12-03 20:00:48 +09:00
David Rodríguez
901a257533 [rubygems/rubygems] Reformat for consistency with the above line
11193be3f1
2021-12-03 20:00:47 +09:00
David Rodríguez
906b95780f [rubygems/rubygems] Remove unnecessary nil checks
d047b8935d
2021-12-03 20:00:47 +09:00
Josef Šimánek
1f4af99383 [rubygems/rubygems] Move required_ruby_version gemspec attribute to recommended section.
de6552ac30
2021-12-03 06:01:18 +09:00
Kaíque Kandy Koga
6b64e78823 [ruby/irb] Examine indentation of in keyword when trying to type include
Use in_keyword_case_scope?

Return fast

8acc7f8dc7
2021-12-03 00:56:43 +09:00
ima1zumi
d486286f1d [ruby/irb] Add Alt+d keycode when convert-meta isn't used
I pushed reline#389 for when convert-meta is not turned on in .inputrc.
Alt+D in irb also needs to be set to the keycode for not using convert-meta.

328eddf851
2021-12-03 00:51:41 +09:00
manga_osyo
dcbe29d2ae [ruby/irb] Fix bug infinite loop when pasting multilines fo code in Ruby 2.6
Fix bug infinite loop when pasting multilines fo code in Ruby 2.6.
This is not reproduced in Ruby 2.7.
Changes added in https://github.com/ruby/irb/pull/242/files#diff-612b926e42ed78aed1a889ac1944f7d22229b3a489cc08f837a7f75eca3d3399R155 are also reflected in Ruby 2.6.

0a77f75bf0
2021-12-03 00:42:28 +09:00
ima1zumi
4d4716d939 [ruby/reline] No need to check x > 0
Checked in the previous line.

bf774c0f2c
2021-12-03 00:39:30 +09:00