Sha256: 33fc1ea41bd5c21b65d5b2a9f0cf508f63b68fd0fda3177c4af36f5fbb6bb626

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

module Jasmine
  class AssetExpander
    def initialize(bundled_asset_factory, asset_path_for)
      @bundled_asset_factory = bundled_asset_factory
      @asset_path_for = asset_path_for
    end

    def expand(src_dir, src_path)
      pathname = src_path.gsub(/^\/?assets\//, '').gsub(/\.js$/, '')
      bundled_asset = @bundled_asset_factory.call(pathname, 'js')
      return nil unless bundled_asset

      bundled_asset.to_a.map do |asset|
        "/#{@asset_path_for.call(asset).gsub(/^\//, '')}?body=true"
      end.flatten
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
jasmine-multi_json-1.3.2.1 lib/jasmine/asset_expander.rb
jasmine-1.3.2 lib/jasmine/asset_expander.rb