Sha256: d98caf04a985791939b126aa988a79ed01c8db37478bf31956e098c562fc74d8

Contents?: true

Size: 652 Bytes

Versions: 7

Compression:

Stored size: 652 Bytes

Contents

require 'rubygems'
require 'ruby_parser'
require 'facets'
require 'erb'

module Simplabs

  module Excellent

    module Parsing

      class Parser #:nodoc:

        def parse(content, filename)
          silence_stream(STDERR) do 
            return silent_parse(content, filename)
          end
        rescue
          #continue on errors
        end

        private

          def silent_parse(content, filename)
            @parser ||= RubyParser.new
            content = ::ERB.new(content, nil, '-').src if filename =~ /\.erb$/
            sexp = @parser.parse(content, filename)
            sexp
          end

      end

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simplabs-excellent-1.4.0 lib/simplabs/excellent/parsing/parser.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/parsing/parser.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/parsing/parser.rb
simplabs-excellent-1.5.0 lib/simplabs/excellent/parsing/parser.rb
simplabs-excellent-1.5.1 lib/simplabs/excellent/parsing/parser.rb
simplabs-excellent-1.5.2 lib/simplabs/excellent/parsing/parser.rb
simplabs-excellent-1.5.3 lib/simplabs/excellent/parsing/parser.rb