Fixed tests to work with new hash return type from parse
Added ability to pass files to parse method
This commit is contained in:
parent
ce2ea993a8
commit
f2921e82bb
2 changed files with 15 additions and 9 deletions
|
@ -6,7 +6,7 @@ module Microformats2
|
|||
VERSION = "1.0.0"
|
||||
|
||||
def self.parse(html)
|
||||
raise LoadError unless html.is_a?(String)
|
||||
raise LoadError unless [String, File].include?(html.class)
|
||||
doc = Nokogiri::HTML(html)
|
||||
microformats = Hash.new{|hash, key| hash[key] = Array.new}
|
||||
doc.css("*[class^=h-]").each do |microformat|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue