lib/mina/helpers/internal.rb in mina-1.0.0.beta2 vs lib/mina/helpers/internal.rb in mina-1.0.0.beta3

- old
+ new

@@ -1,9 +1,9 @@ module Mina module Helpers module Internal - extend Configuration::DSL + include Helpers::Output def deploy_script yield erb Mina.root_path(fetch(:deploy_script)) end @@ -27,22 +27,27 @@ end def report_time time_start = Time.now output = yield - puts "Elapsed time: %.2f seconds" % [Time.now - time_start] + print_info "Elapsed time: %.2f seconds" % [Time.now - time_start] output end def next_version case fetch(:version_scheme) when :datetime Time.now.utc.strftime("%Y%m%d%H%M%S") when :sequence "$((`ls -1 #{fetch(:releases_path)} | sort -n | tail -n 1`+1))" else - fail 'Unrecognizes version scheme. Use :datetime or :sequence' + error! 'Unrecognizes version scheme. Use :datetime or :sequence' end + end + + def error!(message) + print_error message + exit 1 end end end end extend Mina::Helpers::Internal