Sha256: b108c52b840c55b4c2c3ff9e680bd709bc3a2cefa41300586e8b7ddc90e319e5

Contents?: true

Size: 649 Bytes

Versions: 5

Compression:

Stored size: 649 Bytes

Contents

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

module Simplabs

  module Excellent

    module Parsing

      class Parser #:nodoc:

        def parse(content, filename)
          return silent_parse(content, filename)
        rescue Exception
          #continue on errors
        end

        private

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

      end

    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
excellent-2.1.0 lib/simplabs/excellent/parsing/parser.rb
excellent-2.0.1 lib/simplabs/excellent/parsing/parser.rb
excellent-2.0.0 lib/simplabs/excellent/parsing/parser.rb
excellent-1.7.2 lib/simplabs/excellent/parsing/parser.rb
excellent-1.7.1 lib/simplabs/excellent/parsing/parser.rb