vendor/jruby/1.9/gems/flog-4.2.1/lib/flog.rb
def flog_ruby ruby, file="-", timeout = 10
    flog_ruby! ruby, file, timeout
  rescue Timeout::Error
    warn "TIMEOUT parsing #{file}. Skipping."
  rescue RubyParser::SyntaxError, Racc::ParseError => e
    q = option[:quiet]
    if e.inspect =~ /<\%|%\>/ or ruby =~ /<\%|%\>/ then
      return if q
      warn "#{e.inspect} at #{e.backtrace.first(5).join(', ')}"
      warn "\n...stupid lemmings and their bad erb templates... skipping"
    else
      warn "ERROR: parsing ruby file #{file}" unless q
      unless option[:continue] then
        warn "ERROR! Aborting. You may want to run with --continue."
        raise e
      end
      return if q
      warn "%s: %s at:\n  %s" % [e.class, e.message.strip,
                                 e.backtrace.first(5).join("\n  ")]
    end
  end
##
# Flog the given ruby source, optionally using file to provide paths
# for methods. Smart. Handles syntax errors and timeouts so you
# don't have to.
Flog the given ruby source, optionally using file to provide paths
for methods. Smart. Handles syntax errors and timeouts so you
don't have to.
Flog the given ruby source optionally using file to provide paths for methods . Smart . Handles syntax errors and timeouts so you don ' t have to .
def flog_ruby ruby, file="-", timeout = 10
    flog_ruby! ruby, file, timeout
  rescue Timeout::Error
    warn "TIMEOUT parsing #{file}. Skipping."
  rescue RubyParser::SyntaxError, Racc::ParseError => e
    q = option[:quiet]
    if e.inspect =~ /<\%|%\>/ or ruby =~ /<\%|%\>/ then
      return if q
      warn "#{e.inspect} at #{e.backtrace.first(5).join(', ')}"
      warn "\n...stupid lemmings and their bad erb templates... skipping"
    else
      warn "ERROR: parsing ruby file #{file}" unless q
      unless option[:continue] then
        warn "ERROR! Aborting. You may want to run with --continue."
        raise e
      end
      return if q
      warn "%s: %s at:\n  %s" % [e.class, e.message.strip,
                                 e.backtrace.first(5).join("\n  ")]
    end
  end
def flog_ruby ruby , file = "-" , timeout = 10 flog_ruby! ruby , file , timeout rescue Timeout :: Error warn "TIMEOUT parsing #{file}. Skipping." rescue RubyParser :: SyntaxError , Racc :: ParseError => e q = option [ :quiet ] if e . inspect =~ / < \% |% \> / or ruby =~ / < \% |% \> / then return if q warn "#{e.inspect} at #{e.backtrace.first(5).join(', ')}" warn "\n...stupid lemmings and their bad erb templates... skipping" else warn "ERROR: parsing ruby file #{file}" unless q unless option [ :continue ] then warn "ERROR! Aborting. You may want to run with --continue." raise e end return if q warn "%s: %s at:\n  %s" % [ e . class , e . message . strip , e . backtrace . first ( 5 ) . join ( "\n  " ) ] end end
Flog the given ruby source, optionally using file to provide paths
for methods.
Flog the given ruby source optionally using file to provide paths for methods .
ruby
file
timeout