jasmine-headless-webkit-pre.../Guardfile

49 lines
979 B
Plaintext
Raw Permalink Normal View History

2011-12-12 14:46:21 +00:00
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'livereload' do
watch(%r{.*\.(json|md|scss)$})
end
require 'guard/guard'
require 'sprockets'
require 'sprockets-sass'
require 'sass'
require 'compass'
module ::Guard
class Sprockets < ::Guard::Guard
def initialize(watchers = [], options = {})
@env = ::Sprockets::Environment.new
@env.append_path 'app/assets/stylesheets'
@env.append_path 'app/assets/javascripts'
super
end
def start
::Guard::UI.info "Guard::Sprockets is running..."
end
def run_all
%w{presentation.css presentation.js}.each do |file|
::Guard::UI.info "Rebuilding #{file}..."
begin
File.open(file, 'wb') { |fh| fh.print @env[file].to_s }
rescue StandardError => e
puts e.message
end
end
end
def run_on_change(paths)
run_all
end
end
end
guard 'sprockets' do
watch(%r{^app/assets})
end