Class: Lotus::Assets::Bundler Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/assets/bundler.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Bundle assets from a single application.

Since:

  • 0.1.0

Constant Summary collapse

DEFAULT_PERMISSIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

0644
JAVASCRIPT_EXT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

'.js'.freeze
STYLESHEET_EXT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

'.css'.freeze
WILDCARD_EXT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

'.*'.freeze
URL_SEPARATOR =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

'/'.freeze
URL_REPLACEMENT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

''.freeze

Instance Method Summary collapse

Constructor Details

#initialize(configuration, duplicates) ⇒ Lotus::Assets::Bundler

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return a new instance

Parameters:

Since:

  • 0.1.0



47
48
49
50
51
52
53
54
55
# File 'lib/lotus/assets/bundler.rb', line 47

def initialize(configuration, duplicates)
  @manifest       = Hash.new
  @configuration  = configuration
  @configurations = if duplicates.empty?
                      [@configuration]
                    else
                      duplicates.map(&:configuration)
                    end
end

Instance Method Details

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Start the process.

For each asset contained in the sources and third party gems, it will:

* Compress
* Create a checksum version

At the end it will generate a digest manifest



69
70
71
72
73
74
75
76
77
78
# File 'lib/lotus/assets/bundler.rb', line 69

def run
  assets.each do |asset|
    next if ::File.directory?(asset)

    compress(asset)
    checksum(asset)
  end

  generate_manifest
end