Sha256: f933740550cdee857331bd371aa050a4b80a4d52857d553dd83cebe3a5f9b110

Contents?: true

Size: 878 Bytes

Versions: 2

Compression:

Stored size: 878 Bytes

Contents

module Jammit
  
  module Lite
    
    # returns hash of bundle file arrays keyed by bundle name
    def self.assets(type)
      hash = asset_hash[type].symbolize_keys
      assets = hash.inject({}) do |out,array|   
        key,paths = array
        out[key] = paths.map { |path| Jammit::Lite::Asset.new(path) }
        out
      end
    end
    
    
    # returns hash from config/assets.yml
    # expands all wildcard paths
    def self.asset_hash
      yaml = File.open("#{Rails.root}/config/assets.yml")
      hash = YAML::load(yaml).symbolize_keys
      hash.each do |key,bundles|
        bundles.each { |name,files| bundles[name] = Jammit::Lite::Bundle.expand(files) }
      end
    end
    
  end

end

require 'jammit' unless Rails.env.production?
files = %w(routes bundle asset helper)
files.each { |file| require "#{File.dirname(__FILE__)}/jammit/lite/#{file}"  }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jammit_lite-0.1.1 lib/jammit_lite.rb
jammit_lite-0.1.0 lib/jammit_lite.rb