Skip to content

Commit

Permalink
Fetch gemspec files from git
Browse files Browse the repository at this point in the history
This lets us filter out running an app from tmp/starter.

It's also just a copy of modern gemspecs. Which is why we set the bindir
and how we find that as well.
  • Loading branch information
kaspth committed Jan 15, 2023
1 parent 169b94a commit 76762ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nice_partials.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ Gem::Specification.new do |gem|
gem.homepage = "https://github.com/bullet-train-co/nice_partials"
gem.license = "MIT"

gem.files = Dir["{**/}{.*,*}"].select{ |path| File.file?(path) && path !~ /^pkg/ }
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
gem.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
end
end
gem.bindir = "exe"
gem.executables = gem.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
gem.require_paths = ["lib"]

gem.required_ruby_version = ">= 2.0"
Expand Down

0 comments on commit 76762ee

Please sign in to comment.