require 'html2rss/config'
require 'html2rss/feed_builder'
require 'html2rss/version'
require 'html2rss/utils'
require 'yaml'
##
# The Html2rss namespace.
# Request HTML from an URL and transform it to a RSS 2.0 object.
module Html2rss
##
# Returns a RSS object which is generated from the provided file.
#
# `file_path`: a File object of a YAML file
# `name`: the of the feed
#
# Example:
#
# feed = Html2rss.feed_from_yaml_config(File.join(['spec', 'config.test.yml']), 'nuxt-releases')
# # => # ul > li' },
# title: { selector: 'a' },
# link: { selector: 'a', extractor: 'href' }
# }
# )
# # => #
# @return [RSS:Rss]
def self.feed(config)
config = Config.new(config) unless config.is_a?(Config)
feed = FeedBuilder.new config
feed.rss
end
end