Commit graph

247 commits

Author SHA1 Message Date
David Rodríguez
963f98a94f [rubygems/rubygems] Enable Performance/MapCompact cop
0c3a65871a
2024-11-26 15:11:05 +09:00
David Rodríguez
4addaaf4df [rubygems/rubygems] More aggressive Performance/FlatMap cop configuration
d8d68cc00e
2024-11-26 15:11:05 +09:00
David Rodríguez
62b9da7088 [rubygems/rubygems] Fix bundle lock --add-checksums
Due to a typo in the spec, the issue was not caught initially. If
Bundler does not need to re-resolve, `bundle lock` is a noop so Bundler
does not add checksums.

To fix the issue, we do something similar to what `bundle install` does,
just without actually installation. First set the domain (local or
remote) according to whether a re-resolve is necessary, and then
materialize lazy specifications into real specifications, so that
checksums are actually fetched from each source.

84b6f4ee96
2024-11-25 18:14:32 +00:00
David Rodríguez
c215e95572 [rubygems/rubygems] Most of the times, eagerly resolving is not necessary
All we need is to setup remote or local sources appropriately.

3ceff46a2a
2024-11-25 18:14:31 +00:00
Lars Kanis
796757a01c [rubygems/rubygems] Remove override of worker jobs for bundle install --local
There seems to be no reason why the install should be serial for --local.
The packages are still installed in the right dependency order in this case, so that parallel install can be used.
This patch disables parallel install only in case of no_install_needed.

Also remove the `option` argument, which is effectifely not used.

5da934ddb6
2024-11-21 10:35:58 +00:00
David Rodríguez
a1148d4aad [rubygems/rubygems] Cancel bundle console deprecation
506a863b36
2024-11-11 12:49:26 +00:00
David Rodríguez
f7b334e002 [rubygems/rubygems] Add bundle lock --add-checksums to add checksums to an existing lockfile
0a9c1ce60d
2024-11-08 10:27:03 +00:00
David Rodríguez
5fa491b405 Normalize lockfile platforms 2024-10-26 18:44:15 +09:00
Jerome Dalbert
fce5bbd6a7 [rubygems/rubygems] Add bundle add --quiet option
This option is similar to the `bundle install --quiet` option

3bd773d827
2024-10-18 16:19:31 +00:00
David Rodríguez
36b7ad3caa [rubygems/rubygems] Fix bundle check sometimes locking gems under the wrong source
1e5780db0a

Co-authored-by: Taylor Thurlow <thurlow@hey.com>
2024-10-16 21:57:52 +00:00
David Rodríguez
9d5be3d9ed [rubygems/rubygems] Lock definition directly
55eb6630a8
2024-10-16 21:57:50 +00:00
Samuel Giddins
bdc3363d0f [rubygems/rubygems] Update required_ruby_version to 3.1
3.0 has been EOL since march, drop support for it before the 3.4 release is cut

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

fc1f03b06a
2024-10-04 20:01:51 +00:00
David Rodríguez
c071fedb32 [rubygems/rubygems] Fix bundle outdated with --group option
It was printing incorrect output and returning incorrect status.

96f5979c7d
2024-09-23 10:37:57 +00:00
David Rodríguez
cf29594c03 [rubygems/rubygems] Don't try to install locked bundler when --local is passed
907d46964d
2024-09-20 09:58:24 +00:00
David Rodríguez
b203e667c9 [rubygems/rubygems] Fix spelling, it's "cannot" rather than "can not"
3434f094a2
2024-09-17 20:09:07 +00:00
Yuji Yaginuma
c37b667774 [rubygems/rubygems] Make an exe file executable when generating new gems
Currently, an exe file isn't executable when generating new gems
because it doesn't have the correct permission.
This PR sets the correct permission same as files under the `bin`.

6509bf128a
2024-09-11 04:41:20 +00:00
Matt Brictson
830ff66e2c [rubygems/rubygems] Emit progress to stderr when --parseable is passed to bundle outdated
Before, `bundle outdated --parseable` (or `--porcelain`) caused output
to be completely silenced during definition resolution, so nothing was
printed at all until the table of outdated gems was printed.

With this change, `--parseable`/`--porcelain` now prints progress to
stderr during resolution. E.g.:

```
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
```

This provides a better user experience, especially when
`outdated --parseable` takes several seconds or more.

The report of outdated gems is still printed to stdout, and the exit
status codes are unchanged, so the fundamental contract with other tools
consuming the `outdated --parseable` result should not be affected.

