fix fpm for ruby 1.9

This commit is contained in:
Pierre-Yves Ritschard 2011-01-21 11:45:40 +01:00
parent 864f733c99
commit 922751497f
2 changed files with 3 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class FPM::Builder
# TODO: [Jay] make this better.
private
def package_class_for(type)
type = FPM::Target::constants.find { |c| c.downcase == type }
type = FPM::Target::constants.find { |c| c.downcase.to_s == type }
if !type
raise ArgumentError, "unknown package type #{type.inspect}"
end
@ -105,7 +105,7 @@ class FPM::Builder
# TODO: [Jay] make this better.
private
def source_class_for(type)
type = FPM::Source::constants.find { |c| c.downcase == type }
type = FPM::Source::constants.find { |c| c.downcase.to_s == type }
if !type
raise ArgumentError, "unknown package type #{type.inspect}"
end

View File

@ -75,6 +75,7 @@ class FPM::Source
private
def tar(output, paths, chdir=".")
dirs = []
paths = [ paths ] if paths.is_a? String
paths.each do |path|
while path != "/" and path != "."
dirs << path if !dirs.include?(path)