lib/pdd/sources.rb in pdd-0.19.2 vs lib/pdd/sources.rb in pdd-0.19.3

- old
+ new

@@ -26,11 +26,11 @@ # Code base abstraction class Sources # Ctor. # +dir+:: Directory with source code files def initialize(dir, ptns = []) - @dir = dir + @dir = File.absolute_path(dir) @exclude = ptns + ['.git/**/*'] end # Fetch all sources. def fetch @@ -44,13 +44,11 @@ excluded += 1 end end PDD.log.info "#{files.size} file(s) found, #{excluded} excluded" files.reject { |f| binary?(f) }.map do |file| - VerboseSource.new( - file, - Source.new(file, file[@dir.length + 1, file.length]) - ) + path = file[@dir.length + 1, file.length] + VerboseSource.new(path, Source.new(file, path)) end end def exclude(ptn) Sources.new(@dir, @exclude.push(ptn))