lib/linner/command.rb in linner-0.4.6 vs lib/linner/command.rb in linner-0.5.0
- old
+ new
@@ -13,22 +13,41 @@
desc "version", "show version"
def version
puts Linner::VERSION
end
+ desc "check", "check dependencies"
+ def check
+ message = Linner::Bundler.new(env.bundles).check
+ puts (message.first ? "🍵 :" : "👻 :") + message.last
+ end
+
+ desc "install", "install dependencies"
+ def install
+ begin
+ Linner::Bundler.new(env.bundles).perform
+ rescue
+ puts "👻 : Install failed!"
+ puts $!
+ return
+ end
+ puts "🍵 : Perfect installed all bundles!"
+ end
+
desc "build", "build assets"
def build
Linner.compile = true
clean
- Notifier.profile { Linner.perform }
+ perform
end
desc "watch", "watch assets"
def watch
trap(:INT) { exit! }
clean
- perform_proc.call
+ Linner::Bundler.new(env.bundles).perform
+ perform
watch_for_perform
watch_for_reload
sleep
end
@@ -46,23 +65,23 @@
private
def env
Linner.env
end
- def perform_proc
- @proc ||= Proc.new do
- begin
- Notifier.profile{ Linner.perform }
- rescue
- Notifier.error $!
+ def perform
+ begin
+ Notifier.profile do
+ Linner.perform
end
+ rescue
+ Notifier.error $!
end
end
def watch_for_perform
Listen.to env.watched_paths do |modified, added, removed|
Linner.cache.expire_by(modified + added + removed)
- perform_proc.call
+ perform
end
end
def watch_for_reload
reactor = Reactor.supervise_as(:reactor).actors.first