Sha256: 90218fb8f2ba6bf31e6bc721e642750f9dd04a4693c4c33cc305e16eccab3c32

Contents?: true

Size: 343 Bytes

Versions: 12

Compression:

Stored size: 343 Bytes

Contents

module SpecHelpers
  class << self
    def styling_of_node(node)
      if node and node['style'].present?
        parse_styling(node['style'])
      else
        []
      end
    end

    def parse_styling(styles)
      styles.split(';').inject([]) do |array, item|
        array << item.split(':', 2).map(&:strip)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
roadie-2.3.3 spec/support/parse_styling.rb
roadie-2.3.2 spec/support/parse_styling.rb
roadie-2.3.1 spec/support/parse_styling.rb
roadie-2.3.0 spec/support/parse_styling.rb
roadie-2.3.0.pre1 spec/support/parse_styling.rb
roadie-2.2.0 spec/support/parse_styling.rb
roadie-2.1.0 spec/support/parse_styling.rb
roadie-2.1.0.pre2 spec/support/parse_styling.rb
roadie-2.1.0.pre1 spec/support/parse_styling.rb
roadie-2.0.0 spec/support/parse_styling.rb
roadie-1.1.3 spec/support/parse_styling.rb
roadie-1.1.2 spec/support/parse_styling.rb