lib/trackman/assets/asset.rb in trackman-0.0.9 vs lib/trackman/assets/asset.rb in trackman-0.1.0

- old
+ new

@@ -19,12 +19,12 @@ RemoteAsset.new(:path => @path) end def ==(other) return false if other.nil? - other_path = other.path.is_a?(Pathname) ? other.path : Pathname.new(other.path) - other_path.to_s == path.to_s || path.cleanpath == other_path.cleanpath + other_path = other.path.is_a?(Pathname) ? other.path : Pathname.new(other.path) + other_path.to_s == path.to_s || path.realpath == other_path.realpath end def <=>(another) result = 0 @@ -35,18 +35,16 @@ result -= 1 if another.path.extname == '.html' elsif is_child_of(another) result += -1 elsif another.is_child_of(self) result += 1 - else - result = self.path.to_s <=> another.path.to_s end result end def is_child_of(parent) - parent.assets.include? self + parent.is_a?(Components::CompositeAsset) && parent.assets.include?(self) end def self.all return [] unless maintenance_path.exist? \ No newline at end of file