lib/caravan/deploy.rb in caravan-0.7.0 vs lib/caravan/deploy.rb in caravan-1.0.0.beta1
- old
+ new
@@ -87,15 +87,15 @@
time_str = Time.now.strftime("%H:%M:%S").green
Message.info("#{time_str} Deploying #{src} to #{dst}...")
status = 0
if block_given?
- status, output = yield src, dst
+ status, _output = yield src, dst
debug_msg("Block `run` returned #{status}")
end
- Message.error("Deploying block returned false") unless status == 0
+ Message.error("Deploying block returned false") unless status.zero?
status
end
def after_deploy
if block_given?
@@ -118,10 +118,12 @@
end
def relative_path(path)
working_dir = Dir.pwd
path_routes = path.split(working_dir)
- return nil if path_routes.nil? || path_routes.empty? || path_routes.size < 2
+ return nil if path_routes.nil? ||
+ path_routes.empty? ||
+ path_routes.size < 2
path_routes[-1]
end
private