lib/linner.rb in linner-0.1.1 vs lib/linner.rb in linner-0.1.2

- old
+ new

@@ -1,14 +1,15 @@ require "linner/version" require "linner/command" require "linner/asset" require "linner/helper" -require "linner/environment" +require "linner/reactor" require "linner/wrapper" require "linner/template" require "linner/notifier" require "linner/compressor" +require "linner/environment" module Linner extend self def root @@ -31,12 +32,11 @@ assets = [] config["concat"].each do |dist, regex| Thread.new do dist = Asset.new(File.join environment.public_folder, dist) dist.content = "" - matches = Dir.glob(File.join root, regex).uniq - matches.sort_by_before_and_after(config["order"]["before"], config["order"]["after"]).each do |m| + Dir.glob(regex).uniq.sort_by_before_and_after(config["order"]["before"], config["order"]["after"]).each do |m| asset = Asset.new(m) content = asset.content if asset.wrappable? content = asset.wrap end @@ -49,14 +49,13 @@ end def copy(config) config["copy"].each do |dist, regex| Thread.new do - matches = Dir.glob(File.join root, regex) - matches.each do |path| + Dir.glob(regex).each do |path| asset = Asset.new(path) asset.path = File.join(environment.public_folder, dist, asset.logical_path) - next if File.exist?(asset.path) and FileUtils.uptodate?(path, [asset.path]) + next if File.exist?(asset.path) and File.identical?(path, asset.path) asset.write end end.join end end