jasmine-headless-webkit/lib/jasmine/headless/unique_asset_list.rb
2011-11-25 16:18:06 -05:00

15 lines
319 B
Ruby

module Jasmine::Headless
class UniqueAssetList < ::Array
def <<(asset)
raise StandardError.new("Not an asset") if !asset.respond_to?(:logical_path)
super if !self.any? { |other| asset.logical_path == other.logical_path }
end
def flatten
self.collect(&:to_a).flatten
end
end
end