lib/linner/bundler.rb in linner-0.8.4 vs lib/linner/bundler.rb in linner-0.8.5
- old
+ new
@@ -39,11 +39,11 @@
if bundle.version != "master"
next if File.exist?(bundle.path) and File.exist?(File.join(@vendor, bundle.name))
end
puts "Installing #{bundle.name} #{bundle.version}..."
install_to_repository bundle
- if gzipped?(bundle.path)
+ if File.extname(bundle.path) == ".gz"
link_and_extract_to_vendor bundle.path, File.join(@vendor, ".pkg", bundle.name, File.basename(bundle.path)), File.join(@vendor, bundle.name)
else
link_to_vendor bundle.path, File.join(@vendor, bundle.name)
end
end
@@ -78,13 +78,8 @@
def link_and_extract_to_vendor(path, linked_path, dest)
link_to_vendor(path, linked_path)
FileUtils.rm_rf Dir.glob("#{dest}/*")
Archive.untar(path, dest)
- end
-
- def gzipped?(path)
- mime_type = IO.popen(["file", "--brief", "--mime-type", path], in: :close, err: :close).read.chomp
- ["application/x-gzip", "application/gzip"].include? mime_type
end
end
end