Commit graph

64 commits

Author SHA1 Message Date
David Rodríguez
b203e667c9 [rubygems/rubygems] Fix spelling, it's "cannot" rather than "can not"
3434f094a2
2024-09-17 20:09:07 +00:00
Thomas Marshall
39951293b4 [rubygems/rubygems] Add Specification#validate_for_resolution
This method validates only what is required for resolution, skipping any
irrelevant metadata validation. This will be used by Bundler instead of
doing a full validation, allowing gem authors to use `bundle` commands
immediately in newly created gems without first having to fix invalid
metafata fields in the default gemspec.

da7704cfc0
2024-06-25 14:32:19 +00:00
David Rodriguez
281df1e495 [rubygems/rubygems] Remove Gem::Specification#mark_version
This gets in the middle if we ever start allowing to build as if using a
different RubyGems version than the one being run.

This could be useful to make `gem rebuild` a little more usable, and
it's already done by Bundler specs which already make this method a noop
when they need this.

I'm not sure forcefully setting this, even if user explicitly specified
something else is helpful.

Since this could potentially prevent gems explicitly setting a constant
RubyGems version from building, I changed the error of incorrect
RubyGems version from a hard error to a warning, since it will start
happening in those cases if we stop overwriting the version.

45676af80d
2024-05-03 15:12:55 +00:00
Josef Šimánek
bfb2dc8acf [rubygems/rubygems] Warn on empty or open required_ruby_version specification attribute.
e4bb33747a
2024-02-27 12:33:45 +09:00
David Rodríguez
d64d0b5423
Vendor uri gem in RubyGems 2024-01-29 12:14:21 +09:00
なつき
1e519abe21 [rubygems/rubygems] Fix rake extension warning
04973e349c
2024-01-24 13:55:42 +09:00
Hiroshi SHIBATA
888a8f4318 [rubygems/rubygems] bin/rubocop -A --only Style/StringLiteralsInInterpolation
2333f5f9c5
2024-01-11 13:51:52 +09:00
Drew Stevenson
beefce1444 [rubygems/rubygems] Warn for duplicate meta data links
Match order of METADATA_LINK_KEYS to order used by rubygems.org in Links model.
Add missing download_uri key.

