lib/linner/command.rb in linner-0.3.2 vs lib/linner/command.rb in linner-0.4.0
- old
+ new
@@ -16,31 +16,40 @@
end
desc "build", "build assets"
def build
Linner.compile = true
- Notifier.info do
+
+ clean
+
+ Notifier.profile do
Linner.perform
end
end
desc "watch", "watch assets"
def watch
trap :INT do
Notifier.exit
- exit!
+ Process.kill("QUIT", 0)
end
+ clean
+
@proc = Proc.new do |modified, added, removed|
begin
- Notifier.info{ Linner.perform }
+ Notifier.profile{ Linner.perform }
rescue
Notifier.error $!
end
end
@proc.call
Listen.to env.app_folder, env.vendor_folder, env.test_folder do |modified, added, removed|
+ is_include_partial_styles = (modified + added + removed).any? do |path|
+ Asset.new(path).stylesheet? and File.basename(path).start_with? "_"
+ end
+ Linner.cache.reject! {|k, v| v.stylesheet?} if is_include_partial_styles
@proc.call
end
@reactor = Reactor.supervise_as(:reactor).actors.first
Listen.to env.public_folder, relative_path: true do |modified, added, removed|