Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improve cross-platform git check in gemspec

[ci skip]
  • Loading branch information...
commit af486027959495c9f05d224c246f569a26b71071 1 parent 415ad49
@mislav mislav authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 will_paginate.gemspec
View
11 will_paginate.gemspec
@@ -1,4 +1,5 @@
# encoding: utf-8
+require 'rbconfig'
require File.expand_path('../lib/will_paginate/version', __FILE__)
Gem::Specification.new do |s|
@@ -16,5 +17,13 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ['README.md', 'LICENSE']
s.files = Dir['Rakefile', '{bin,lib,test,spec}/**/*', 'README*', 'LICENSE*']
- s.files &= `git ls-files -z`.split("\0") if `type -t git 2>/dev/null || which git 2>/dev/null` && $?.success?
+
+ # include only files in version control
+ git_dir = File.expand_path('../.git', __FILE__)
+ void = defined?(File::NULL) ? File::NULL :
+ RbConfig::CONFIG['host_os'] =~ /msdos|mswin|djgpp|mingw/ ? 'NUL' : '/dev/null'
+
+ if File.directory?(git_dir) and system "git --version >>#{void} 2>&1"
+ s.files &= `git --git-dir='#{git_dir}' ls-files -z`.split("\0")
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.