forked from bonsaiERP/bonsaiERP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.watchr.rb
27 lines (22 loc) · 611 Bytes
/
.watchr.rb
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
def run_spec(file)
unless File.exist?(file)
puts "#{file} does not exist"
return
end
puts "Running #{file}"
system "bundle exec rspec #{file}"
puts
end
watch("spec/.*/*_spec\.rb") do |match|
run_spec match[0]
end
watch("app/(.*/.*)\.rb") do |match|
run_spec %{spec/#{match[1]}_spec.rb}
end
watch("lib/pay_plans_module.rb") do
run_spec %{spec/models/transaction_spec.rb}
end
watch("app/assets/twitter-bootstrap/(.*)\.less") do |match|
system("lessc app/assets/twitter-bootstrap/bootstrap.less > app/assets/stylesheets/twitter-bootstrap.css.scss")
puts "Compiling less files"
end