Sha256: abfee759e14e282082d7fde87a76237fa5f12efed6d9ea12f4f21f76d566ca0b

Contents?: true

Size: 368 Bytes

Versions: 12

Compression:

Stored size: 368 Bytes

Contents

require 'nokogiri'

module Deck
  # Wrappers around Nokogiri's occasionally inscrutable API
  module Noko
    def noko_html nokogiri_node
      nokogiri_node.serialize(:save_with => 0).chomp
    end

    def noko_doc html_snippet
      html_doc = html_snippet =~ /<html/ ? html_snippet : "<html>#{html_snippet}</html>"
      Nokogiri.parse(html_doc)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
deckrb-0.5.2 lib/deck/noko.rb
deckrb-0.5.1 lib/deck/noko.rb
deckrb-0.5.0 lib/deck/noko.rb
deckrb-0.4.2 lib/deck/noko.rb
deckrb-0.4.1 lib/deck/noko.rb
deckrb-0.4.0 lib/deck/noko.rb
deckrb-0.3.1 lib/deck/noko.rb
deckrb-0.3.0 lib/deck/noko.rb
deckrb-0.2.2 lib/deck/noko.rb
deckrb-0.2.1 lib/deck/noko.rb
deckrb-0.2.0 lib/deck/noko.rb
deckrb-0.1.1 lib/deck/noko.rb