7d4bb43570
2024-08-30 10:36:08 +00:00
David Rodríguez
6dee0d3fb0 [rubygems/rubygems] Reject unknown platforms when running bundle lock --add-platform
1f93a2bdc5
2024-08-29 09:59:26 +00:00
Matt Brictson
7c794c287e [rubygems/rubygems] Emit progress to stderr when --print is passed to bundle lock
`bundle lock --print --update` can take a long time to fetch sources and
resolve the lock file.

Before, `--print` caused output to be completely silenced, so nothing
was printed at all until the resolved lock file is finally emitted to
stdout.

With this change, `--print` now prints progress to stderr. E.g.:

```
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
```

This provides a better user experience, especially when
`lock --print --update` takes several seconds or more.

The lock file is still printed to stdout, so tools consuming the lock
file on stdout will not be affected.

6719baa700
2024-08-26 14:56:26 +00:00
David Rodríguez
9f5860407f [rubygems/rubygems] Fix error message when Bundler refuses to install due to frozen being set without a lockfile
0857d62ca6
2024-08-23 07:00:30 +00:00
Jerome Dalbert
71dec15a70 [rubygems/rubygems] Fix bundle check exit code when git gem is missing
Make `bundle check` exit with code 1 when gem git source is not yet
checked out.

93162bf5af
2024-07-26 07:56:15 +00:00
Jason Karns
a4563be05c [rubygems/rubygems] bundle-gem learns to find Gemfile template correctly
Removes the symlink for gems.rb.tt and instead uses the singular
template file. Only the destination filename for the gemfile reads from
the `init_gems_rb` setting.

43ce0e1666
2024-07-25 19:50:59 +00:00
Jerome Dalbert
c6c817df28 [rubygems/rubygems] Add --no-test, --no-ci, and --no-linter options
f58660ffcc
2024-06-26 11:24:47 +00:00
Earlopain
b8a592fe6e [rubygems/rubygems] Fix bundle fund when the gemfile contains optional groups
`current_dependencies` doesn't return gems in optional groups, while `specs` would

Closes https://github.com/rubygems/rubygems/pull/7757

c797e95636
2024-06-18 17:53:59 +00:00
Yuta Saito
d914192012 [rubygems/rubygems] Use symbol for option key in Bundler::CLI::Install
07a5faeb89
2024-06-18 00:59:37 +00:00
Yuta Saito
3e4b694565 [rubygems/rubygems] Bundler integration for --target-rbconfig option
f9fb413a19
2024-06-18 00:59:36 +00:00
David Rodriguez
9fd41480fb [rubygems/rubygems] Use RubyGems freebsd helper
5d03a346ab
2024-05-16 09:20:17 +00:00
Cody Cutrer
44b5c912da [rubygems/rubygems] Allow installing plugins from path via CLI
Also bring the man page up to date.

a849bd6947
2024-03-27 11:34:46 +00:00
Cody Cutrer
cb029fa4e8 [rubygems/rubygems] Deprecate bundle plugin install --local-git=
It's the exact same implementation as --git

18eb2418c6
2024-03-18 11:42:37 +00:00
David Rodríguez
24d5e7176e
[rubygems/rubygems] Refactor lockfile generation
6a0c03c77f
2024-02-08 14:43:56 +09:00
Masato Ohba
933ede5d76 [rubygems/rubygems] Remove travis_removal_info
`travis_removal_info` is added by https://github.com/rubygems/rubygems/pull/6150. According to the comment, it's supposed to be removed at bundler v2.5.0 but it hasn't.

e18797d43f
2024-01-29 05:39:13 +00:00
Masato Ohba
0bac390e07 [rubygems/rubygems] Bump Ruby version to be used in bundle gem template
since 2.6 and 2.7 are EOL and bundler dropped their support by https://github.com/rubygems/rubygems/pull/7116.

b562d9a822
2024-01-27 15:50:24 +00:00
Hiroshi SHIBATA
443e417885 [rubygems/rubygems] bin/rubocop -A --only Style/RedundantParentheses
7cc647c8f3
2024-01-11 13:51:52 +09:00
David Rodríguez
b45c1523a8
[rubygems/rubygems] Gem::Specification.find_all_by_name is always defined now
1d61c7686b
2023-12-14 20:22:48 +08:00
Martin Emde
c1f4bfd41f [rubygems/rubygems] Revert "Merge pull request #7167 from nevinera/add-json-output-option-to-bundle-outdated"
This reverts commit a4ac5116b8, reversing
changes made to 8a6b180d0a.

