CGA1123 / slack-ruby-block-kit

Avoid using git to declare files in gemspec RB-E1004
Anti-pattern
Major
7 months ago7 months old
Avoid using git to produce lists of files. Downstreams often need to build your package in an environment that does not have git (on purpose). Use some pure Ruby alternative, like Dir or Dir.glob.
12  spec.license       = 'MIT'
13
14  spec.files = Dir.chdir(File.expand_path(__dir__)) do
15    `git ls-files -z`16      .split("\x0")
17      .reject { |f| f.match(%r{^(test|spec|features)/}) }
18  end