Sha256: 2fb6db925a1af3480d996e499c0c3cfa7a1ac03925801d2a5ba372e4023cc6d3

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

module Spontaneous
  module Output
    module Assets
      extend self

      def compress_js(file_paths, options={})
        Compression.compress_js(file_paths, options)
      end

      def url(file = nil)
        Spontaneous::Output.asset_url(file)
      end

      def path_for(revision, path = nil)
        File.join [Spontaneous::Output.asset_path(revision), path].compact
      end

      def find_file(*relative_paths)
        relative_paths.flatten!
        Spontaneous.instance.paths.expanded(:public).each do |root|
          relative_paths.each do |relative_path|
            path = root / relative_path
            return path if ::File.exist?(path)
          end
        end
        nil
      end

      autoload :Compression, "spontaneous/output/assets/compression"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta1 lib/spontaneous/output/assets.rb
spontaneous-0.2.0.alpha7 lib/spontaneous/output/assets.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/output/assets.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/output/assets.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/output/assets.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/output/assets.rb