Sha256: bed6a07788310876933324ad374fcf82a4b3c11c572257ddea111cc4cbb4ded1

Contents?: true

Size: 643 Bytes

Versions: 12

Compression:

Stored size: 643 Bytes

Contents

require "rabbit/utils"

dir = File.join("rabbit", "parser")
Rabbit::Utils.require_files_under_directory_in_load_path(dir)

module Rabbit
  module Parser
    module_function
    def parse(canvas, source)
      parser = Base.find_loader(source)
      if parser.nil?
        format = _("unsupported format. (supported: %s)")
        loader_names = Base.loaders.collect {|loader| loader.name}
        message = format % "[#{loader_names.join(', ')}]"
        raise UnsupportedFormatError.new(message)
      end
      parser.new(canvas, source).parse
    end

    def normalize_property_name(name)
      name.gsub(/_/, "-").strip
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rabbit-1.0.4 lib/rabbit/parser.rb
rabbit-1.0.3 lib/rabbit/parser.rb
rabbit-1.0.2 lib/rabbit/parser.rb
rabbit-1.0.1 lib/rabbit/parser.rb
rabbit-1.0.0 lib/rabbit/parser.rb
rabbit-0.9.3 lib/rabbit/parser.rb
rabbit-0.9.2 lib/rabbit/parser.rb
rabbit-0.9.1 lib/rabbit/parser.rb
rabbit-0.9.0 lib/rabbit/parser.rb
rabbit-0.6.4 lib/rabbit/parser.rb
rabbit-0.6.3 lib/rabbit/parser.rb
rabbit-0.6.2 lib/rabbit/parser.rb