bugfix: fix path prefix in folder resolution

This commit is contained in:
Dominik Richter 2015-10-26 00:59:51 +01:00
parent 73b7b3c99a
commit 8f0c9c890e
2 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@
module Vulcano::Targets
module DirsHelper
class ChefAuditDir
class ProfileDir
def handles?(paths)
paths.include?('recipes') and paths.include?('metadata.rb')
end
@ -39,7 +39,7 @@ module Vulcano::Targets
end
HANDLERS = [
ChefAuditDir, ServerspecDir, FlatDir
ProfileDir, ServerspecDir, FlatDir
].map(&:new)
def self.get_handler(paths)

View file

@ -15,7 +15,7 @@ module Vulcano::Targets
# find all files in the folder
files = Dir[File.join(target, '**', '*')]
# remove the prefix
files = files.map { |x| x[target.length + 1..-1] }
files = files.map { |x| x.sub(target, '') }
# get the dirs helper
helper = DirsHelper.get_handler(files)
if helper.nil?