Commit graph

85 commits

Author SHA1 Message Date
Hiroshi SHIBATA
c5861903ac [rubygems/rubygems] Handle CI configuration on ignore list for Gem::Specification#files
4bb0ef3e55
2023-10-25 00:46:09 +00:00
Graham Marlow
f3aea74c3d [rubygems/rubygems] Include gemspec in ExtensionTask for native gem tasks
042cfb7007
2023-10-02 01:34:01 +00:00
David Rodríguez
0e7536bf49 [rubygems/rubygems] Prefer squiggly heredocs over custom helper
258476c38a
2023-07-24 14:59:34 +09:00
Gareth Adams
eaf11d3dd4 [rubygems/rubygems] Stop publishing Gemfile in default gem template
Similarly to how the other ignored files are intended for local
development and not for production, the Gemfile and Gemfile.lock files
for a gem only relate to local development and aren't useful to people
installing the gem.

59049c04be
2023-06-08 15:20:05 +00:00
Ian Ker-Seymer
dd47ce10db [rubygems/rubygems] Use RbSys::ExtensionTask when creating new rust gems
125f9fece9
2023-03-10 11:50:06 +00:00
Akira Matsuda
77bec15c93 [rubygems/rubygems] Properly load the generated gemspec
The previous code loads bundler's gemspec which does not include the generated
gemspec file, and thus the test was passing where it should indeed fail.
With this change, the test properly fails now.

2098ea0d75
2023-02-06 16:19: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
18ba89093a Merge RubyGems/Bundler master
Pick from ba3adad4d8
2022-12-20 13:15:02 +09:00
Josef Šimánek
8eb6618013 [rubygems/rubygems] Turn --ext option into string. Deprecate usage without explicit value.
- this is preparation for onboarding Rust based extension gem generator

d32801bdbc
2022-12-20 13:15:02 +09:00
Yusuke Nakamura
7353f950c3 [rubygems/rubygems] Change generated namespaced test class name in minitest
* `foo` => `TestFoo`
* `foo_bar` => `TestFooBar`
* `foo-bar` => `Foo::TestBar`

353cdd61c3
2022-01-20 01:04:53 +09:00
Yusuke Nakamura
26e0450ba9 [rubygems/rubygems] Add spec to class name definition in newgem spec
5f698fc4a0
2022-01-20 01:04:53 +09:00
Yusuke Nakamura
4451313252 [rubygems/rubygems] Update generated minitest file style
foo     => test/test_foo.rb
foo-bar => test/foo/test_bar.rb
foo_bar => test/test_foo_bar.rb

c795e5d40d
2022-01-20 01:04:52 +09:00
Yusuke Nakamura
4e955b2e37 [rubygems/rubygems] Create minitest file to underscored path in "bundle gem" command
...with dashed gem name

In "bundle gem" command with dashed name gem (e.g. foo-bar) generates
`test/test_foo/bar.rb`, but this file contains undefined class `TestFoo`
and moreover, does not include in "bundle exec rake test" target.

Therefore, intentially the first test after gem created is fail, but in
case of gem name contains dash character is not.

The change doings...
(when "bundle gem foo-bar" called)

* create `test/test_foo_bar.rb`
* define `TestFooBar` class in `test/test_foo_bar.rb`

5d9a69fc0f
2022-01-20 01:04:52 +09:00
Hiroshi SHIBATA
0b53a8895f
Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbd 2021-12-01 11:00:10 +09:00
OKURA Masafumi
7e506716d2
Newly generated gems require Ruby 2.6.0
In 2021, Ruby 2.5 and older are EOL.
We can set the default required Ruby version to 2.6.0 to
encourage people to use newer Ruby.
If the command is executed with old Ruby, it falls back to 2.3.0.
It's still possible to create a gem for older Ruby just by changing
two lines of code (one in gemspec and another is in rubocop.yml).
2021-10-09 09:07:47 +09:00
fiveNinePlusR
105e037fe8 [rubygems/rubygems] Fix possible malicious website to example.com
example.com is the canonical stand in for domain examples and will never have a backing website.

via https://www.rfc-editor.org/rfc/rfc2606.html

26622c81c2
2021-09-22 10:14:04 +09:00
David Rodríguez
8adc606271 [rubygems/rubygems] Fix git repo initialization on a path with spaces
a2d6e10192
2021-08-31 19:06:14 +09:00
David Rodríguez
199083dd15 [rubygems/rubygems] Simplify overkill usage of shared examples
36a00144b9
2021-08-31 19:06:14 +09:00
Nobuyoshi Nakada
9fc16a31d9 [rubygems/rubygems] Exclude gemspec file itself from gem
The processed YML data is included as metadata, the source gemspec
file is unused and just confusing.

f444478eac
2021-08-31 19:06:14 +09:00
Hiroshi SHIBATA
896bbb9fad Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9 2021-07-14 10:48:07 +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
Steven Peckins
8863bfb1f4 [rubygems/rubygems] Move comment below shebang in bin/console template
In an executable script, the shebang line should be the first line (the
file needs to start with the bytes 0x23 0x21).  Putting a comment above
it will break the script.

(Regression test included per @deivid-rodriguez)

962e669feb
2020-09-28 14:54:22 +09:00
Utkarsh Gupta
fd709382b6 [rubygems/rubygems] Tag the specs with :readline
The newly added specs needs to be tagged as
:readline, otherwise they fail on Windows with
the backtrace: `ZeroDivisionError: divided by 0`.

