[DRE-commits] [SCM] gem2deb.git branch, master, updated. df78c8df0351d7f263e33b998011b017e42e9c76

Lucas Nussbaum lucas at lucas-nussbaum.net
Sat Mar 12 08:02:43 UTC 2011


The following commit has been merged in the master branch:
commit df78c8df0351d7f263e33b998011b017e42e9c76
Author: Lucas Nussbaum <lucas at lucas-nussbaum.net>
Date:   Sat Mar 12 09:03:40 2011 +0100

    gem2tgz gemname now downloads the gem if needed.

diff --git a/bin/gem2tgz b/bin/gem2tgz
index d6c8baa..b28d57d 100755
--- a/bin/gem2tgz
+++ b/bin/gem2tgz
@@ -37,7 +37,15 @@ if ARGV.length != 1 && ARGV.length != 2
   exit(1)
 end
 
-Gem2Deb::Gem2Tgz.convert!(ARGV[0], ARGV[1] || nil)
+gemfile = ARGV[0]
+# Download gem if not available locally
+if not File::exists?(gemfile) and gemfile !~ /.gem$/
+  puts "#{gemfile} doesn't seem to exist. Let's try to download it with 'gem fetch #{ARGV[0]}'"
+  run("gem fetch #{gemfile}")
+  gemfile = Dir::glob("#{gemfile}-*.gem")[0]
+end
+
+Gem2Deb::Gem2Tgz.convert!(gemfile, ARGV[1] || nil)
 
 __END__
 =head1 NAME
@@ -46,7 +54,9 @@ gem2tgz - converts Rubygems' .gem file into tarballs
 
 =head1 SYNOPSIS
 
-B<gem2tgz> [I<OPTIONS>] I<GEM> [I<TARBALL>]
+B<gem2tgz> [I<OPTIONS>] I<GEMNAME> [I<TARBALL>] (to download the gem with I<gem fetch>)
+
+B<gem2tgz> [I<OPTIONS>] I<GEMFILE> [I<TARBALL>] (to use a local .gem file)
 
 =head1 DESCRIPTION
 
diff --git a/debian/changelog b/debian/changelog
index f961f95..d5df3b5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,8 +8,9 @@ gem2deb (0.1.1) experimental; urgency=low
   * When tests fail, and user says No, do not continue.
   * Add Vcs-* fields after moving to PRE repo
   * Document that gem2deb can download the gem using gem fetch
+  * gem2tgz gemname now downloads the gem if needed.
 
- -- Lucas Nussbaum <lucas at lucas-nussbaum.net>  Fri, 11 Mar 2011 22:02:29 +0100
+ -- Lucas Nussbaum <lucas at lucas-nussbaum.net>  Sat, 12 Mar 2011 09:01:21 +0100
 
 gem2deb (0.1.0) experimental; urgency=low
 

-- 
gem2deb.git



More information about the Pkg-ruby-extras-commits mailing list