Skip to content

Commit

Permalink
Use Dir#[] instead of git command for gemspec
Browse files Browse the repository at this point in the history
For example, it prevents errors such as:

```console
bundle install

[!] There was an error parsing `Gemfile`:
[!] There was an error while loading `rubocop-performance.gemspec`: No such file or directory - git. Bundler cannot continue.

#  from /root/project/rubocop-performance.gemspec:18
#  -------------------------------------------
#    s.email = 'rubocop@googlegroups.com'
>    s.files = `git ls-files -z config lib LICENSE.txt README.md`.split("\x0")
#    s.extra_rdoc_files = ['LICENSE.txt', 'README.md']
#  -------------------------------------------
. Bundler cannot continue.

#  from /root/project/Gemfile:7
#  -------------------------------------------
#
>  gemspec
#
#  -------------------------------------------

Exited with code exit status 14
```

https://app.circleci.com/pipelines/github/rubocop/rubocop-performance/792
  • Loading branch information
koic committed Sep 2, 2022
1 parent 975d32a commit 0b32b55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rubocop-performance.gemspec
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |s|
DESCRIPTION

s.email = 'rubocop@googlegroups.com'
s.files = `git ls-files -z config lib LICENSE.txt README.md`.split("\x0")
s.files = Dir['LICENSE.txt', 'README.md', 'config/**/*', 'lib/**/*']
s.extra_rdoc_files = ['LICENSE.txt', 'README.md']
s.homepage = 'https://github.com/rubocop/rubocop-performance'
s.licenses = ['MIT']
Expand Down

0 comments on commit 0b32b55

Please sign in to comment.