lib/rake/funnel/support/specs_remover.rb in rake-funnel-0.6.0.pre vs lib/rake/funnel/support/specs_remover.rb in rake-funnel-0.6.1.pre
- old
+ new
@@ -26,11 +26,11 @@
save(project, xml) if (references + specs).any?
{
project: project,
- packages: resolve_package_names(project, references),
+ packages: resolve_package_names(references),
specs: resolve_paths(project, specs)
}
end
end
@@ -58,23 +58,27 @@
File.open(project, 'w+') do |file|
xml.write(output: file, ie_hack: true)
end
end
- def resolve_package_names(project, references)
- references.map { |r| package_for(project, r) }.compact
+ def resolve_package_names(references)
+ references.map { |r| package_for(r) }.compact
end
- def package_for(project, reference)
- path = File.expand_path(File.join(project, reference))
+ def package_for(reference)
+ path = normalize(reference)
Pathname.new(path).ascend do |p|
break p.parent.basename.to_s if p.basename.to_s == 'lib'
end
end
def resolve_paths(project, files)
- files.map { |f| File.expand_path(File.join(File.dirname(project), f)) }
+ files.map { |f| File.expand_path(File.join(File.dirname(project), normalize(f))) }
+ end
+
+ def normalize(path)
+ path.gsub('\\', File::SEPARATOR)
end
end
end
class PaketReferences