0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Easy to use helper to work with your assets
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Fallback Asset Gem

Create fallbacks to your assets. Helpful to work with development and cdn assets.

Gem Version Build Status

Installation

In your Gemfile:

gem 'fallback_assets'

Features

  • Add assets (javascripts / stylesheets) to your codebase with fallback to local files
  • Great to use with CDN assets (first idea)
  • The local asset will be used if the CDN is not available
  • Easy to config

How to use

Single use

= fallback_javascript :underscore
= fallback_stylesheet :normalize

Configuration

Create a file config/fallback_assets.yml under your rails app.

fallbacks:
  stylesheets:
    normalize:
      production: //cdn/normalize.min.css
      development: /assets/normalize.css
      test: /assets/normalize.css

  javascripts:
    jquery:
      production: //cdn/jquery.min.js
      development: /assets/jquery.js
      test: /assets/jquery.js

Tips-for-Troubleshooting

If you are expecting errors while your tests are running, set the test environment like this:

...
underscore:
  development: /assets/underscore.js
  production: //whatevercdn/underscore.min.js
  test: /assets/underscore.js # this is important, to access a file from vendor/assets/javascripts, use: /assets

License

MIT License © Djalma Araújo