lib/trackman/assets/asset.rb in trackman-0.0.6 vs lib/trackman/assets/asset.rb in trackman-0.0.8
- 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.realpath == other_path.realpath
+ 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
end
def <=>(another)
result = 0
@@ -35,16 +35,18 @@
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.is_a?(Components::CompositeAsset) && parent.assets.include?(self)
+ parent.assets.include? self
end
def self.all
return [] unless maintenance_path.exist?
\ No newline at end of file