Sha256: 3a061ed7deb0cbc8ba4bc2568900d73d12027a3b867f281ff8d98ad45547a1ba
Contents?: true
Size: 490 Bytes
Versions: 15
Compression:
Stored size: 490 Bytes
Contents
old_verbose, $VERBOSE = $VERBOSE, nil require 'unparser' $VERBOSE = old_verbose module Reek module Source # # Formats snippets of syntax tree back into Ruby source code. # class SexpFormatter def self.format(sexp) return sexp.to_s unless sexp.is_a? AST::Node lines = Unparser.unparse(sexp).split "\n" if lines.length > 1 "#{lines.first} ... #{lines.last}" else lines.first end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems