lib/html2rss/utils.rb in html2rss-0.4.1 vs lib/html2rss/utils.rb in html2rss-0.5.0

- old
+ new

@@ -1,6 +1,10 @@ +require 'active_support/core_ext/hash' +require 'builder' require 'hashie' +require 'json' +require 'nokogiri' module Html2rss module Utils ## # A Hash with indifferent access, build with {https://github.com/intridea/hashie Hashie}. @@ -17,8 +21,12 @@ URI(channel_url).tap do |uri| uri.path = url.path.to_s.start_with?('/') ? url.path : "/#{url.path}" uri.query = url.query uri.fragment = url.fragment if url.fragment end + end + + def self.hash_to_xml(hash) + hash.to_xml(root: :html, skip_instruct: true, skip_types: true) end end end