Skip to content

Instantly share code, notes, and snippets.

@thykka
Forked from dvessel/README.mdown
Last active August 29, 2015 14:21
Show Gist options
  • Save thykka/8f565774bb4d14d994ab to your computer and use it in GitHub Desktop.
Save thykka/8f565774bb4d14d994ab to your computer and use it in GitHub Desktop.
Boilerscoop
notification :off
puts "Using default guard file."
group :development do
if File.exists?("./config.rb")
# Time to compile!
puts `compass compile --time --quiet`
# https://github.com/guard/guard-compass
guard :compass do
watch(%r{(.*)\.s[ac]ss$})
end
end
guard :livereload do
watch(%r{.+\.(css|js|html?|php|inc|theme)$})
end
end

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

The following instructions is specific to Mac OS X and it works through the command line.

Instructions

Update Gem system then install Bundler. Note that if you've done this before, there's no need to do it every time.

$ sudo gem update --system
$ sudo gem install bundler

Place the Gemfile and .guardfile attached to this gist into your home folder then type:

$ bundle

cd to your project and compass init and configure the generated config.rb file. See example file below.

In your project folder, start the Guard, enable the Browser plug-in and start editing.

$ bundle exec guard

To exit enter e and enter.

require 'compass/import-once/activate'
# Require any additional compass plugins here.
# Sass options (http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options)
sass_options = Hash.new
sass_options[:debug_info] = false
# Compass config (http://compass-style.org/help/tutorials/configuration-reference)
# Compile for production with: $ compass compile -e production --force
css_dir = "css"
sass_dir = "sass"
fonts_dir = "fonts"
javascripts_dir = "js"
images_dir = "img"
relative_assets = true
output_style = (environment == :production ? :compressed : :expanded)
# ~/Gemfile
source "http://rubygems.org"
group :development do
gem 'sass' # Sass.
gem 'compass' # Framework built on Sass.
gem 'compass-validator' # So you can `compass validate`.
gem 'css_parser' # Helps `compass stats` output statistics.
gem 'guard' # Guard event handler.
gem 'guard-compass' # Compile on sass/scss change.
gem 'guard-shell' # Run shell commands.
gem 'guard-livereload' # Browser reload.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment