compass/bin/compass
2010-11-27 17:00:34 -08:00

42 lines
850 B
Ruby
Executable File

#!/usr/bin/env ruby
# The compass command line utility
# This allows compass to run easily from a git checkout without install.
def fallback_load_path(path)
retried = false
begin
yield
rescue LoadError
unless retried
$: << path
retried = true
retry
end
raise
end
end
fallback_load_path(File.join(File.dirname(__FILE__), '..', 'lib')) do
require 'compass'
require 'compass/exec'
end
runner = Proc.new do
command_line_class = Compass::Exec::Helpers.select_appropriate_command_line_ui(ARGV)
command_line_class.new(ARGV).run!
end
if ARGV.delete("--profile")
require 'ruby-prof'
RubyProf.start
exit_code = runner.call
result = RubyProf.stop
# Print a flat profile to text
printer = RubyProf::FlatPrinter.new(result)
printer.print(STDERR, 0)
exit exit_code
else
exit runner.call
end