Skip to content

Instantly share code, notes, and snippets.

View yoshoku's full-sized avatar
🥷

Atsushi Tatsuma yoshoku

🥷
View GitHub Profile
@mattconnolly
mattconnolly / gem-with-git-submodules.gemspec
Last active December 25, 2022 03:11
Gem Spec support for git submodules inside a gem.
Gem::Specification.new do |s|
# normal spec stuff above
s.files = `git ls-files`.split("\n")
# get an array of submodule dirs by executing 'pwd' inside each submodule
gem_dir = File.expand_path(File.dirname(__FILE__)) + "/"
`git submodule --quiet foreach pwd`.split($\).each do |submodule_path|
Dir.chdir(submodule_path) do
submodule_relative_path = submodule_path.sub gem_dir, ""
# issue git ls-files in submodule's directory and