[DRE-commits] [gem2deb] 03/06: Don't interpolate path in regular expression when loading templates
Antonio Terceiro
terceiro at moszumanska.debian.org
Mon Dec 2 13:03:21 UTC 2013
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository gem2deb.
commit 323f92a715bc465c3f9a8e71bfb2735da4742e21
Author: Antonio Terceiro <terceiro at debian.org>
Date: Mon Dec 2 09:21:56 2013 -0300
Don't interpolate path in regular expression when loading templates
This fixes the build when the source directory contains regular
expression metacharacters such as '+'
Git-Dch: Full
Closes: #730854
---
lib/gem2deb/dh_make_ruby.rb | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/gem2deb/dh_make_ruby.rb b/lib/gem2deb/dh_make_ruby.rb
index 7ceb53c..723c752 100644
--- a/lib/gem2deb/dh_make_ruby.rb
+++ b/lib/gem2deb/dh_make_ruby.rb
@@ -212,11 +212,10 @@ module Gem2Deb
TEMPLATES_DIR = File.expand_path(File.join(File.dirname(__FILE__), 'dh_make_ruby', 'template'))
def self.load_all
- template_files = Dir.glob("#{TEMPLATES_DIR}/**/*").select { |f| !File.directory?(f) }
- template_files.map do |file|
- filename = file.sub(/^#{TEMPLATES_DIR}\//, '')
+ template_files = Dir.chdir(TEMPLATES_DIR) { Dir.glob("**/*").select { |f| !File.directory?(f) } }
+ template_files.map do |filename|
template = Template.new(filename)
- template.data = File.read(file)
+ template.data = File.read(File.join(TEMPLATES_DIR, filename))
template
end
end
--
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