Sha256: 29fe99e6d7ce8a24071f2dc16d7f0461f391de9acf24f32b6fbcfc796b43f8f7

Contents?: true

Size: 422 Bytes

Versions: 3

Compression:

Stored size: 422 Bytes

Contents

require 'curly/attribute_scanner'

module Curly
  class ComponentScanner
    def self.scan(component)
      first, rest = component.strip.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

3 entries across 3 versions & 1 rubygems

Version Path
curly-templates-2.3.2 lib/curly/component_scanner.rb
curly-templates-2.3.1 lib/curly/component_scanner.rb
curly-templates-2.3.0 lib/curly/component_scanner.rb