Sha256: d4a804bb7dc884212a1ac7034433829670c30418e29442ac6429647c0978b36b

Contents?: true

Size: 503 Bytes

Versions: 1

Compression:

Stored size: 503 Bytes

Contents

module EmberCli
  class DirectoryAssetMap
    def initialize(directory)
      @directory = Pathname(directory)
    end

    def to_h
      {
        "assets" => files_with_data,
        "prepend" => "assets/",
      }
    end

    def files_with_data
      files.reduce({}) do |manifest, file|
        name = File.basename(file.path)

        manifest[name] = name

        manifest
      end
    end

    private

    def files
      @directory.children.map { |path| File.new(path) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ember-cli-rails-0.6.0 lib/ember_cli/directory_asset_map.rb