No commit activity in last 3 years
No release in over 3 years
Very Basic Asset Bundler for Capistrano 3.x
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Capistrano Bundle

A fast and simple asset bundling extension for Capistrano 3.x

Modular Asset Capability

A common requirement is to split your css / js into modules organised by folder, so for instance you may have a setup like this:

public/
  stylesheets/
    resets/
      fonts.css
      typography.css
      main.css
    core/
      headers.css
      colors.css
      navigation.css
    blog/
      styles.css
    news/
      styles.css

This capistrano bundle deployer, splits your assets up into modules based on the top-level directory, giving you combined builds of each. The above setup would yield the following build files:

public/
  stylesheets/
    build/
      resets_combined.css
      core_combined.css
      blog_combined.css
      news_combined.css

A similar principle works for Javascript assest too.

Defaults and configuring

You'll need to add the gem to your Gemfile.

gem 'capistrano-bundle'

Then add this to your Capfle:

require 'capistrano/bundle'

The defaults are configure the above behaviour, but are completely customisable.

set :bundle_build_path, fetch(:deploy_to)
set :bundle_dirs, [
    ["public/stylesheets/*/", "**/*.css", "public/stylesheets/build/"],
    ["public/javascripts/*/", "**/*.js",  "public/javascripts/build/"]
]
set :bundle_build_suffix, "_combined"

Contributing

This is a very early example of the functionality quite a few features and options are so-far unavailable. If there's something you'd lke to see open an issue.