Sha256: f74f1f41935916e35ff793f65dd28bca56e74f334b5a102d50d18a73ff0d6316

Contents?: true

Size: 392 Bytes

Versions: 3

Compression:

Stored size: 392 Bytes

Contents

module Jasmine::Headless
  class UniqueAssetList < ::Array
    def <<(asset)
      raise InvalidUniqueAsset.new("Not an asset: #{asset.inspect}") 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

  class InvalidUniqueAsset < StandardError ; end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jasmine-headless-webkit-0.8.4 lib/jasmine/headless/unique_asset_list.rb
jasmine-headless-webkit-0.8.3 lib/jasmine/headless/unique_asset_list.rb
jasmine-headless-webkit-0.8.1 lib/jasmine/headless/unique_asset_list.rb