Sha256: 4f15fdcd90acb94e2fc1e25f64d3e7f67a6556f7a9c9679cc0ad22466b8ccd3b

Contents?: true

Size: 523 Bytes

Versions: 4

Compression:

Stored size: 523 Bytes

Contents

# Top-level module for Ripper Plus. Provides global methods for
# getting a RipperPlus AST for a given input program.
module RipperPlus
  DEFAULT_OPTS = {:in_place => false}
  # Parses the given Ruby code into a RipperPlus AST.
  def self.sexp(text, opts={})
    for_ripper_ast(Ripper.sexp(text), opts.merge(:in_place => true))
  end
  
  # Transforms the provided Ripper AST into a RipperPlus AST.
  def self.for_ripper_ast(tree, opts={})
    opts = DEFAULT_OPTS.merge(opts)
    Transformer.transform(tree, opts)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ripper-plus-1.3.0 lib/ripper-plus/ripper-plus.rb
ripper-plus-1.2.2 lib/ripper-plus/ripper-plus.rb
ripper-plus-1.2.1 lib/ripper-plus/ripper-plus.rb
ripper-plus-1.2.0 lib/ripper-plus/ripper-plus.rb