Such issues are already being skipped on Windows.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

391f860af4
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
c44c7019b5 [rubygems/rubygems] Add tests with different flag combinations
Since this PR was made because we missed checking
RuboCop offenses with different flags, therefore
adding tests so that all flag combinations are
tested.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

d08250efc2
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
ca133c0366 [rubygems/rubygems] Fix line spacing to make Layout/EmptyLines happy
The Gemfile wasn't properly put in the last commit.
As a result, Layout/EmptyLines inspected an offense
in the Gemfile.

This also fixes the spec w.r.t change in the task
default.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

d1418fddd3
2020-07-15 16:05:12 +09:00
David Rodríguez
2fafc08aa3 [rubygems/rubygems] Remove unneeded trailing conditions on exitstatus
27e0e4ecb6
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
5ebca6d709 [rubygems/rubygems] Skip this spec on ruby_core workflow
ruby_core has an 'ast.rb' file that gets in the
middle and breaks this spec, so it's better we skip
this test on this workflow for now.

Also, slightly change the spec name from "run" to
"runs" and change the last assertion, it's cleaner
to check empty error.
Thanks to David Rodríguez for this!

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

ba8eaa70c3
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
d0810fdee4 [rubygems/rubygems] Use latest version of rubocop for RUBY_VERSION > 2.4
With older versions of rubocop, the dependency on
`jaro_winkler` seems to be a pain.
However, in the later versions of rubocop, this
dependency was dropped. So we only need to use
the older version for ruby2.3.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

9cd87eaee3
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
077dcacb08 [rubygems/rubygems] Use --config .rubocop.yml instead
because rubocop configuration inheritance is
messed up and when using `--ignore-parent-exclusion`,
even though the exit status is 0, the example
still fails because of the configuration issue.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

3e20b2738c
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
ecb87b55d8 [rubygems/rubygems] Lock rubocop version to 0.80.1
The later RuboCop versions don't work with ruby2.3
so we should lock the version to what works with
ruby2.3 as we haven't dropped the support yet.

And since we're using the older version of rubocop,
also fix `Max` value of `LineLength` to 120, which
is the current standard. Without this, rubocop
will throw the line length offenses.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

46d0a800a2
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
215f7c3165 [rubygems/rubygems] Fix linting and make Style/RedundantInterpolation happy
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

83e330fa87
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
4875a96edd [rubygems/rubygems] Fix test to run rubocop on the generated gem
With this, it will be ensured that the generated
(skeleton) gem will have no offenses.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

47411262e0
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
b28c6d04d0 [rubygems/rubygems] Make Style/HashSyntax cop happy
Previously, we were using the old syntax like:
`task :default => :spec`, but now this commit
uses the new Ruby 1.9 hash syntax.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

b41d0fdb56
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
449d24200b [rubygems/rubygems] WIP: add test to run rubocop on the generated gem
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

730b770f8a
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
084489be87 [rubygems/rubygems] Fix tests pertaining to newgem
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

e2ee0b7de3
2020-07-15 16:05:12 +09:00
Utkarsh Gupta
22ee047f73 [rubygems/rubygems] Only add .rubocop.yml when --rubocop flag is passed
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

ef2dae4222
2020-06-18 19:14:15 +09:00
Utkarsh Gupta
ec98d56153 Ship default .rubocop.yml
Currently, there is no `.rubocop.yml` shipped by default.
So when a user runs `rubocop` after creating a new gem via
`bundle gem foo`, it throws a bunch of offenses.

With the default `.rubocop.yml` present, the number of those
offenses significantly reduce by 25.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
2020-06-18 19:14:15 +09:00
Utkarsh Gupta
d9c888d394 [rubygems/rubygems] Only add .rubocop.yml when --rubocop flag is passed
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>

ef2dae4222
2020-06-18 19:14:15 +09:00
David Rodríguez
9cc7847849 s/sys_exec!/sys_exec 2020-06-18 19:14:15 +09:00
David Rodríguez
1436b5026c [rubygems/rubygems] s/bundle!/bundle
746a4b3d74
2020-06-18 19:14:15 +09:00
Frank Lam
a1a5973daa [rubygems/rubygems] Prefer using bundle! to avoid unnecessary swallowing of errors
6bac832a58
2020-06-18 19:14:15 +09:00
Frank Lam
f6c8ca0359 [rubygems/rubygems] Move already configured --test hint to before test file creation
9e5f7a9099
2020-06-18 19:14:15 +09:00
Frank Lam
0ba2f3e8a9 [rubygems/rubygems] Move already configured --ci hint to before CI file creation
2af2abe5fd
2020-06-18 19:14:15 +09:00
Frank Lam
091daaa715 [rubygems/rubygems] Lower verboseness of user-facing text for bundle gem
288f073c3c
2020-06-18 19:14:15 +09:00
Frank Lam
8e3136a03b [rubygems/rubygems] Make test framework/CI configuration for bundle gem consistent
* Add hints for --ci option

5f779f45b0
2020-06-18 19:14:15 +09:00
Frank Lam
760edb3743 [rubygems/rubygems] Fix CI spec typo
Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
24f3739585
2020-06-18 19:14:15 +09:00