d2922cd6e9
2023-12-14 00:06:05 +00:00
David Rodríguez
a4d80eee17 [rubygems/rubygems] Let RuboCop target Ruby 3.0
70243b1d72
2023-11-13 11:06:10 +09:00
Josef Šimánek
4cf68908e5 [rubygems/rubygems] Update SPDX list and warn on deprecated identifiers.
61667028f5
2023-09-30 11:20:08 +00:00
John Hong
744bc4d5d0 [rubygems/rubygems] Make nil a valid license spec
675effb67e
2023-08-18 16:42:49 +00:00
Hiroshi SHIBATA
d89cc317c6
util/rubocop -A --only Style/NumericLiteralPrefix 2023-04-11 19:12:28 +09:00
Hiroshi SHIBATA
06da0d1456 [rubygems/rubygems] util/rubocop -A
8c9ea5d180
2023-04-04 12:20:43 +00:00
Hiroshi SHIBATA
a881b33818 [rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
52ae4452c2
2023-04-04 12:20:43 +00:00
Hiroshi SHIBATA
cd4b4ac737 [rubygems/rubygems] Use double-quotes instead of single-quotes in warnings
c7f1cb9941
2023-03-28 15:25:45 +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
0eef33e113 [rubygems/rubygems] util/rubocop -A --only Style/Next
e5868e92f7
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA
7800d4eeb5 util/rubocop -A --only Style/MultipleComparison 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
52ea7afa5f [rubygems/rubygems] util/rubocop -A --only Style/NegatedIf
aa95ee27a2
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
0b632b9cdd [rubygems/rubygems] util/rubocop -A --only Style/ClassCheck
1c3356a872
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
4bb5ce8188 [rubygems/rubygems] util/rubocop -A --only Style/StringLiteralsInInterpolation
cb554f6eb7
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
760b8b7d24 [rubygems/rubygems] Change enforce style with Layout/CaseIndentation on rubygems
d4938259c4
2023-03-16 01:59:11 +00:00
Hiroshi SHIBATA
38fa8eb4cb Merge rubygems/bundler master
Pick from e9304aed7e
2023-02-21 19:28:12 +09:00
Mat Sadler
00e1ee4a7e [rubygems/rubygems] don't force Cargo.lock to be in gem root
371044c0ab
2023-01-30 17:39:46 +00:00
Hiroshi SHIBATA
f6620037ba Merge RubyGems-3.4.0 and Bundler-2.4.0 2022-12-24 16:57:07 +09:00
Hiroshi SHIBATA
44264b4fee Merge rubygems/bundler HEAD.
Pick from dfbb5a3811
2022-08-09 12:05:19 +09:00
Takuya Noguchi
d7ffd3fea4
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-07-22 12:07:23 +09:00
Hiroshi SHIBATA
aeea88174d
Merge RubyGems and Bundler HEAD
125415593e
2022-05-20 17:32:19 +09:00
David Rodríguez
f04954d95c
[rubygems/rubygems] Normalize end alignment style with Bundler
f7f504b24c
2022-01-19 11:20:36 +09:00
Ellen Marie Dash
fcaa918445 [rubygems/rubygems] Only disallow FIXME/TODO for first word of gemspec description
7890c98 matched the start of each line, whereas this matches the start
of the entire string.

432de7b819
2021-09-28 17:43:42 +09:00
Ellen Marie Dash
cd2e6318f6 [rubygems/rubygems] Only check if descriptions *start with* FIXME/TODO
It doesn't make much sense to just forbid certain words in descriptions.

7890c98415
2021-09-22 10:13:49 +09:00
David Rodríguez
54ae3f587e [rubygems/rubygems] Prefer require_relative to require for internal requires
c74fc58695
2021-08-31 19:06:14 +09:00
David Rodríguez
6e2240a2f9 Sync latest bundler & rubygems development version 2021-07-07 13:30:20 +09:00
Hiroshi SHIBATA
b717f73402
Revert "Manually merged from https://github.com/rubygems/rubygems/pull/2636"
31a6eaabc1 is obsoleted with
  https://github.com/rubygems/rubygems/pull/3820
2020-09-23 22:01:44 +09:00
Hiroshi SHIBATA
31a6eaabc1
Manually merged from https://github.com/rubygems/rubygems/pull/2636
Enable Style/EmptyLinesAroundClassBody rubocop cop.
2020-09-23 21:02:56 +09:00
David Rodríguez
a89665b7b1 Enforce no empty lines around class body in rubygems
To normalize the code style with `bundler`.
2020-07-31 21:07:19 +09:00
David Rodríguez
955f1837a1 Use space inside block braces everywhere
To make rubygems code style consistent with bundler.
2020-06-15 21:20:37 +09:00
David Rodríguez
8739bc449f [rubygems/rubygems] Only run optional validations in packaging contexts
f4fe949dfa
2020-06-05 07:32:42 +09:00
David Rodríguez
e9c8066bd9 [rubygems/rubygems] Split validations into required and optional
55b09a7aa2
2020-06-05 07:32:42 +09:00
David Rodríguez
455330143a [rubygems/rubygems] Mention that some validations only warn
32c7f7f484
2020-06-05 07:32:42 +09:00
David Rodríguez
257e6cda32 [rubygems/rubygems] Reword validate method header
It's not so basic anymore, and it does much more than validating
required fields.

3c0be4cdeb
2020-06-05 07:32:42 +09:00
David Rodríguez
fc10f35f3d [rubygems/rubygems] Reuse error helper
3a44b6f846
2020-06-05 07:32:42 +09:00
David Rodríguez
3cfe190099 [rubygems/rubygems] Move docs to a better place
c87ac90528
2020-06-05 07:32:42 +09:00
David Rodríguez
8c8364c84e Fix ruby setup.rb warnings
Currently we get the following warnings on `ruby setup.rb`:

```
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/exceptions.rb:281: warning: already initialized constant Gem::UnsatisfiableDepedencyError
/home/deivid/Code/rubygems/lib/rubygems/exceptions.rb:281: warning: previous definition of UnsatisfiableDepedencyError was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/user_interaction.rb:557: warning: already initialized constant Gem::StreamUI::ThreadedDownloadReporter::MUTEX
/home/deivid/Code/rubygems/lib/rubygems/user_interaction.rb:557: warning: previous definition of MUTEX was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/ext/builder.rb:20: warning: already initialized constant Gem::Ext::Builder::CHDIR_MUTEX
/home/deivid/Code/rubygems/lib/rubygems/ext/builder.rb:20: warning: previous definition of CHDIR_MUTEX was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:14: warning: already initialized constant Gem::Ext::ExtConfBuilder::FileEntry
/home/deivid/Code/rubygems/lib/rubygems/ext/ext_conf_builder.rb:14: warning: previous definition of FileEntry was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/version.rb:158: warning: already initialized constant Gem::Version::VERSION_PATTERN
/home/deivid/Code/rubygems/lib/rubygems/version.rb:158: warning: previous definition of VERSION_PATTERN was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/version.rb:159: warning: already initialized constant Gem::Version::ANCHORED_VERSION_PATTERN
/home/deivid/Code/rubygems/lib/rubygems/version.rb:159: warning: previous definition of ANCHORED_VERSION_PATTERN was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:14: warning: already initialized constant Gem::Requirement::OPS
/home/deivid/Code/rubygems/lib/rubygems/requirement.rb:14: warning: previous definition of OPS was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:24: warning: already initialized constant Gem::Requirement::SOURCE_SET_REQUIREMENT
/home/deivid/Code/rubygems/lib/rubygems/requirement.rb:24: warning: previous definition of SOURCE_SET_REQUIREMENT was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:27: warning: already initialized constant Gem::Requirement::PATTERN_RAW
/home/deivid/Code/rubygems/lib/rubygems/requirement.rb:27: warning: previous definition of PATTERN_RAW was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:32: warning: already initialized constant Gem::Requirement::PATTERN
/home/deivid/Code/rubygems/lib/rubygems/requirement.rb:32: warning: previous definition of PATTERN was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:37: warning: already initialized constant Gem::Requirement::DefaultRequirement
/home/deivid/Code/rubygems/lib/rubygems/requirement.rb:37: warning: previous definition of DefaultRequirement was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:42: warning: already initialized constant Gem::Requirement::DefaultPrereleaseRequirement
/home/deivid/Code/rubygems/lib/rubygems/requirement.rb:42: warning: previous definition of DefaultPrereleaseRequirement was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/requirement.rb:311: warning: already initialized constant Gem::Version::Requirement
/home/deivid/Code/rubygems/lib/rubygems/requirement.rb:311: warning: previous definition of Requirement was here
/home/deivid/.rbenv/versions/2.7.1/lib/ruby/site_ruby/2.7.0/rubygems/command.rb:626: warning: already initialized constant Gem::Command::HELP
/home/deivid/Code/rubygems/lib/rubygems/command.rb:626: warning: previous definition of HELP was here
  Successfully built RubyGem
  Name: bundler
  Version: 2.2.0.dev
  File: bundler-2.2.0.dev.gem
Bundler 2.2.0.dev installed
RubyGems 3.2.0.pre1 installed
Regenerating binstubs
Regenerating plugins

------------------------------------------------------------------------------

RubyGems installed the following executables:
	/home/deivid/.rbenv/versions/2.7.1/bin/gem
	/home/deivid/.rbenv/versions/2.7.1/bin/bundle

```

This is because the `$LOAD_PATH` entry added by `setup.rb` is relatively
and when the offending require happens, we're installing `bundler` and
have switched folders to `bundler/`. So the require fallsback to the
system rubygems.

To avoid that, add an absolute path to the `$LOAD_PATH`.

On jruby, somehow the $LOAD_PATH is manipulated so that we end up
requiring stuff inside the built package even if we have specified the
`-I` flag, so we get redefinition warnings anyways.

I'm not sure about the root cause, but relative requiring fixes it, and
it's faster anyways.
2020-06-05 07:32:42 +09:00
Josef Šimánek
464e094fce [rubygems/rubygems] Require ext only in validate_extension, mention gemspec in warning.
5e31e1a421
2020-06-05 07:32:42 +09:00
Josef Šimánek
b7adb10e39 [rubygems/rubygems] Add build warning when rake based extension is present, but rake is not specified as dependency.
75fe5475b6
2020-06-05 07:32:42 +09:00
David Rodríguez
0b40279d7d Normalize heredoc case in rubygems code base 2020-05-08 07:38:50 +09:00
Josef Šimánek
856cbbdd52 [rubygems/rubygems] Track removed methods calls and warn during build time.
move rubyforge_project= to removed methods

223f7fd470
2020-05-08 07:38:50 +09:00
Josef Šimánek
4dd46dbad0 [rubygems/rubygems] Deprecate rubyforge_project attribute only during build time.
c44eb21648
2020-05-08 07:38:50 +09:00