Closed pocke closed 4 years ago
require 'English'
defines this global variable$/
, which is a special variable that delimits records, normally a String which is a '\n'
We could:
version.rb
which is already included (perhaps a little cryptic)Example in IRB:
We can also simplify away the git
need:
spec.files = Dir['lib/**/*.rb'] + %w[Changelog.md README.markdown LICENSE]
Yes, $INPUT_RECORD_SEPARATOR
is an alias of $/
and added by English.
I think -z
is more appropriate than using $/
or the aliases. Because -z
treats file path that contains newlines.
Bundler also has been changed from $/
to -z
.
https://github.com/bundler/bundler/commit/ec9165fdffe63f6d5a8b2a9a302252ec1116618c#diff-bfb3596c9458be429d82bf6b31f82364L16
However, we probably never add a file that contains a newline. But I think -z
is the new standard style of gemspec, so we can follow it.
By the way, Dir['lib/**/*.rb']
seems reasonable. But I usually do not see this style in gemspec, so it's possible to have any problems. I guess it probably works well.
Thanks for your comment!
Superseded by #97 - thanks for raising this issue, @pocke - and for fixing the RuboCop build failures! 🍏 💚 GREEN AGAIN!
Am closing this with a thanks!
Thanks!
Currently, the gemspec has a warning about
$INPUT_RECORD_SEPARATOR
.This pull request suppresses the warning. I think using
-z
option andsplit("\x0")
is better than the current.bundle gem
's boilerplate also has the style.RuboCop's new cop added an offense. And I got warnings about .rubocop.yml. So this pull request also suppresses the warning.