From 8c869ea9a232bee674845e336f675aa5a7264b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 26 Dec 2013 00:57:14 +0100 Subject: [PATCH] Filter files that are not in version control from the gemspec Keeps unversioned files that I'm currently experimenting with from accidentally getting released. --- hub.gemspec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hub.gemspec b/hub.gemspec index 938a4afd..57e27830 100644 --- a/hub.gemspec +++ b/hub.gemspec @@ -15,6 +15,12 @@ Gem::Specification.new do |s| s.files += Dir.glob("bin/**/*") s.files += Dir.glob("man/**/*") + # include only files in version control + git_dir = File.expand_path('../.git', __FILE__) + if File.directory?(git_dir) + s.files &= `git --git-dir='#{git_dir}' ls-files -z`.split("\0") + end + s.executables = %w( hub ) s.description = <