Skip to content

Instantly share code, notes, and snippets.

@mikeyp
Created May 14, 2014 19:10
Show Gist options
  • Save mikeyp/62ac8738b1402691147d to your computer and use it in GitHub Desktop.
Save mikeyp/62ac8738b1402691147d to your computer and use it in GitHub Desktop.
source "http://rubygems.org"
# Gems
gem 'nanoc'
gem 'adsf'
gem 'kramdown'
gem 'compass'
# Guard support
gem 'guard'
gem 'guard-nanoc'
gem 'guard-shell'
gem 'guard-livereload'
gem 'guard-webrick', :github => 'mikemcquaid/guard-webrick', :branch => 'support-newer-guard'
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'nanoc' do
watch('nanoc.yaml') # Change this to config.yaml if you use the old config file name
watch('Rules')
watch(%r{^(content|layouts|lib)/.*$})
end
guard 'webrick', :host => '127.0.0.1', :port => '3333', :docroot => 'output' do
end
guard 'livereload' do
watch(%r{output/.+\.(css|js|html)})
end
# Add files and commands to this file, like the example:
# watch(%r{file/path}) { `command(s)` }
guard :shell, all_on_start: true do
watch(/.*\.scss$/) do |m|
`sassc -l lib/sass/style.scss > content/css/style.css`
end
end
task :default => :guard
task :build do
bundle 'sassc -t compressed lib/sass/style.scss > content/css/style.css'
bundle 'nanoc'
end
desc 'Start guard'
task :guard do
bundle 'guard'
end
def bundle(opts = '')
sh 'bundle exec ' + opts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment