Code Monkey home page Code Monkey logo

guard-sprockets2's Introduction

Guard Sprockets 2

A Guard for Sprockets 2 that works with Rails, Sinatra or any other Rack app.

Usage

Add it to your Gemfile:

gem 'guard-sprockets2'

Add the guard definition to your Guardfile:

bundle exec guard init sprockets2

Configure guard for your environment. The following options are available:

  • sprockets - Required. Set it to an instance of Sprockets::Environment
  • assets_path - Optional. The compiled assets path. Defaults to public/assets
  • precompile - Optional. An array of regex's or strings which match files that need compiling. Defaults to [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ]
  • digest - Optional. Whether to include the digest in the filename. Defaults to true.
  • gz - Optional. Whether to compile a gzipped version of each file. Defaults to true.
  • clean - Optional. Whether to remove all files in the asset path. Defaults to true.
  • manifest - Optional. Whether to generate a manifest.yml file. Defaults to false.
  • manifest_path - Optional. Where to generate the manifest file. Defaults same as assets_path.

Example Rails and Sinatra apps can be found in the examples directory.

Sinatra

require './app'

guard 'sprockets2', :sprockets => App.sprockets do
  watch(%r{^assets/.+$})
  watch('app.rb')
end

Rails

When Rails is loaded the defaults come from Rails' configuration.

require './config/environment'

guard 'sprockets2' do
  watch(%r{^app/assets/.+$})
  watch('config/application.rb')
end

guard-sprockets2's People

Contributors

cyu avatar stevehodgkiss avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.