microformats 4.0.7 → 4.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +10 -0
- data/.gitignore +33 -15
- data/.rspec +3 -2
- data/.rubocop +3 -0
- data/.rubocop.yml +25 -0
- data/.ruby-version +1 -0
- data/.simplecov +11 -0
- data/.travis.yml +14 -2
- data/CONTRIBUTING.md +103 -0
- data/Guardfile +2 -2
- data/LICENSE +116 -0
- data/README.md +112 -172
- data/Rakefile +6 -7
- data/bin/microformats +10 -9
- data/lib/microformats.rb +15 -14
- data/lib/microformats/absolute_uri.rb +4 -8
- data/lib/microformats/format_parser.rb +271 -251
- data/lib/microformats/parser.rb +38 -38
- data/lib/microformats/parser_core.rb +142 -109
- data/lib/microformats/property_parser.rb +42 -65
- data/lib/microformats/results/collection.rb +19 -38
- data/lib/microformats/results/parser_result.rb +25 -37
- data/lib/microformats/results/property_set.rb +24 -31
- data/lib/microformats/time_property_parser.rb +122 -118
- data/lib/microformats/version.rb +1 -1
- data/logo.svg +23 -0
- data/microformats.gemspec +35 -33
- metadata +140 -442
- data/LICENSE.md +0 -36
- data/spec/lib/microformats/absolute_uri_spec.rb +0 -56
- data/spec/lib/microformats/parser_spec.rb +0 -132
- data/spec/lib/microformats_spec.rb +0 -33
- data/spec/spec_helper.rb +0 -10
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-0.html +0 -2
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-0.js +0 -9
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-1.html +0 -2
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-1.js +0 -10
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-2.html +0 -5
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-2.js +0 -11
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-3.html +0 -17
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-3.js +0 -20
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-4.html +0 -16
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-4.js +0 -24
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-5.html +0 -7
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-5.js +0 -11
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-6.html +0 -9
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-6.js +0 -18
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-7.html +0 -9
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-7.js +0 -18
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-8.html +0 -9
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-8.js +0 -17
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-9.html +0 -9
- data/spec/support/cases/microformats.org/microformats-2/microformats-2-9.js +0 -17
- data/spec/support/lib/edge_cases/blank_href.html +0 -23
- data/spec/support/lib/edge_cases/blank_href.js +0 -15
- data/spec/support/lib/edge_cases/blank_rel.html +0 -23
- data/spec/support/lib/edge_cases/blank_rel.js +0 -41
- data/spec/support/lib/edge_cases/blank_src.html +0 -24
- data/spec/support/lib/edge_cases/blank_src.js +0 -16
- data/spec/support/lib/edge_cases/blank_value.html +0 -5
- data/spec/support/lib/edge_cases/blank_value.js +0 -19
- data/spec/support/lib/edge_cases/relative.html +0 -29
- data/spec/support/lib/edge_cases/relative.js +0 -15
- data/spec/support/lib/edge_cases/vcp-dates.html +0 -13
- data/spec/support/lib/edge_cases/vcp-dates.js +0 -30
- data/spec/support/lib/microformats/blank_href.html +0 -23
- data/spec/support/lib/microformats/blank_href.js +0 -11
- data/spec/support/lib/microformats/implied_property/name-fail.html +0 -60
- data/spec/support/lib/microformats/implied_property/name-pass.html +0 -30
- data/spec/support/lib/microformats/implied_property/photo-fail.html +0 -60
- data/spec/support/lib/microformats/implied_property/photo-pass.html +0 -30
- data/spec/support/lib/microformats/implied_property/url-fail.html +0 -18
- data/spec/support/lib/microformats/implied_property/url-pass.html +0 -12
- data/spec/support/lib/microformats/implied_property/url-relative.html +0 -13
- data/spec/support/lib/microformats/implied_property/url-unnormalized.html +0 -12
- data/spec/support/lib/microformats/nested-format-with-property-of-same-name.html +0 -13
- data/spec/support/lib/microformats/nested-format-with-property-of-same-name.js +0 -16
- data/spec/support/lib/microformats/nested-format-with-property.html +0 -12
- data/spec/support/lib/microformats/nested-format-with-property.js +0 -16
- data/spec/support/lib/microformats/nested-format-without-property.html +0 -13
- data/spec/support/lib/microformats/nested-property.html +0 -12
- data/spec/support/lib/microformats/nested-property.js +0 -10
- data/spec/support/lib/microformats/rels-that-drop-the-base.html +0 -11
- data/spec/support/lib/microformats/rels-with-unnormalized-urls.html +0 -11
- data/spec/support/lib/microformats/rels.html +0 -12
- data/spec/support/lib/microformats/rels.js +0 -13
- data/spec/support/lib/microformats/simple.html +0 -23
- data/spec/support/lib/microformats/simple.js +0 -11
- data/vendor/tests/.gitignore +0 -25
- data/vendor/tests/LICENSE.md +0 -36
- data/vendor/tests/README.md +0 -48
- data/vendor/tests/app.js +0 -84
- data/vendor/tests/composer.json +0 -5
- data/vendor/tests/css/testsuite.css +0 -159
- data/vendor/tests/interface.js +0 -18
- data/vendor/tests/package.json +0 -27
- data/vendor/tests/tests/microformats-mixed/h-card/change-log.html +0 -63
- data/vendor/tests/tests/microformats-mixed/h-card/mixedpropertries.html +0 -14
- data/vendor/tests/tests/microformats-mixed/h-card/mixedpropertries.json +0 -22
- data/vendor/tests/tests/microformats-mixed/h-card/tworoots.html +0 -1
- data/vendor/tests/tests/microformats-mixed/h-card/tworoots.json +0 -10
- data/vendor/tests/tests/microformats-mixed/h-entry/mixedroots.html +0 -16
- data/vendor/tests/tests/microformats-mixed/h-entry/mixedroots.json +0 -38
- data/vendor/tests/tests/microformats-mixed/h-resume/change-log.html +0 -68
- data/vendor/tests/tests/microformats-mixed/h-resume/mixedroots.html +0 -16
- data/vendor/tests/tests/microformats-mixed/h-resume/mixedroots.json +0 -31
- data/vendor/tests/tests/microformats-v1/adr/change-log.html +0 -63
- data/vendor/tests/tests/microformats-v1/adr/simpleproperties.html +0 -8
- data/vendor/tests/tests/microformats-v1/adr/simpleproperties.json +0 -15
- data/vendor/tests/tests/microformats-v1/geo/abbrpattern.html +0 -5
- data/vendor/tests/tests/microformats-v1/geo/abbrpattern.json +0 -11
- data/vendor/tests/tests/microformats-v1/geo/change-log.1.html +0 -78
- data/vendor/tests/tests/microformats-v1/geo/change-log.html +0 -63
- data/vendor/tests/tests/microformats-v1/geo/hidden.html +0 -10
- data/vendor/tests/tests/microformats-v1/geo/hidden.json +0 -11
- data/vendor/tests/tests/microformats-v1/geo/simpleproperties.html +0 -6
- data/vendor/tests/tests/microformats-v1/geo/simpleproperties.json +0 -11
- data/vendor/tests/tests/microformats-v1/geo/valuetitleclass.html +0 -11
- data/vendor/tests/tests/microformats-v1/geo/valuetitleclass.json +0 -11
- data/vendor/tests/tests/microformats-v1/hcalendar/ampm.html +0 -41
- data/vendor/tests/tests/microformats-v1/hcalendar/ampm.json +0 -21
- data/vendor/tests/tests/microformats-v1/hcalendar/attendees.html +0 -13
- data/vendor/tests/tests/microformats-v1/hcalendar/attendees.json +0 -37
- data/vendor/tests/tests/microformats-v1/hcalendar/change-log.html +0 -68
- data/vendor/tests/tests/microformats-v1/hcalendar/combining.html +0 -15
- data/vendor/tests/tests/microformats-v1/hcalendar/combining.json +0 -31
- data/vendor/tests/tests/microformats-v1/hcalendar/concatenate.html +0 -7
- data/vendor/tests/tests/microformats-v1/hcalendar/concatenate.json +0 -12
- data/vendor/tests/tests/microformats-v1/hcalendar/time.html +0 -44
- data/vendor/tests/tests/microformats-v1/hcalendar/time.json +0 -22
- data/vendor/tests/tests/microformats-v1/hcard/change-log.html +0 -68
- data/vendor/tests/tests/microformats-v1/hcard/email.html +0 -14
- data/vendor/tests/tests/microformats-v1/hcard/email.json +0 -11
- data/vendor/tests/tests/microformats-v1/hcard/format.html +0 -6
- data/vendor/tests/tests/microformats-v1/hcard/format.json +0 -11
- data/vendor/tests/tests/microformats-v1/hcard/hyperlinkedphoto.html +0 -3
- data/vendor/tests/tests/microformats-v1/hcard/hyperlinkedphoto.json +0 -8
- data/vendor/tests/tests/microformats-v1/hcard/justahyperlink.html +0 -1
- data/vendor/tests/tests/microformats-v1/hcard/justahyperlink.json +0 -8
- data/vendor/tests/tests/microformats-v1/hcard/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v1/hcard/justaname.json +0 -8
- data/vendor/tests/tests/microformats-v1/hcard/multiple.html +0 -74
- data/vendor/tests/tests/microformats-v1/hcard/multiple.json +0 -65
- data/vendor/tests/tests/microformats-v1/hcard/name.html +0 -11
- data/vendor/tests/tests/microformats-v1/hcard/name.json +0 -15
- data/vendor/tests/tests/microformats-v1/hcard/single.html +0 -14
- data/vendor/tests/tests/microformats-v1/hcard/single.json +0 -24
- data/vendor/tests/tests/microformats-v1/hentry/change-log.html +0 -73
- data/vendor/tests/tests/microformats-v1/hentry/summarycontent.html +0 -20
- data/vendor/tests/tests/microformats-v1/hentry/summarycontent.json +0 -24
- data/vendor/tests/tests/microformats-v1/hfeed/simple.html +0 -30
- data/vendor/tests/tests/microformats-v1/hfeed/simple.json +0 -49
- data/vendor/tests/tests/microformats-v1/hnews/all.html +0 -37
- data/vendor/tests/tests/microformats-v1/hnews/all.json +0 -74
- data/vendor/tests/tests/microformats-v1/hnews/change-log.html +0 -72
- data/vendor/tests/tests/microformats-v1/hnews/minimum.html +0 -25
- data/vendor/tests/tests/microformats-v1/hnews/minimum.json +0 -48
- data/vendor/tests/tests/microformats-v1/hproduct/aggregate.html +0 -26
- data/vendor/tests/tests/microformats-v1/hproduct/aggregate.json +0 -52
- data/vendor/tests/tests/microformats-v1/hproduct/change-log.html +0 -62
- data/vendor/tests/tests/microformats-v1/hproduct/simpleproperties.html +0 -13
- data/vendor/tests/tests/microformats-v1/hproduct/simpleproperties.json +0 -33
- data/vendor/tests/tests/microformats-v1/hresume/affiliation.html +0 -12
- data/vendor/tests/tests/microformats-v1/hresume/affiliation.json +0 -25
- data/vendor/tests/tests/microformats-v1/hresume/change-log.html +0 -73
- data/vendor/tests/tests/microformats-v1/hresume/contact.html +0 -18
- data/vendor/tests/tests/microformats-v1/hresume/contact.json +0 -32
- data/vendor/tests/tests/microformats-v1/hresume/education.html +0 -13
- data/vendor/tests/tests/microformats-v1/hresume/education.json +0 -29
- data/vendor/tests/tests/microformats-v1/hresume/skill.html +0 -12
- data/vendor/tests/tests/microformats-v1/hresume/skill.json +0 -33
- data/vendor/tests/tests/microformats-v1/hresume/work.html +0 -16
- data/vendor/tests/tests/microformats-v1/hresume/work.json +0 -30
- data/vendor/tests/tests/microformats-v1/hreview-aggregate/change-log.html +0 -67
- data/vendor/tests/tests/microformats-v1/hreview-aggregate/hcard.html +0 -18
- data/vendor/tests/tests/microformats-v1/hreview-aggregate/hcard.json +0 -31
- data/vendor/tests/tests/microformats-v1/hreview-aggregate/justahyperlink.html +0 -6
- data/vendor/tests/tests/microformats-v1/hreview-aggregate/justahyperlink.json +0 -19
- data/vendor/tests/tests/microformats-v1/hreview-aggregate/vevent.html +0 -13
- data/vendor/tests/tests/microformats-v1/hreview-aggregate/vevent.json +0 -22
- data/vendor/tests/tests/microformats-v1/hreview/change-log.html +0 -73
- data/vendor/tests/tests/microformats-v1/hreview/item.html +0 -8
- data/vendor/tests/tests/microformats-v1/hreview/item.json +0 -19
- data/vendor/tests/tests/microformats-v1/hreview/vcard.html +0 -23
- data/vendor/tests/tests/microformats-v1/hreview/vcard.json +0 -58
- data/vendor/tests/tests/microformats-v1/includes/change-log.html +0 -72
- data/vendor/tests/tests/microformats-v1/includes/hcarditemref.html +0 -16
- data/vendor/tests/tests/microformats-v1/includes/hcarditemref.json +0 -49
- data/vendor/tests/tests/microformats-v1/includes/heventitemref.html +0 -25
- data/vendor/tests/tests/microformats-v1/includes/heventitemref.json +0 -33
- data/vendor/tests/tests/microformats-v1/includes/hyperlink.html +0 -18
- data/vendor/tests/tests/microformats-v1/includes/hyperlink.json +0 -43
- data/vendor/tests/tests/microformats-v1/includes/object.html +0 -23
- data/vendor/tests/tests/microformats-v1/includes/object.json +0 -42
- data/vendor/tests/tests/microformats-v1/includes/table.html +0 -12
- data/vendor/tests/tests/microformats-v1/includes/table.json +0 -19
- data/vendor/tests/tests/microformats-v2/h-adr/change-log.html +0 -62
- data/vendor/tests/tests/microformats-v2/h-adr/geo.html +0 -10
- data/vendor/tests/tests/microformats-v2/h-adr/geo.json +0 -16
- data/vendor/tests/tests/microformats-v2/h-adr/geourl.html +0 -4
- data/vendor/tests/tests/microformats-v2/h-adr/geourl.json +0 -13
- data/vendor/tests/tests/microformats-v2/h-adr/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-adr/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-adr/lettercase.html +0 -21
- data/vendor/tests/tests/microformats-v2/h-adr/lettercase.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-adr/simpleproperties.html +0 -8
- data/vendor/tests/tests/microformats-v2/h-adr/simpleproperties.json +0 -16
- data/vendor/tests/tests/microformats-v2/h-as-note/note.html +0 -56
- data/vendor/tests/tests/microformats-v2/h-as-note/note.json +0 -98
- data/vendor/tests/tests/microformats-v2/h-card/baseurl.html +0 -6
- data/vendor/tests/tests/microformats-v2/h-card/baseurl.json +0 -26
- data/vendor/tests/tests/microformats-v2/h-card/change-log.html +0 -100
- data/vendor/tests/tests/microformats-v2/h-card/childimplied.html +0 -7
- data/vendor/tests/tests/microformats-v2/h-card/childimplied.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-card/extendeddescription.html +0 -10
- data/vendor/tests/tests/microformats-v2/h-card/extendeddescription.json +0 -15
- data/vendor/tests/tests/microformats-v2/h-card/hcard.html +0 -4
- data/vendor/tests/tests/microformats-v2/h-card/hcard.json +0 -19
- data/vendor/tests/tests/microformats-v2/h-card/horghcard.html +0 -4
- data/vendor/tests/tests/microformats-v2/h-card/horghcard.json +0 -19
- data/vendor/tests/tests/microformats-v2/h-card/hyperlinkedphoto.html +0 -3
- data/vendor/tests/tests/microformats-v2/h-card/hyperlinkedphoto.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-card/impliedname.html +0 -15
- data/vendor/tests/tests/microformats-v2/h-card/impliedname.json +0 -90
- data/vendor/tests/tests/microformats-v2/h-card/impliedphoto.html +0 -11
- data/vendor/tests/tests/microformats-v2/h-card/impliedphoto.json +0 -72
- data/vendor/tests/tests/microformats-v2/h-card/impliedurl.html +0 -5
- data/vendor/tests/tests/microformats-v2/h-card/impliedurl.json +0 -45
- data/vendor/tests/tests/microformats-v2/h-card/justahyperlink.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-card/justahyperlink.json +0 -11
- data/vendor/tests/tests/microformats-v2/h-card/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-card/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-card/nested.html +0 -4
- data/vendor/tests/tests/microformats-v2/h-card/nested.json +0 -18
- data/vendor/tests/tests/microformats-v2/h-card/p-property.html +0 -21
- data/vendor/tests/tests/microformats-v2/h-card/p-property.json +0 -15
- data/vendor/tests/tests/microformats-v2/h-card/relativeurls.html +0 -6
- data/vendor/tests/tests/microformats-v2/h-card/relativeurls.json +0 -29
- data/vendor/tests/tests/microformats-v2/h-entry/change-log.html +0 -90
- data/vendor/tests/tests/microformats-v2/h-entry/encoding.html +0 -3
- data/vendor/tests/tests/microformats-v2/h-entry/encoding.json +0 -14
- data/vendor/tests/tests/microformats-v2/h-entry/impliedvalue-nested.html +0 -9
- data/vendor/tests/tests/microformats-v2/h-entry/impliedvalue-nested.json +0 -27
- data/vendor/tests/tests/microformats-v2/h-entry/justahyperlink.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-entry/justahyperlink.json +0 -11
- data/vendor/tests/tests/microformats-v2/h-entry/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-entry/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-entry/scriptstyletags.html +0 -4
- data/vendor/tests/tests/microformats-v2/h-entry/scriptstyletags.json +0 -14
- data/vendor/tests/tests/microformats-v2/h-entry/summarycontent.html +0 -20
- data/vendor/tests/tests/microformats-v2/h-entry/summarycontent.json +0 -25
- data/vendor/tests/tests/microformats-v2/h-entry/u-property.html +0 -33
- data/vendor/tests/tests/microformats-v2/h-entry/u-property.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-entry/urlincontent.html +0 -13
- data/vendor/tests/tests/microformats-v2/h-entry/urlincontent.json +0 -14
- data/vendor/tests/tests/microformats-v2/h-event/ampm.html +0 -41
- data/vendor/tests/tests/microformats-v2/h-event/ampm.json +0 -21
- data/vendor/tests/tests/microformats-v2/h-event/attendees.html +0 -13
- data/vendor/tests/tests/microformats-v2/h-event/attendees.json +0 -37
- data/vendor/tests/tests/microformats-v2/h-event/change-log.html +0 -82
- data/vendor/tests/tests/microformats-v2/h-event/combining.html +0 -13
- data/vendor/tests/tests/microformats-v2/h-event/combining.json +0 -25
- data/vendor/tests/tests/microformats-v2/h-event/concatenate.html +0 -8
- data/vendor/tests/tests/microformats-v2/h-event/concatenate.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-event/dates.html +0 -13
- data/vendor/tests/tests/microformats-v2/h-event/dates.json +0 -26
- data/vendor/tests/tests/microformats-v2/h-event/dt-property.html +0 -23
- data/vendor/tests/tests/microformats-v2/h-event/dt-property.json +0 -20
- data/vendor/tests/tests/microformats-v2/h-event/justahyperlink.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-event/justahyperlink.json +0 -11
- data/vendor/tests/tests/microformats-v2/h-event/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-event/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-event/time.html +0 -47
- data/vendor/tests/tests/microformats-v2/h-event/time.json +0 -25
- data/vendor/tests/tests/microformats-v2/h-feed/implied-title.html +0 -30
- data/vendor/tests/tests/microformats-v2/h-feed/implied-title.json +0 -23
- data/vendor/tests/tests/microformats-v2/h-feed/simple.html +0 -26
- data/vendor/tests/tests/microformats-v2/h-feed/simple.json +0 -33
- data/vendor/tests/tests/microformats-v2/h-geo/abbrpattern.html +0 -5
- data/vendor/tests/tests/microformats-v2/h-geo/abbrpattern.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-geo/altitude.html +0 -8
- data/vendor/tests/tests/microformats-v2/h-geo/altitude.json +0 -13
- data/vendor/tests/tests/microformats-v2/h-geo/change-log.html +0 -67
- data/vendor/tests/tests/microformats-v2/h-geo/hidden.html +0 -10
- data/vendor/tests/tests/microformats-v2/h-geo/hidden.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-geo/justaname.html +0 -3
- data/vendor/tests/tests/microformats-v2/h-geo/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-geo/simpleproperties.html +0 -5
- data/vendor/tests/tests/microformats-v2/h-geo/simpleproperties.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-geo/valuetitleclass.html +0 -11
- data/vendor/tests/tests/microformats-v2/h-geo/valuetitleclass.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-news/all.html +0 -35
- data/vendor/tests/tests/microformats-v2/h-news/all.json +0 -51
- data/vendor/tests/tests/microformats-v2/h-news/change-log.html +0 -78
- data/vendor/tests/tests/microformats-v2/h-news/minimum.html +0 -24
- data/vendor/tests/tests/microformats-v2/h-news/minimum.json +0 -40
- data/vendor/tests/tests/microformats-v2/h-org/change-log.html +0 -57
- data/vendor/tests/tests/microformats-v2/h-org/hyperlink.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-org/hyperlink.json +0 -11
- data/vendor/tests/tests/microformats-v2/h-org/simple.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-org/simple.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-org/simpleproperties.html +0 -4
- data/vendor/tests/tests/microformats-v2/h-org/simpleproperties.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-product/aggregate.html +0 -21
- data/vendor/tests/tests/microformats-v2/h-product/aggregate.json +0 -45
- data/vendor/tests/tests/microformats-v2/h-product/change-log.html +0 -62
- data/vendor/tests/tests/microformats-v2/h-product/justahyperlink.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-product/justahyperlink.json +0 -11
- data/vendor/tests/tests/microformats-v2/h-product/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-product/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-product/simpleproperties.html +0 -10
- data/vendor/tests/tests/microformats-v2/h-product/simpleproperties.json +0 -26
- data/vendor/tests/tests/microformats-v2/h-recipe/all.html +0 -63
- data/vendor/tests/tests/microformats-v2/h-recipe/all.json +0 -54
- data/vendor/tests/tests/microformats-v2/h-recipe/change-log.html +0 -62
- data/vendor/tests/tests/microformats-v2/h-recipe/minimum.html +0 -7
- data/vendor/tests/tests/microformats-v2/h-recipe/minimum.json +0 -17
- data/vendor/tests/tests/microformats-v2/h-resume/affiliation.html +0 -12
- data/vendor/tests/tests/microformats-v2/h-resume/affiliation.json +0 -20
- data/vendor/tests/tests/microformats-v2/h-resume/change-log.html +0 -78
- data/vendor/tests/tests/microformats-v2/h-resume/contact.html +0 -17
- data/vendor/tests/tests/microformats-v2/h-resume/contact.json +0 -26
- data/vendor/tests/tests/microformats-v2/h-resume/education.html +0 -13
- data/vendor/tests/tests/microformats-v2/h-resume/education.json +0 -30
- data/vendor/tests/tests/microformats-v2/h-resume/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-resume/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-resume/skill.html +0 -12
- data/vendor/tests/tests/microformats-v2/h-resume/skill.json +0 -12
- data/vendor/tests/tests/microformats-v2/h-resume/work.html +0 -16
- data/vendor/tests/tests/microformats-v2/h-resume/work.json +0 -31
- data/vendor/tests/tests/microformats-v2/h-review-aggregate/change-log.html +0 -78
- data/vendor/tests/tests/microformats-v2/h-review-aggregate/hevent.html +0 -13
- data/vendor/tests/tests/microformats-v2/h-review-aggregate/hevent.json +0 -23
- data/vendor/tests/tests/microformats-v2/h-review-aggregate/justahyperlink.html +0 -8
- data/vendor/tests/tests/microformats-v2/h-review-aggregate/justahyperlink.json +0 -19
- data/vendor/tests/tests/microformats-v2/h-review-aggregate/simpleproperties.html +0 -18
- data/vendor/tests/tests/microformats-v2/h-review-aggregate/simpleproperties.json +0 -26
- data/vendor/tests/tests/microformats-v2/h-review/change-log.html +0 -84
- data/vendor/tests/tests/microformats-v2/h-review/hyperlink.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-review/hyperlink.json +0 -11
- data/vendor/tests/tests/microformats-v2/h-review/implieditem.html +0 -4
- data/vendor/tests/tests/microformats-v2/h-review/implieditem.json +0 -19
- data/vendor/tests/tests/microformats-v2/h-review/item.html +0 -8
- data/vendor/tests/tests/microformats-v2/h-review/item.json +0 -20
- data/vendor/tests/tests/microformats-v2/h-review/justaname.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-review/justaname.json +0 -10
- data/vendor/tests/tests/microformats-v2/h-review/photo.html +0 -1
- data/vendor/tests/tests/microformats-v2/h-review/photo.json +0 -11
- data/vendor/tests/tests/microformats-v2/h-review/vcard.html +0 -23
- data/vendor/tests/tests/microformats-v2/h-review/vcard.json +0 -48
- data/vendor/tests/tests/microformats-v2/rel/change-log.html +0 -67
- data/vendor/tests/tests/microformats-v2/rel/duplicate-rels.html +0 -10
- data/vendor/tests/tests/microformats-v2/rel/duplicate-rels.json +0 -75
- data/vendor/tests/tests/microformats-v2/rel/license.html +0 -1
- data/vendor/tests/tests/microformats-v2/rel/license.json +0 -12
- data/vendor/tests/tests/microformats-v2/rel/nofollow.html +0 -1
- data/vendor/tests/tests/microformats-v2/rel/nofollow.json +0 -12
- data/vendor/tests/tests/microformats-v2/rel/rel-urls.html +0 -8
- data/vendor/tests/tests/microformats-v2/rel/rel-urls.json +0 -33
- data/vendor/tests/tests/microformats-v2/rel/varying-text-duplicate-rels.html +0 -4
- data/vendor/tests/tests/microformats-v2/rel/varying-text-duplicate-rels.json +0 -20
- data/vendor/tests/tests/microformats-v2/rel/xfn-all.html +0 -19
- data/vendor/tests/tests/microformats-v2/rel/xfn-all.json +0 -92
- data/vendor/tests/tests/microformats-v2/rel/xfn-elsewhere.html +0 -10
- data/vendor/tests/tests/microformats-v2/rel/xfn-elsewhere.json +0 -40
@@ -1,7 +1,6 @@
|
|
1
1
|
module Microformats
|
2
2
|
class PropertyParser < ParserCore
|
3
|
-
|
4
|
-
def parse(element, base: nil, element_type: , format_class_array: [], backcompat: nil)
|
3
|
+
def parse(element, base: nil, element_type:, format_class_array: [], backcompat: nil)
|
5
4
|
@base = base
|
6
5
|
@value = nil
|
7
6
|
@property_type = element_type
|
@@ -13,55 +12,53 @@ module Microformats
|
|
13
12
|
parse_value_class_pattern(element)
|
14
13
|
|
15
14
|
if @value.nil?
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
@value =
|
16
|
+
if element.name == 'abbr' && !element.attribute('title').nil?
|
17
|
+
element.attribute('title').value.strip
|
18
|
+
elsif element.name == 'link' && !element.attribute('title').nil?
|
19
|
+
element.attribute('title').value.strip
|
20
|
+
elsif (element.name == 'data' || element.name == 'input') && !element.attribute('value').nil?
|
21
|
+
element.attribute('value').value.strip
|
22
|
+
elsif (element.name == 'img' || element.name == 'area') && !element.attribute('alt').nil?
|
23
|
+
element.attribute('alt').value.strip
|
24
|
+
else
|
25
|
+
render_text(element, base: @base)
|
26
|
+
end
|
25
27
|
end
|
26
|
-
|
27
28
|
elsif element_type == 'e'
|
28
29
|
@value = {
|
29
|
-
value: render_text(element, base: @base),
|
30
|
-
html: element.inner_html.
|
30
|
+
value: render_text(element, base: @base),
|
31
|
+
html: element.inner_html.strip
|
31
32
|
}
|
32
|
-
|
33
33
|
elsif element_type == 'u'
|
34
|
-
if [
|
34
|
+
if %w[a area link].include?(element.name) && !element.attribute('href').nil?
|
35
35
|
@value = element.attribute('href').value.strip
|
36
|
-
elsif [
|
36
|
+
elsif %w[img audio video source].include?(element.name) && !element.attribute('src').nil?
|
37
37
|
@value = element.attribute('src').value.strip
|
38
|
-
elsif element.name == 'video'
|
38
|
+
elsif element.name == 'video' && !element.attribute('poster').nil?
|
39
39
|
@value = element.attribute('poster').value.strip
|
40
|
-
elsif element.name == 'object'
|
40
|
+
elsif element.name == 'object' && !element.attribute('data').nil?
|
41
41
|
@value = element.attribute('data').value.strip
|
42
42
|
end
|
43
43
|
|
44
|
-
if
|
44
|
+
if !@value.nil?
|
45
45
|
@value = Microformats::AbsoluteUri.new(@value, base: @base).absolutize
|
46
46
|
else
|
47
|
-
|
48
47
|
parse_value_class_pattern(element)
|
49
48
|
|
50
49
|
if @value.nil?
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
@value =
|
51
|
+
if element.name == 'abbr' && !element.attribute('title').nil?
|
52
|
+
element.attribute('title').value.strip
|
53
|
+
elsif (element.name == 'data' || element.name == 'input') && !element.attribute('value').nil?
|
54
|
+
element.attribute('value').value.strip
|
55
|
+
else
|
56
|
+
render_text(element, base: @base)
|
57
|
+
end
|
59
58
|
end
|
60
59
|
end
|
61
|
-
|
62
60
|
elsif element_type == 'dt'
|
63
61
|
@value = Microformats::TimePropertyParser.new.parse(element, base: base, element_type: element_type, format_class_array: format_class_array, backcompat: backcompat)
|
64
|
-
|
65
62
|
end
|
66
63
|
|
67
64
|
@value
|
@@ -69,54 +66,34 @@ module Microformats
|
|
69
66
|
|
70
67
|
def parse_value_class_pattern(element)
|
71
68
|
@value_class_pattern_value = []
|
69
|
+
|
72
70
|
parse_node(element.children)
|
71
|
+
|
73
72
|
@value = @value_class_pattern_value.join unless @value_class_pattern_value.empty?
|
74
73
|
end
|
75
74
|
|
76
75
|
def parse_element(element)
|
77
76
|
if value_title_classes(element).length >= 1
|
78
77
|
@value_class_pattern_value << element.attribute('title').value.strip
|
79
|
-
|
80
78
|
elsif value_classes(element).length >= 1
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
79
|
+
@value_class_pattern_value <<
|
80
|
+
if element.name == 'img' || element.name == 'area' && !element.attribute('alt').nil?
|
81
|
+
element.attribute('alt').value.strip
|
82
|
+
elsif element.name == 'data' && !element.attribute('value').nil?
|
83
|
+
element.attribute('value').value.strip
|
84
|
+
elsif element.name == 'abbr' && !element.attribute('title').nil?
|
85
|
+
element.attribute('title').value.strip
|
86
|
+
else
|
87
|
+
render_and_strip(element.text.strip)
|
88
|
+
end
|
90
89
|
else
|
91
90
|
p_classes = property_classes(element)
|
92
91
|
p_classes = backcompat_property_classes(element) if @mode_backcompat
|
93
|
-
if p_classes.length == 0 and format_classes(element).length == 0
|
94
|
-
parse_node(element.children)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
92
|
|
99
|
-
|
100
|
-
|
101
|
-
new_doc.xpath('//script').remove
|
102
|
-
new_doc.xpath('//style').remove
|
103
|
-
new_doc.traverse do |node|
|
104
|
-
if node.name == 'img' and not node.attribute('alt').nil?
|
105
|
-
node.replace(' ' + node.attribute('alt').value.to_s + ' ')
|
106
|
-
elsif node.name == 'img' and not node.attribute('src').nil?
|
107
|
-
absolute_url = Microformats::AbsoluteUri.new(node.attribute('src').value.to_s, base: @base).absolutize
|
108
|
-
node.replace(' ' + absolute_url + ' ')
|
93
|
+
if p_classes.empty? && format_classes(element).empty?
|
94
|
+
parse_node(element.children)
|
109
95
|
end
|
110
96
|
end
|
111
|
-
new_doc.text.strip
|
112
97
|
end
|
113
|
-
|
114
|
-
def render_text(node, base: nil)
|
115
|
-
new_doc = Nokogiri::HTML(node.inner_html)
|
116
|
-
new_doc.xpath('//script').remove
|
117
|
-
new_doc.xpath('//style').remove
|
118
|
-
new_doc.text.strip
|
119
|
-
end
|
120
|
-
|
121
98
|
end
|
122
99
|
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Microformats
|
2
|
-
|
3
|
-
#stub to get around the tests for now
|
2
|
+
# stub to get around the tests for now
|
4
3
|
class Collection
|
5
|
-
|
6
4
|
def initialize(hash)
|
7
5
|
@hash = hash
|
8
6
|
end
|
@@ -20,21 +18,13 @@ module Microformats
|
|
20
18
|
end
|
21
19
|
|
22
20
|
def to_s
|
23
|
-
|
24
|
-
return @hash['value']
|
25
|
-
else
|
26
|
-
super
|
27
|
-
end
|
21
|
+
@hash.to_s
|
28
22
|
end
|
29
23
|
|
30
24
|
def [](key)
|
31
25
|
@hash[key]
|
32
26
|
end
|
33
27
|
|
34
|
-
def value
|
35
|
-
@hash['value']
|
36
|
-
end
|
37
|
-
|
38
28
|
def items
|
39
29
|
@hash['items'].map do |item|
|
40
30
|
ParserResult.new(item)
|
@@ -50,19 +40,19 @@ module Microformats
|
|
50
40
|
end
|
51
41
|
|
52
42
|
def respond_to?(sym, include_private = false)
|
53
|
-
|
43
|
+
item?(sym) || super(sym, include_private)
|
54
44
|
end
|
55
45
|
|
56
46
|
def method_missing(sym, *args, &block)
|
57
|
-
|
58
47
|
name = sym.to_s
|
59
|
-
name_dash = name.
|
48
|
+
name_dash = name.tr('_', '-') if name.include?('_')
|
60
49
|
|
61
|
-
|
50
|
+
unless @hash['items'].nil?
|
62
51
|
result_hash = @hash['items'].select do |x|
|
63
|
-
|
52
|
+
x['type'].include?('h-' + name)
|
64
53
|
end
|
65
|
-
|
54
|
+
|
55
|
+
if result_hash.empty? && !name_dash.nil?
|
66
56
|
result_hash = @hash['items'].select do |x|
|
67
57
|
x['type'].include?('h-' + name_dash)
|
68
58
|
end
|
@@ -71,51 +61,42 @@ module Microformats
|
|
71
61
|
|
72
62
|
super(sym, *args, &block) if result_hash.empty?
|
73
63
|
|
74
|
-
if result_hash.is_a?
|
64
|
+
if result_hash.is_a?(Array)
|
75
65
|
if args[0].nil?
|
76
|
-
result_hash = result_hash[0] #will return nil for an empty array
|
77
|
-
|
66
|
+
result_hash = result_hash[0] # will return nil for an empty array
|
78
67
|
elsif args[0] == :all
|
79
68
|
return result_hash.map do |x|
|
80
69
|
ParserResult.new(x)
|
81
70
|
end
|
82
|
-
|
83
71
|
elsif args[0].to_i < result_hash.count
|
84
72
|
result_hash = result_hash[args[0].to_i]
|
85
|
-
|
86
73
|
else
|
87
|
-
result_hash = result_hash[0] #will return nil for an empty array
|
74
|
+
result_hash = result_hash[0] # will return nil for an empty array
|
88
75
|
end
|
89
76
|
end
|
90
77
|
|
91
|
-
|
92
|
-
result_hash
|
93
|
-
elsif result_hash.is_a? Hash
|
94
|
-
ParserResult.new(result_hash)
|
95
|
-
else
|
96
|
-
result_hash
|
97
|
-
end
|
78
|
+
ParserResult.new(result_hash)
|
98
79
|
end
|
99
80
|
|
100
81
|
private
|
101
82
|
|
102
|
-
def
|
83
|
+
def item?(name)
|
103
84
|
name = name.to_s
|
104
|
-
name_dash = name.
|
105
|
-
|
85
|
+
name_dash = name.tr('_', '-') if name.include?('_')
|
86
|
+
|
87
|
+
unless @hash['items'].nil?
|
106
88
|
result_hash = @hash['items'].select do |x|
|
107
89
|
x['type'].include?('h-' + name)
|
108
90
|
end
|
109
|
-
|
91
|
+
|
92
|
+
if result_hash.empty? && !name_dash.nil?
|
110
93
|
result_hash = @hash['items'].select do |x|
|
111
94
|
x['type'].include?('h-' + name_dash)
|
112
95
|
end
|
113
96
|
end
|
114
97
|
end
|
115
98
|
|
116
|
-
|
99
|
+
!result_hash.empty?
|
117
100
|
end
|
118
|
-
|
119
101
|
end
|
120
102
|
end
|
121
|
-
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Microformats
|
2
|
-
|
3
|
-
#stub to get around the tests for now
|
2
|
+
# stub to get around the tests for now
|
4
3
|
class ParserResult
|
5
|
-
|
6
4
|
def initialize(hash)
|
7
5
|
@hash = hash
|
8
6
|
end
|
@@ -20,11 +18,9 @@ module Microformats
|
|
20
18
|
end
|
21
19
|
|
22
20
|
def to_s
|
23
|
-
if @hash['value']
|
24
|
-
|
25
|
-
|
26
|
-
super
|
27
|
-
end
|
21
|
+
return @hash['value'] if @hash['value']
|
22
|
+
|
23
|
+
@hash.to_s
|
28
24
|
end
|
29
25
|
|
30
26
|
def [](key)
|
@@ -36,54 +32,46 @@ module Microformats
|
|
36
32
|
end
|
37
33
|
|
38
34
|
def properties
|
39
|
-
PropertySet.new(
|
35
|
+
PropertySet.new(@hash['properties'])
|
40
36
|
end
|
41
37
|
|
42
38
|
def respond_to?(sym, include_private = false)
|
43
|
-
|
39
|
+
key?(sym) || property?(sym) || super(sym, include_private)
|
44
40
|
end
|
45
41
|
|
46
42
|
def method_missing(sym, *args, &block)
|
47
|
-
|
48
43
|
name = sym.to_s
|
49
|
-
name_dash = name.
|
44
|
+
name_dash = name.tr('_', '-') if name.include?('_')
|
50
45
|
|
51
|
-
if
|
46
|
+
if !@hash[name].nil?
|
52
47
|
result_hash = @hash[name]
|
53
|
-
|
54
|
-
elsif not @hash['properties'].nil? and not @hash['properties'][name].nil?
|
48
|
+
elsif !@hash['properties'].nil? && !@hash['properties'][name].nil?
|
55
49
|
result_hash = @hash['properties'][name]
|
56
|
-
|
57
|
-
elsif not name_dash.nil? and not @hash[name_dash].nil?
|
50
|
+
elsif !name_dash.nil? && !@hash[name_dash].nil?
|
58
51
|
result_hash = @hash[name_dash]
|
59
|
-
|
60
|
-
elsif not name_dash.nil? and not @hash['properties'].nil? and not @hash['properties'][name_dash].nil?
|
52
|
+
elsif !name_dash.nil? && !@hash['properties'].nil? && !@hash['properties'][name_dash].nil?
|
61
53
|
result_hash = @hash['properties'][name_dash]
|
62
|
-
|
63
54
|
else
|
64
55
|
super(sym, *args, &block)
|
65
56
|
end
|
66
57
|
|
67
|
-
if result_hash.is_a?
|
58
|
+
if result_hash.is_a?(Array)
|
68
59
|
if args[0].nil?
|
69
|
-
result_hash = result_hash[0] #will return nil for an empty array
|
70
|
-
|
60
|
+
result_hash = result_hash[0] # will return nil for an empty array
|
71
61
|
elsif args[0] == :all
|
72
62
|
return result_hash.map do |x|
|
73
63
|
ParserResult.new(x)
|
74
64
|
end
|
75
|
-
|
76
65
|
elsif args[0].to_i < result_hash.count
|
77
66
|
result_hash = result_hash[args[0].to_i]
|
78
|
-
|
79
67
|
else
|
80
|
-
result_hash = result_hash[0] #will return nil for an empty array
|
68
|
+
result_hash = result_hash[0] # will return nil for an empty array
|
81
69
|
end
|
82
70
|
end
|
83
71
|
|
84
|
-
if result_hash.nil?
|
72
|
+
if result_hash.nil? || result_hash.empty?
|
85
73
|
result_hash
|
86
|
-
elsif result_hash.is_a?
|
74
|
+
elsif result_hash.is_a?(Hash)
|
87
75
|
ParserResult.new(result_hash)
|
88
76
|
else
|
89
77
|
result_hash
|
@@ -92,20 +80,20 @@ module Microformats
|
|
92
80
|
|
93
81
|
private
|
94
82
|
|
95
|
-
def
|
83
|
+
def key?(name)
|
96
84
|
name = name.to_s
|
97
|
-
name_dash = name.
|
85
|
+
name_dash = name.tr('_', '-') if name.include?('_')
|
98
86
|
|
99
|
-
|
87
|
+
!@hash[name].nil? || !@hash[name_dash].nil?
|
100
88
|
end
|
101
|
-
|
102
|
-
def
|
89
|
+
|
90
|
+
def property?(name)
|
103
91
|
name = name.to_s
|
104
|
-
name_dash = name.
|
92
|
+
name_dash = name.tr('_', '-') if name.include?('_')
|
93
|
+
|
105
94
|
return false if @hash['properties'].nil?
|
106
|
-
not @hash['properties'][name].nil? or not @hash['properties'][name_dash].nil?
|
107
|
-
end
|
108
95
|
|
96
|
+
!@hash['properties'][name].nil? || !@hash['properties'][name_dash].nil?
|
97
|
+
end
|
109
98
|
end
|
110
99
|
end
|
111
|
-
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Microformats
|
2
|
-
|
3
|
-
|
4
|
-
class PropertySet
|
5
|
-
|
2
|
+
# stub to get around the tests for now
|
3
|
+
class PropertySet
|
6
4
|
def initialize(hash)
|
7
5
|
@hash = hash
|
8
6
|
end
|
@@ -23,65 +21,60 @@ module Microformats
|
|
23
21
|
@hash[key]
|
24
22
|
end
|
25
23
|
|
26
|
-
def
|
27
|
-
|
24
|
+
def to_s
|
25
|
+
@hash.to_s
|
28
26
|
end
|
29
27
|
|
28
|
+
def respond_to?(sym, include_private = false)
|
29
|
+
key?(sym) || super(sym, include_private)
|
30
|
+
end
|
30
31
|
|
31
32
|
def method_missing(mname, *args, &block)
|
33
|
+
if respond_to?(mname)
|
34
|
+
result_hash = val?(mname)
|
32
35
|
|
33
|
-
|
34
|
-
result_hash = get_val? mname
|
35
|
-
if result_hash.is_a? Array
|
36
|
+
if result_hash.is_a?(Array)
|
36
37
|
if args[0].nil?
|
37
|
-
result_hash = result_hash[0] #will return nil for an empty array
|
38
|
-
|
38
|
+
result_hash = result_hash[0] # will return nil for an empty array
|
39
39
|
elsif args[0] == :all
|
40
40
|
return result_hash.map do |x|
|
41
41
|
ParserResult.new(x)
|
42
42
|
end
|
43
|
-
|
44
43
|
elsif args[0].to_i < result_hash.count
|
45
44
|
result_hash = result_hash[args[0].to_i]
|
46
|
-
|
47
45
|
else
|
48
|
-
result_hash = result_hash[0] #will return nil for an empty array
|
46
|
+
result_hash = result_hash[0] # will return nil for an empty array
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
52
|
-
if result_hash.is_a?
|
50
|
+
if result_hash.is_a?(Hash)
|
53
51
|
ParserResult.new(result_hash)
|
54
52
|
else
|
55
53
|
result_hash
|
56
54
|
end
|
57
55
|
else
|
58
|
-
|
56
|
+
super(mname, *args, &block)
|
59
57
|
end
|
60
|
-
|
61
58
|
end
|
62
59
|
|
63
60
|
private
|
64
61
|
|
65
|
-
def
|
62
|
+
def key?(name)
|
66
63
|
name = name.to_s
|
67
|
-
name_dash = name.
|
68
|
-
|
64
|
+
name_dash = name.tr('_', '-') if name.include?('_')
|
65
|
+
|
66
|
+
!@hash[name].nil? || !@hash[name_dash].nil?
|
69
67
|
end
|
70
68
|
|
71
|
-
def
|
69
|
+
def val?(name)
|
72
70
|
name = name.to_s
|
73
|
-
name_dash = name.
|
74
|
-
|
75
|
-
if not @hash[name].nil?
|
76
|
-
result_hash = @hash[name]
|
71
|
+
name_dash = name.tr('_', '-') if name.include?('_')
|
77
72
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
if !@hash[name].nil?
|
74
|
+
@hash[name]
|
75
|
+
elsif !@hash[name_dash].nil?
|
76
|
+
@hash[name_dash]
|
82
77
|
end
|
83
78
|
end
|
84
|
-
|
85
79
|
end
|
86
80
|
end
|
87
|
-
|