class Sprockets::Bower::Manifest

Constants

DEFAULT_ASSETS_PATH

Default location where bower stashes its assets.

DEFAULT_BOWERRC_PATH

Default path for the .bowerrc file

Public Class Methods

load(bowerrc_path = DEFAULT_BOWERRC_PATH) click to toggle source

Load a bower Manifest and don't throw an error if the .bowerrc file is not fond.

# File lib/sprockets/bower.rb, line 26
def self.load(bowerrc_path = DEFAULT_BOWERRC_PATH)
  File.exists?(bowerrc_path) ? load!(bowerrc_path) : new
end
load!(bowerrc_path) click to toggle source

Create a new Manifest and configure it with the bowerrc file.

# File lib/sprockets/bower.rb, line 31
def self.load!(bowerrc_path)
  json = JSON.parse File.read bowerrc_path
  new File.expand_path json['directory'], File.dirname(bowerrc_path)
end
new(path = DEFAULT_ASSETS_PATH) click to toggle source

Create a new instance of a bower manifest that we'll pass into sprockets.

# File lib/sprockets/bower.rb, line 15
def initialize(path = DEFAULT_ASSETS_PATH)
  @path = path
end

Public Instance Methods

configure(sprockets) click to toggle source

Configure the sprockets environment.

# File lib/sprockets/bower.rb, line 20
def configure(sprockets)
  sprockets.append_path @path
end