Sha256: 8e1eb0566d5b5a9d0d87dd410eafc4d93a6372b621532c68c9efc3df390199f3

Contents?: true

Size: 416 Bytes

Versions: 5

Compression:

Stored size: 416 Bytes

Contents

require 'curly/attribute_scanner'

module Curly
  class ComponentScanner
    def self.scan(component)
      first, rest = component.split(/\s+/, 2)
      name, identifier = first.split(".", 2)

      if identifier && identifier.end_with?("?")
        name += "?"
        identifier = identifier[0..-2]
      end

      attributes = AttributeScanner.scan(rest)

      [name, identifier, attributes]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
curly-templates-2.2.0 lib/curly/component_scanner.rb
curly-templates-2.1.1 lib/curly/component_scanner.rb
curly-templates-2.1.0 lib/curly/component_scanner.rb
curly-templates-2.1.0.beta2 lib/curly/component_scanner.rb
curly-templates-2.1.0.beta1 lib/curly/component_scanner.rb