Sha256: 48fadb9add2716dcd7325167f70946682e46323e702d8040e64d17698ae6834d

Contents?: true

Size: 352 Bytes

Versions: 14

Compression:

Stored size: 352 Bytes

Contents

require 'ruby2ruby'

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 Array === sexp
        sexp = Sexp.from_array(YAML::load(YAML::dump(sexp)))
        Ruby2Ruby.new.process(sexp)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
reek-1.3.8 lib/reek/source/sexp_formatter.rb
reek-1.3.7 lib/reek/source/sexp_formatter.rb
reek-1.3.6 lib/reek/source/sexp_formatter.rb
reek-1.3.5 lib/reek/source/sexp_formatter.rb
reek-1.3.4 lib/reek/source/sexp_formatter.rb
reek-1.3.3 lib/reek/source/sexp_formatter.rb
reek-1.3.2 lib/reek/source/sexp_formatter.rb
reek-1.3.1 lib/reek/source/sexp_formatter.rb
reek-1.3 lib/reek/source/sexp_formatter.rb
reek-1.2.13 lib/reek/source/sexp_formatter.rb
reek-1.2.12 lib/reek/source/sexp_formatter.rb
reek-1.2.11 lib/reek/source/sexp_formatter.rb
reek-1.2.10 lib/reek/source/sexp_formatter.rb
reek-1.2.9 lib/reek/source/sexp_formatter.rb