Use Ruby's English module in gemspec

* Can use `git ls-files` directly without the `-z` option.
* Can consequently use a readable variable `$INPUT_RECORD_SEPARATOR` instead
  of cryptic string `"\x0"` to generate array of paths.


Co-authored-by: Frank Taillandier <frank.taillandier@gmail.com>
This commit is contained in:
Ashwin Maroli 2020-04-13 19:56:59 +05:30
parent 3b32fa27d1
commit d0b79bb3bb
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require "English"
require_relative "lib/jekyll/version" require_relative "lib/jekyll/version"
Gem::Specification.new do |s| Gem::Specification.new do |s|
@ -12,7 +13,7 @@ Gem::Specification.new do |s|
s.summary = "A simple, blog aware, static site generator." s.summary = "A simple, blog aware, static site generator."
s.description = "Jekyll is a simple, blog aware, static site generator." s.description = "Jekyll is a simple, blog aware, static site generator."
all_files = `git ls-files -z`.split("\x0") all_files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
s.files = all_files.grep(%r!^(exe|lib|rubocop)/|^.rubocop.yml$!) s.files = all_files.grep(%r!^(exe|lib|rubocop)/|^.rubocop.yml$!)
s.executables = all_files.grep(%r!^exe/!) { |f| File.basename(f) } s.executables = all_files.grep(%r!^exe/!) { |f| File.basename(f) }
s.bindir = "exe" s.bindir = "exe"