[DRE-commits] [gem2deb] 01/01: dh-make-ruby: s/_/-/g when converting gem names to source package names
Antonio Terceiro
terceiro at moszumanska.debian.org
Sat Jun 13 19:56:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository gem2deb.
commit b52a86dc46edc7b7dc0ebd086a1a8f101555c86a
Author: Antonio Terceiro <terceiro at debian.org>
Date: Sat Jun 13 16:56:30 2015 -0300
dh-make-ruby: s/_/-/g when converting gem names to source package names
---
debian/changelog | 2 ++
lib/gem2deb/dh_make_ruby.rb | 2 +-
test/unit/dh_make_ruby_test.rb | 14 ++++++++++++++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index dde964f..2481a6b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ gem2deb (0.18.2) UNRELEASED; urgency=medium
* gem2deb-test-runner: when under autopkgtest, don't pass any GEM_PATH at
all, no even an empty one. This fixes dependency checks under autopkgtest.
+ * dh-make-ruby: convert *all* underscores (`_`) to dashes (`-`) when
+ converting gem names to source package names (not just the first one).
-- Antonio Terceiro <terceiro at debian.org> Sat, 13 Jun 2015 12:13:45 -0300
diff --git a/lib/gem2deb/dh_make_ruby.rb b/lib/gem2deb/dh_make_ruby.rb
index 8683f02..c6827ca 100644
--- a/lib/gem2deb/dh_make_ruby.rb
+++ b/lib/gem2deb/dh_make_ruby.rb
@@ -118,7 +118,7 @@ module Gem2Deb
end
def gem_name_to_source_package_name(gem_name)
- @gem_to_package[gem_name] || 'ruby-' + gem_name.downcase.gsub(/^ruby[-_]|[-_]ruby$/, '')
+ @gem_to_package[gem_name] || 'ruby-' + gem_name.downcase.gsub(/^ruby[-_]|[-_]ruby$/, '').gsub('_', '-')
end
def generate_or_update_gem_to_package_data
diff --git a/test/unit/dh_make_ruby_test.rb b/test/unit/dh_make_ruby_test.rb
index f70acf6..9203c3d 100644
--- a/test/unit/dh_make_ruby_test.rb
+++ b/test/unit/dh_make_ruby_test.rb
@@ -161,6 +161,20 @@ class DhMakeRubyTest < Gem2DebTestCase
end
end
+ context 'converting gem name to package name without a cache' do
+ {
+ 'foo' => 'ruby-foo',
+ 'foo-bar_baz' => 'ruby-foo-bar-baz',
+ }.each do |input,output|
+ setup do
+ @dh_make_ruby = Gem2Deb::DhMakeRuby.new('.')
+ end
+ should "convert #{input} to #{output}" do
+ assert_equal output, @dh_make_ruby.gem_name_to_source_package_name(input)
+ end
+ end
+ end
+
protected
def packages
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gem2deb.git
More information about the Pkg-ruby-extras-commits
mailing list