Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Ortuna/padrino-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Padrino Pipeline Padrino Pipeline is a gem for Padrino. It provides a unified way to use several different asset management systems.

Build Status Code Climate Dependency Status

##Supported Pipelines

##Simple Usage

Gemfile

Add to your Gemfile:

gem 'padrino-pipeline'

These examples examples setup a pipeline with defaulted options(see default options):

Sprockets pipeline

module Example
  class App < Padrino::Application
    register Padrino::Pipeline
    configure_assets do |config|
      config.pipeline = Padrino::Pipeline::Sprockets
    end
  end
end

Sinatra AssetPack pipeline

module Example
  class App < Padrino::Application
    register Padrino::Pipeline
    configure_assets do |config|
      config.pipeline = Padrino::Pipeline::AssetPack
    end
  end
end

Options

Certain options can be configured to change the behavior of the pipelines. These options should be used within the configure_assets block.

for example:

module Example
  class App < Padrino::Application
    register Padrino::Pipeline
    configure_assets do |config|
      config.pipeline = Padrino::Pipeline::AssetPack
      config.css_prefix = '/xyz'
    end
  end
end

The following options can be set

Pipeline

  • #pipeline

Assets URI(mounting location) String

  • #css_prefix
  • #js_prefix

Asset location(path to files) String/Array

  • #css_assets
  • #js_assets

Prefix prepend this prefix before all assets

  • #prefix

Default option values

TODO

Asset pack packages

  module Example
    class App < Padrino::Application
      register Padrino::Pipeline
      configure_assets do |config|
        config.pipeline   = Padrino::Pipeline::AssetPack
        config.packages << [:js, :application, '/assets/javascripts/application.js', ['/assets/javascripts/*.js']]
      end
    end
  end

Will serve /assets/javascripts/application.js as a bundle

Sprocket directive require/include/require tree

TODO

About

Sprockets for padrino apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages