Sha256: 4250e6b45709419e18b24d60fe2a46953628432d38fd50705d849a1cdb164510
Contents?: true
Size: 913 Bytes
Versions: 2
Compression:
Stored size: 913 Bytes
Contents
require 'hangry/recipe_parser' require 'hangry/default_recipe_parser' require 'hangry/hrecipe_parser' require 'hangry/schema_org_recipe_parser' require 'hangry/data_vocabulary_recipe_parser' require 'hangry/parsers/non_standard/all_recipes_parser' require 'hangry/parsers/non_standard/eating_well_parser' require 'hangry/parsers/non_standard/taste_of_home_parser' module Hangry class ParserClassSelecter def initialize(html) @html = html end def parser_class # Prefer the more specific parsers parser_classes = [ Parsers::NonStandard::AllRecipesParser, Parsers::NonStandard::EatingWellParser, Parsers::NonStandard::TasteOfHomeParser ] parser_classes += [SchemaOrgRecipeParser, HRecipeParser, DataVocabularyRecipeParser] parser_classes << DefaultRecipeParser parser_classes.detect { |p| p.can_parse?(@html) } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hangry-0.0.13 | lib/hangry/parser_class_selecter.rb |
hangry-0.0.12 | lib/hangry/parser_class_selecter.rb |