Commit graph

63 commits

Author SHA1 Message Date
Edouard CHIN
da3c47bcfc [rubygems/rubygems] Document missing options from man pages:
- The `bundle plugin uninstall --all` was missing.
- The `bundle plugin install --local-git` was missing due to being
  deprecated. We decided to reintroduce the doc for more clarity.

4da252945c
2025-07-25 11:10:42 +09:00
Edouard CHIN
4dd708bf5d [rubygems/rubygems] Add a quality spec to ensure man pages are up to date:
- Ref #8802
- ### Problem

  Whenever a bundler command options is added, we want to make
  sure that the associated command man page is updated to reflect
  the new option (e.g. this mistake was made in #8624)

  ### Solution

  In #8802 we discussed a bit on the implementation which would rely
  on parsing ronn files and introduce some conventions on how options
  documented in man pages should be written.

  I figured I would try a simpler approach by just checking if the man
  page of a command list options using a simple regex.

  Pros:

  - Simpler as we don't have to parse ronn files.
  - No need to modify all existing man pages.

  Cons:

  - We can only verify one way (CLI options -> man pages).
    If a CLI option get removed, we won't be able to warn that
    the existing document man page option needs to be removed.

e10e60bd33
2025-07-25 11:10:41 +09:00
David Rodríguez
416fde11eb [rubygems/rubygems] Fix language quality spec no longer getting run properly
c65e34a904
2025-07-25 11:10:39 +09:00
Hiroshi SHIBATA
949f125f0f [rubygems/rubygems] Use Bundler.settings[gem.bundle]
b16511598e
2025-06-30 12:56:50 +09:00
David Rodríguez
d95f7a3c43
[rubygems/rubygems] Extract stdboth spec helper
bb13f4e702
2025-06-06 10:09:14 +09:00
Matthew Hively
21a14ea230
[rubygems/rubygems] Moved the REMEMBERING OPTIONS section to be after CONFIGURATION KEYS
Since the remembering options are discouraged, the preferred method should be explained first.

Slight tweak to wording

Fix documentation spec test as per suggested patch

9f082ccf31
2025-06-03 07:47:14 +09:00
David Rodríguez
98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
David Rodríguez
6b3c9cebe9 Normalize bundler bindir
This makes bundler consistent with all other gems, and makes the default
installation of Bundler in the release package look like any other
bundler installation.

Before (on preview3, for example), Bundler executable is installed at:

lib/ruby/gems/3.3.0+0/gems/bundler-2.5.0.dev/libexec/bundle

Now it's installed in the standard location:

lib/ruby/gems/3.3.0+0/gems/bundler-2.5.0.dev/exe/bundle
2023-12-13 12:59:23 +09:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Nobuyoshi Nakada
d8e0337d02
Escape the target string to be checked
Comparing file paths as strings may not work well for some reasons,
symlink, relative `__FILE__`, etc.

Some alternatives are possible: comparing with `File.realpath`, or
with `File.identical?`, it should be most robust to escape the target
string contained within this file itself.
2023-11-08 09:04:28 +09:00
Martin Emde
1146826948 [rubygems/rubygems] Fix spelling of extraneous
af61829432
2023-10-22 20:17:44 +00:00
Hiroshi SHIBATA
38fa8eb4cb Merge rubygems/bundler master
Pick from e9304aed7e
2023-02-21 19:28:12 +09:00
David Rodríguez
6d00053c74 [rubygems/rubygems] Use better matcher
Hopefully it gives a better error.

5bc9ff64b6
2022-12-13 12:41:08 +09:00
Hiroshi SHIBATA
bbe56a6437 Merge RubyGems/Bundler master
from bfb0ae6977
2022-12-12 10:49:43 +09:00
Hiroshi SHIBATA
3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
Hiroshi SHIBATA
71794a75db Merge rubygems/bundler HEAD
Pick from 8331e63263
2022-08-03 13:14:10 +09:00
Frederik Dudzik
2a90ad7aa5 [rubygems/rubygems] use Rubocop Lint/Debugger check rather than custom spec
We have a quality spec that check for debugger statements. Rubocop has a
cop that tests for the same thing. As such it makes sense to remove the
spec and activate the cop.

dc1eb6eec5
2021-10-29 17:13:03 +09:00
David Rodríguez
5b0abba931 Sync bundler & rubygems 2021-05-11 11:29:41 +09:00
Hiroshi SHIBATA
ed149dbf46 Merge the master branch of Bundler 2021-04-15 15:36:15 +09:00
David Rodríguez
53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
Hiroshi SHIBATA
69ed64949b Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00
Hiroshi SHIBATA
473f9d2df0 Merge prepare version of Bundler 2.2.0 2020-12-08 17:30:02 +09:00
Hiroshi SHIBATA
d386a58f6f Merge bundler-2.2.0.rc.2 2020-10-15 17:19:02 +09:00
David Rodríguez
9cc7847849 s/sys_exec!/sys_exec 2020-06-18 19:14:15 +09:00
David Rodríguez
592762069d [rubygems/rubygems] Support running specs against a tarball
When bundler specs are run from a ruby tarball (ruby-core does this),
there's no git folder, so `git ls-files` fails.

Support this case by making specs rely on the list of files from the
bundler gemspec instead, and invert the spec that makes sure we ship the
right set of files.

As per the other quality specs, skip them in this case.

b28d5ec931
2020-06-05 07:32:42 +09:00
Kazuhiro NISHIYAMA
b10b37924a
Fix failures in ./spec/bundler/quality_spec.rb
```
Failures:

  1) The library itself does not contain any warnings
     Failure/Error: raise "Invoking #{method}!(#{args.map(&:inspect).join(", ")}) failed:\n#{last_command.stdboth}"

     RuntimeError:
       Invoking sys_exec!("ruby -w") failed:
       /home/user/snapshot-master/lib/bundler/cli/add.rb:4:in `<module:Bundler>': uninitialized constant Bundler::CLI (NameError)
        from /home/user/snapshot-master/lib/bundler/cli/add.rb:3:in `<top (required)>'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from -:2:in `<main>'

       Commands:
       $ ruby -w
       /home/user/snapshot-master/lib/bundler/cli/add.rb:4:in `<module:Bundler>': uninitialized constant Bundler::CLI (NameError)
        from /home/user/snapshot-master/lib/bundler/cli/add.rb:3:in `<top (required)>'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from /home/user/snapshot-master/lib/rubygems/core_ext/kernel_require.rb:91:in `require'
        from -:2:in `<main>'
       # $? => 1
```
2020-05-25 20:12:41 +09:00
Hiroshi SHIBATA
c7ebeb7eda Sync Bundler PR #3624 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA
aecbb78517 Use relative path in ruby core repository 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA
0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
David Rodríguez
5a384e2c08 Fix some bundler specs (#2380)
* These seem to consistenly pass already

* Show actual command when running `make test-bundler`

Current the setup command that installs the necessary gems for testing
bundler was printed, but not the actual command that runs the tests.
That was a bit confusing.

* Borrow trick from setproctitle specs

* A title that long doesn't get set sometimes

No idea why, but the test doesn't need that the title is that long.

* Fix most gem helper spec ruby-core failures

* Fix the rest of the gem helper failures

* Fix version spec by improving the assertion

* Remove unnecessary `BUNDLE_RUBY` environment var

We can use `RUBY` when necessary, and `BUNDLE_RUBY` is not a good name
because bundler considers `BUNDLE_*` variables as settings.

* Rename `BUNDLE_GEM` to `GEM_COMMAND`

This is more descriptive I think, and also friendlier for bundler
because `BUNDLE_` env variables are interpreted by bundler as settings,
and this is not a bundler setting.

This fixes one bundler spec failure in config specs against ruby-core.

* Fix quality spec when run in core

Use the proper path helper.

* Fix dummy lib builder to never load default gems

If a dummy library is named as a default gem, when requiring the library
from its executable, the default gem would be loaded when running from
core, because in core all default gems share path with bundler, and thus
they are always in the $LOAD_PATH. We fix the issue by loading lib
relatively inside dummy lib executables.

* More exact assertions

Sometimes I have the problem that I do some "print debugging" inside
specs, and suddently the spec passes. This happens when the assertion is
too relaxed, and the things I print make it match, specially when they
are simple strings like "1.0" than can be easily be part of gem paths
that I print for debugging.

I fix this by making a more exact assertion.

* Detect the correct shebang when ENV["RUBY"] is set

* Relax assertion

So that the spec passes even if another paths containing "ext" are in
the load path. This works to fix a ruby-core issue, but it's a better
assertion in general. We just want to know that the extension path was
added.

* Use folder structure independent path helper

It should fix this spec for ruby-core.

* Fix the last failing spec on ruby-core

* Skip `bundle open <default_gem>` spec when no default gems
2019-08-20 09:46:31 +09:00
David Rodríguez
a2d7c97a91
[bundler/bundler] Extract yet another helper method
948a863bd8
2019-08-17 17:08:51 +09:00
David Rodríguez
09455301ef
[bundler/bundler] Extract a with_root_gemspec helper
f20c2bdf6a
2019-08-17 17:08:51 +09:00
David Rodríguez
20c5154f0b
[bundler/bundler] Only chdir when necessary
07161ebc1a
2019-08-17 17:08:51 +09:00
David Rodríguez
580e093fdd
[bundler/bundler] Make sure gem has been built before deleteng it
32520c7020
2019-08-17 17:08:51 +09:00
David Rodríguez
a56bf5bfde
[bundler/bundler] Cleanup in a location independent way
5b503a4bf1
2019-08-17 17:08:51 +09:00
David Rodríguez
9c0fcd1d0f
[bundler/bundler] Remove obvious comment
91e7fe1b2f
2019-08-17 17:08:51 +09:00
David Rodríguez
adfca752d6
[bundler/bundler] Remve another unneeded to_s
`FileUtils.rm` supports a `Pathname` argument.

7d982a5be9
2019-08-17 17:08:51 +09:00
David Rodríguez
9925e1a10f
[bundler/bundler] Remove unneeded to_s calls
They are implicit inside `gem_command!`.

6bdb13c899
2019-08-17 17:08:51 +09:00
David Rodríguez
6a299906b4
[bundler/bundler] Extract a lib_tracked_files path helper
028dc46f5a
2019-08-17 17:08:50 +09:00
David Rodríguez
19dabfbe57
[bundler/bundler] Rename a variable
Otherwise I get conflicts when extracting the helper.

314c64cd07
2019-08-17 17:08:50 +09:00
David Rodríguez
c896f71577
[bundler/bundler] Extract a tracked_files path helper
d35e31d2e0
2019-08-17 17:08:50 +09:00
David Rodríguez
b43f4bd218
[bundler/bundler] Rename some variables
I want to extract these to path helper methods, but the name `files`
conflict with some builder methods that are also available at the same
level.

7844096af0
2019-08-17 17:08:50 +09:00
David Rodríguez
cb71930351 [bundler/bundler] Remove unexistent folder from exemptions
0b6d973543
2019-08-16 14:30:23 +09:00
David Rodríguez
f48a61fb46 [bundler/bundler] Commit man pages to source control
This has the benefit that:

* Allows the installation of bundler as a default gem from rubygems to
include man pages.
* Removes the need to build man pages during our tests.
* Makes working with the manifest easier, because we only have source
controlled files, and not a mix of source control and generated files.

To make sure they never fall out of sync, we replace the previous
`man:build` CI task with a `man:check` task that makes sure the
generated man pages are up to date.

23de1d0177
2019-08-16 14:30:23 +09:00
David Rodríguez
4913c9b6bf [bundler/bundler] Remove unexistent file from exemptions
8601575490
2019-08-16 14:30:23 +09:00
David Rodríguez
e84e63230b
[bundler/bundler] Check for straneous quotes
And use single quotes consistenly.

8b9fbbb2df
2019-08-03 09:30:00 +09:00
David Rodríguez
4f5e1b6ebf
[bundler/bundler] Remove cache_command_is_package feature flag
So that we handle the removal of `bundle cache` just like we'll handle
the removal of `bundle show` and `bundle console`.

ff1a669efb
2019-08-03 09:29:58 +09:00
David Rodríguez
f399a2b796
[bundler/bundler] Remove unnecessary line
It contains a typo, so it can't be needed.

ef38c97fbf
2019-08-03 09:29:58 +09:00
David Rodríguez
56fd027aa6
[bundler/bundler] Tweak some quality specs to check more files
98023e25de
2019-08-03 09:29:58 +09:00
David Rodríguez
812dfa44f0
[bundler/bundler] Refactor setting the encoding in quality specs
Instead of setting the encoding globally, set it when reading the files.

e2a5c45e4d
2019-08-03 09:29:57 +09:00