module Compass::Exec::Helpers

Public Instance Methods

get_file(exception) click to toggle source
# File lib/compass/exec/helpers.rb, line 13
def get_file(exception)
  exception.backtrace[0].split(%r:/, 2)[0]
end
get_line(exception) click to toggle source
# File lib/compass/exec/helpers.rb, line 17
def get_line(exception)
  exception.backtrace[0].scan(%r:(\d+)/)[0]
end
report_error(e, options) click to toggle source
# File lib/compass/exec/helpers.rb, line 4
def report_error(e, options)
  $stderr.puts "#{e.class} on line #{get_line e} of #{get_file e}: #{e.message}"
  if options[:trace]
    e.backtrace[1..-1].each { |t| $stderr.puts "  #{t}" }
  else
    $stderr.puts "Run with --trace to see the full backtrace"
  end
end