-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcompass.rb
More file actions
31 lines (26 loc) · 966 Bytes
/
compass.rb
File metadata and controls
31 lines (26 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require "zurb-foundation"
# -----------------------------------------------
# Paths
# -----------------------------------------------
http_path = "/"
css_dir = "asset/css"
images_dir = "asset/image"
javascripts_dir = "asset/js"
sass_dir = "_sass"
# -----------------------------------------------
# Output
# -----------------------------------------------
output_style = :compressed
preferred_syntax = :sass
relative_assets = true
# -----------------------------------------------
# haml watcher
# -----------------------------------------------
watch "#{File.dirname(__FILE__)}/**/haml/*.haml" do |project_dir, relative_path|
if File.exists?(File.join(project_dir, relative_path))
target = File.join(project_dir, relative_path.gsub('haml/','').gsub('.haml', '.html'))
source = File.join(project_dir, relative_path)
puts "Generating #{target} from #{source}"
`bundle exec haml #{File.join(project_dir, relative_path)} #{target}`
end
end