a1efe4015d
2023-12-13 22:50:45 +00:00
Samuel Giddins
baf2ec2ca8 [rubygems/rubygems] Use match? when regexp match data is unused
Improved performance / reduced allocations

b04726c9a7
2023-12-13 22:00:26 +00:00
David Rodríguez
1a7aa5560f [rubygems/rubygems] Refactor bundle info
0e919eaa87
2023-12-13 13:02:22 +09:00
David Rodríguez
70428247c6 [rubygems/rubygems] Remove dead code
fad186df39
2023-12-13 13:02:21 +09:00
Samuel Giddins
e223dde329 [rubygems/rubygems] Allow bundle pristine to run in parallel
Also fix running when BUNDLE_NO_INSTALL happens to be set, same as with install/update commands

a555fd6ccd
2023-12-12 02:10:53 +00:00
Franz Liedke
0653fb026c [rubygems/rubygems] Refactor: Move filesystem access into Definition class
2720da2659
2023-12-12 01:08:20 +00:00
Franz Liedke
0ec88b54f3 [rubygems/rubygems] bundle lock: Always touch the lockfile
fd2e71dfdb
2023-12-12 01:08:19 +00:00
Yuji Yaginuma
8bb90f4d77 [rubygems/rubygems] Use Minitest::TestTask in a template file for minitest
`minitest` has introduced a rake task for running test on 5.16.0.
https://github.com/minitest/minitest/blob/master/History.rdoc#5160--2022-06-14-

This has some tasks related to running tests and it's useful for
`minitest` user I think.
https://github.com/minitest/minitest#rake-tasks-

This PR changed to use the task in a template file for `minitest`

7a86d13062
2023-12-08 03:25:43 +00:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Eric Mueller
73440e1ef2 [rubygems/rubygems] Many major_deprecations supply :removed_message
Generally the removed message is very similar, but often it needs to
specify that the feature has "been removed" instead of "will be
removed", or "been deprecated". And a few chunks of text needed more
substantial updates. And a number of them seemed to have been carefully
crafted to make sense in either context, so I left those alone.

8d42cf9104
2023-12-01 17:52:38 +00:00
Eric Mueller
055a4f09ca [rubygems/rubygems] Don't require 'json' unless it's actually needed
97ee203fd5
2023-11-23 18:03:17 +00:00
Eric Mueller
c424d15cb9 [rubygems/rubygems] Add --json bundle-outdated flag to produce json-parseable output
65efa44bc0
2023-11-23 18:03:17 +00:00
Eric Mueller
a54c98a29f [rubygems/rubygems] Factor group-filtering to a private method to reduce repetition
We're about to expand the repeated bit of code, so drying it up a little
is warranted.

e69c658be6
2023-11-23 18:03:16 +00:00
David Rodríguez
a4d80eee17 [rubygems/rubygems] Let RuboCop target Ruby 3.0
70243b1d72
2023-11-13 11:06:10 +09:00
Hiroshi SHIBATA
c5861903ac [rubygems/rubygems] Handle CI configuration on ignore list for Gem::Specification#files
4bb0ef3e55
2023-10-25 00:46:09 +00:00
David Rodríguez
a05904c8ce [rubygems/rubygems] The lock command should not be affected by frozen setting
The `lock` command is specifically designed to manage the lockfile, so
running it should take precedence over any "frozen" setting.

Besides that, "frozen" is not specifically designed as "lockfile cannot
be updated" but as "installation of gems should be prevented if gemfile
is not in sync with the lockfile".

The lock command does not install any gems and preserves the property of
the lockfile being in sycn with its gemfile, so I think frozen should
not influence it.

The current behavior is quite confusing when frozen is set. On an app
where rubocop can get lockfile updates

```
$ bundle lock --update rubocop
Writing lockfile to /path/to/Gemfile.lock
```

Completely silent, it makes you think that it has written the lockfile,
but still no updates.

In verbose mode, it gives a bit more information, but still confusing
and unexpected, and does not change the lockfile:

```
$ bundle lock --update rubocop --verbose
Running `bundle lock --update "rubocop" --verbose` with bundler 2.4.20
Frozen, using resolution from the lockfile
Writing lockfile to /path/to/Gemfile.lock
```

With this commit, it updates the lockfile as expected.

1d501ae8ea
2023-10-16 13:52:12 +09:00