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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707a6bf1f579b7e9b8f83446857f6d9aaef1a1f2
|
4
|
+
data.tar.gz: 36b751145439c8d4cffdeacba3530f332d7ac2d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47b5fc4c73c6d54395540ec93830da51372096d89855fb14d578ec8a7392561f724448526c26f30e97ecbffdd4d9f58ad3eb0376423fad193927c9e874bae8b0
|
7
|
+
data.tar.gz: b9cb79d88aeed23bc329f79317cafa1a1a8df3a2d60cde987f2a319fee19a5daf83ee4b029f045a0fd0638152e343c066d522801cd9c8d12f25497ad75b402ec
|
data/.editorconfig
ADDED
data/.gitignore
CHANGED
@@ -1,19 +1,37 @@
|
|
1
1
|
*.gem
|
2
2
|
*.rbc
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
# Documentation cache and generated files:
|
17
|
+
/.yardoc/
|
18
|
+
/_yardoc/
|
19
|
+
/doc/
|
20
|
+
/rdoc/
|
21
|
+
|
22
|
+
# Environment normalization:
|
23
|
+
/.bundle/
|
24
|
+
/vendor/bundle
|
25
|
+
/lib/bundler/man/
|
26
|
+
|
27
|
+
# for a library or gem, you might want to ignore these files since the code is
|
28
|
+
# intended to run in multiple environments; otherwise, check them in:
|
6
29
|
Gemfile.lock
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
coverage
|
30
|
+
# .ruby-version
|
31
|
+
# .ruby-gemset
|
32
|
+
|
33
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
+
.rvmrc
|
35
|
+
|
36
|
+
#vim files being edited
|
19
37
|
*.swp
|
data/.rspec
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
--
|
2
|
-
--
|
1
|
+
--format documentation
|
2
|
+
--order random
|
3
|
+
--require spec_helper
|
data/.rubocop
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
|
4
|
+
Metrics/BlockLength:
|
5
|
+
Exclude:
|
6
|
+
- microformats.gemspec
|
7
|
+
- spec/**/*.rb
|
8
|
+
|
9
|
+
Metrics/LineLength:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
RSpec/ExampleLength:
|
13
|
+
Max: 15
|
14
|
+
|
15
|
+
RSpec/MultipleExpectations:
|
16
|
+
Max: 10
|
17
|
+
|
18
|
+
RSpec/NestedGroups:
|
19
|
+
Max: 6
|
20
|
+
|
21
|
+
Style/Documentation:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Style/FrozenStringLiteralComment:
|
25
|
+
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.4
|
data/.simplecov
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'simplecov-console'
|
2
|
+
|
3
|
+
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
4
|
+
|
5
|
+
if RSpec.configuration.files_to_run.length > 1
|
6
|
+
formatters << SimpleCov::Formatter::Console
|
7
|
+
end
|
8
|
+
|
9
|
+
SimpleCov.start do
|
10
|
+
formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
|
11
|
+
end
|
data/.travis.yml
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
2
3
|
rvm:
|
3
|
-
- 2.
|
4
|
-
|
4
|
+
- 2.4.4
|
5
|
+
- 2.5.1
|
6
|
+
before_install:
|
7
|
+
- gem update --system
|
8
|
+
- gem update bundler
|
9
|
+
before_script:
|
10
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
11
|
+
- chmod +x ./cc-test-reporter
|
12
|
+
- ./cc-test-reporter before-build
|
13
|
+
script:
|
14
|
+
- bundle exec rspec
|
15
|
+
after_script:
|
16
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# Contributing to microformats-ruby
|
2
|
+
|
3
|
+
There are a couple ways you can help improve microformats-ruby:
|
4
|
+
|
5
|
+
1. Fix an existing [issue][issues] and submit a [pull request][pulls].
|
6
|
+
1. Review open [pull requests][pulls].
|
7
|
+
1. Report a new [issue][issues]. _Only do this after you've made sure the behavior or problem you're observing isn't already documented in an open issue._
|
8
|
+
|
9
|
+
## Getting Started
|
10
|
+
|
11
|
+
microformats-ruby is developed using Ruby 2.5.0 and is additionally tested against versions 2.2.9, 2.3.6, and 2.4.3 using [Travis CI](https://travis-ci.org/microformats/microformats-ruby).
|
12
|
+
|
13
|
+
Before making changes to microformats-ruby, you'll want to install Ruby 2.5.0. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.5.0 using your method of choice, install the project's gems by running:
|
14
|
+
|
15
|
+
```sh
|
16
|
+
bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
## Making Changes
|
20
|
+
|
21
|
+
1. Fork and clone the project's repo.
|
22
|
+
1. Install development dependencies as outlined above.
|
23
|
+
1. Create a feature branch for the code changes you're looking to make: `git checkout -b my-new-feature`.
|
24
|
+
1. _Write some code!_
|
25
|
+
1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `bundle exec rspec`.
|
26
|
+
1. Commit your changes: `git commit -am 'Add some new feature or fix some issue'`. _(See [this excellent article](https://chris.beams.io/posts/git-commit/) for tips on writing useful Git commit messages.)_
|
27
|
+
1. Push the branch to your fork: `git push -u origin my-new-feature`.
|
28
|
+
1. Create a new [pull request][pulls] and we'll review your changes.
|
29
|
+
|
30
|
+
## Verifying Changes
|
31
|
+
|
32
|
+
We use the following tools to evaluate code quality and verify behavior:
|
33
|
+
|
34
|
+
- The test suite uses [RSpec](http://rspec.info) (`bundle exec rspec`).
|
35
|
+
- Static code analysis uses [RuboCop](https://github.com/bbatsov/rubocop) (`bundle exec rubocop`).
|
36
|
+
|
37
|
+
Before submitting a [pull request][pulls], use the above tools to verify your changes.
|
38
|
+
|
39
|
+
You may also test your code interactively by running:
|
40
|
+
|
41
|
+
```sh
|
42
|
+
bundle console
|
43
|
+
```
|
44
|
+
|
45
|
+
## Releasing New Versions
|
46
|
+
|
47
|
+
First, check out the latest code from GitHub:
|
48
|
+
|
49
|
+
```sh
|
50
|
+
git pull origin master
|
51
|
+
```
|
52
|
+
|
53
|
+
Following the [Semantic Versioning](https://semver.org) conventions, update the gem version throughout the project (but most importantly in `lib/microformats/version.rb`).
|
54
|
+
|
55
|
+
Confirm that the gem builds correctly:
|
56
|
+
|
57
|
+
```sh
|
58
|
+
bundle exec rake build
|
59
|
+
```
|
60
|
+
|
61
|
+
If that works, install the new version of the gem locally:
|
62
|
+
|
63
|
+
```sh
|
64
|
+
bundle exec rake install
|
65
|
+
```
|
66
|
+
|
67
|
+
If that works, uninstall the gem.
|
68
|
+
|
69
|
+
```sh
|
70
|
+
gem uninstall microformats
|
71
|
+
```
|
72
|
+
|
73
|
+
Clean up any mess made from testing.
|
74
|
+
|
75
|
+
```sh
|
76
|
+
bundle exec rake clean
|
77
|
+
bundle exec rake clobber
|
78
|
+
```
|
79
|
+
|
80
|
+
Assuming you're one of the gem owners and have release privileges, release the gem!
|
81
|
+
|
82
|
+
```
|
83
|
+
bundle exec rake release
|
84
|
+
```
|
85
|
+
|
86
|
+
If that works, you’ve just released a new version of the gem! Yay! You can see it at: [https://rubygems.org/gems/microformats](https://rubygems.org/gems/microformats)
|
87
|
+
|
88
|
+
### Handling Errors
|
89
|
+
|
90
|
+
If `rake release` failed because of an error with your authentication to RubyGems.org, follow the instructions in the error message then repeat the `rake release` step.
|
91
|
+
|
92
|
+
### Getting Help
|
93
|
+
|
94
|
+
If any other errors occurred along the way and you're stuck, get in touch via [IRC](http://microformats.org/wiki/irc) (#microformats on freenode) or the #microformats channel in [the IndieWebCamp Slack](https://indieweb.org/Slack) for help.
|
95
|
+
|
96
|
+
## Code Style
|
97
|
+
|
98
|
+
Code formatting conventions are defined in the `.editorconfig` file which uses the [EditorConfig](http://editorconfig.org) syntax. There are [plugins for a variety of editors](http://editorconfig.org/#download) that utilize the settings in the `.editorconfig` file. We recommended you install the EditorConfig plugin for your editor of choice.
|
99
|
+
|
100
|
+
Your bug fix or feature addition won't be rejected if it runs afoul of any (or all) of these guidelines, but following the guidelines will definitely make everyone's lives a little easier.
|
101
|
+
|
102
|
+
[issues]: https://github.com/microformats/microformats-ruby/issues
|
103
|
+
[pulls]: https://github.com/microformats/microformats-ruby/pulls
|
data/Guardfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
CC0 1.0 Universal
|
2
|
+
|
3
|
+
Statement of Purpose
|
4
|
+
|
5
|
+
The laws of most jurisdictions throughout the world automatically confer
|
6
|
+
exclusive Copyright and Related Rights (defined below) upon the creator and
|
7
|
+
subsequent owner(s) (each and all, an "owner") of an original work of
|
8
|
+
authorship and/or a database (each, a "Work").
|
9
|
+
|
10
|
+
Certain owners wish to permanently relinquish those rights to a Work for the
|
11
|
+
purpose of contributing to a commons of creative, cultural and scientific
|
12
|
+
works ("Commons") that the public can reliably and without fear of later
|
13
|
+
claims of infringement build upon, modify, incorporate in other works, reuse
|
14
|
+
and redistribute as freely as possible in any form whatsoever and for any
|
15
|
+
purposes, including without limitation commercial purposes. These owners may
|
16
|
+
contribute to the Commons to promote the ideal of a free culture and the
|
17
|
+
further production of creative, cultural and scientific works, or to gain
|
18
|
+
reputation or greater distribution for their Work in part through the use and
|
19
|
+
efforts of others.
|
20
|
+
|
21
|
+
For these and/or other purposes and motivations, and without any expectation
|
22
|
+
of additional consideration or compensation, the person associating CC0 with a
|
23
|
+
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
|
24
|
+
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
|
25
|
+
and publicly distribute the Work under its terms, with knowledge of his or her
|
26
|
+
Copyright and Related Rights in the Work and the meaning and intended legal
|
27
|
+
effect of CC0 on those rights.
|
28
|
+
|
29
|
+
1. Copyright and Related Rights. A Work made available under CC0 may be
|
30
|
+
protected by copyright and related or neighboring rights ("Copyright and
|
31
|
+
Related Rights"). Copyright and Related Rights include, but are not limited
|
32
|
+
to, the following:
|
33
|
+
|
34
|
+
i. the right to reproduce, adapt, distribute, perform, display, communicate,
|
35
|
+
and translate a Work;
|
36
|
+
|
37
|
+
ii. moral rights retained by the original author(s) and/or performer(s);
|
38
|
+
|
39
|
+
iii. publicity and privacy rights pertaining to a person's image or likeness
|
40
|
+
depicted in a Work;
|
41
|
+
|
42
|
+
iv. rights protecting against unfair competition in regards to a Work,
|
43
|
+
subject to the limitations in paragraph 4(a), below;
|
44
|
+
|
45
|
+
v. rights protecting the extraction, dissemination, use and reuse of data in
|
46
|
+
a Work;
|
47
|
+
|
48
|
+
vi. database rights (such as those arising under Directive 96/9/EC of the
|
49
|
+
European Parliament and of the Council of 11 March 1996 on the legal
|
50
|
+
protection of databases, and under any national implementation thereof,
|
51
|
+
including any amended or successor version of such directive); and
|
52
|
+
|
53
|
+
vii. other similar, equivalent or corresponding rights throughout the world
|
54
|
+
based on applicable law or treaty, and any national implementations thereof.
|
55
|
+
|
56
|
+
2. Waiver. To the greatest extent permitted by, but not in contravention of,
|
57
|
+
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
|
58
|
+
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
|
59
|
+
and Related Rights and associated claims and causes of action, whether now
|
60
|
+
known or unknown (including existing as well as future claims and causes of
|
61
|
+
action), in the Work (i) in all territories worldwide, (ii) for the maximum
|
62
|
+
duration provided by applicable law or treaty (including future time
|
63
|
+
extensions), (iii) in any current or future medium and for any number of
|
64
|
+
copies, and (iv) for any purpose whatsoever, including without limitation
|
65
|
+
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
|
66
|
+
the Waiver for the benefit of each member of the public at large and to the
|
67
|
+
detriment of Affirmer's heirs and successors, fully intending that such Waiver
|
68
|
+
shall not be subject to revocation, rescission, cancellation, termination, or
|
69
|
+
any other legal or equitable action to disrupt the quiet enjoyment of the Work
|
70
|
+
by the public as contemplated by Affirmer's express Statement of Purpose.
|
71
|
+
|
72
|
+
3. Public License Fallback. Should any part of the Waiver for any reason be
|
73
|
+
judged legally invalid or ineffective under applicable law, then the Waiver
|
74
|
+
shall be preserved to the maximum extent permitted taking into account
|
75
|
+
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
|
76
|
+
is so judged Affirmer hereby grants to each affected person a royalty-free,
|
77
|
+
non transferable, non sublicensable, non exclusive, irrevocable and
|
78
|
+
unconditional license to exercise Affirmer's Copyright and Related Rights in
|
79
|
+
the Work (i) in all territories worldwide, (ii) for the maximum duration
|
80
|
+
provided by applicable law or treaty (including future time extensions), (iii)
|
81
|
+
in any current or future medium and for any number of copies, and (iv) for any
|
82
|
+
purpose whatsoever, including without limitation commercial, advertising or
|
83
|
+
promotional purposes (the "License"). The License shall be deemed effective as
|
84
|
+
of the date CC0 was applied by Affirmer to the Work. Should any part of the
|
85
|
+
License for any reason be judged legally invalid or ineffective under
|
86
|
+
applicable law, such partial invalidity or ineffectiveness shall not
|
87
|
+
invalidate the remainder of the License, and in such case Affirmer hereby
|
88
|
+
affirms that he or she will not (i) exercise any of his or her remaining
|
89
|
+
Copyright and Related Rights in the Work or (ii) assert any associated claims
|
90
|
+
and causes of action with respect to the Work, in either case contrary to
|
91
|
+
Affirmer's express Statement of Purpose.
|
92
|
+
|
93
|
+
4. Limitations and Disclaimers.
|
94
|
+
|
95
|
+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
96
|
+
surrendered, licensed or otherwise affected by this document.
|
97
|
+
|
98
|
+
b. Affirmer offers the Work as-is and makes no representations or warranties
|
99
|
+
of any kind concerning the Work, express, implied, statutory or otherwise,
|
100
|
+
including without limitation warranties of title, merchantability, fitness
|
101
|
+
for a particular purpose, non infringement, or the absence of latent or
|
102
|
+
other defects, accuracy, or the present or absence of errors, whether or not
|
103
|
+
discoverable, all to the greatest extent permissible under applicable law.
|
104
|
+
|
105
|
+
c. Affirmer disclaims responsibility for clearing rights of other persons
|
106
|
+
that may apply to the Work or any use thereof, including without limitation
|
107
|
+
any person's Copyright and Related Rights in the Work. Further, Affirmer
|
108
|
+
disclaims responsibility for obtaining any necessary consents, permissions
|
109
|
+
or other rights required for any use of the Work.
|
110
|
+
|
111
|
+
d. Affirmer understands and acknowledges that Creative Commons is not a
|
112
|
+
party to this document and has no duty or obligation with respect to this
|
113
|
+
CC0 or use of the Work.
|
114
|
+
|
115
|
+
For more information, please see
|
116
|
+
<http://creativecommons.org/publicdomain/zero/1.0/>
|
data/README.md
CHANGED
@@ -1,243 +1,183 @@
|
|
1
|
-
# Microformats (ruby)
|
1
|
+
# ![Microformats Logo](https://raw.githubusercontent.com/microformats/microformats-ruby/master/logo.svg?sanitize=true) Microformats Ruby
|
2
2
|
|
3
|
-
|
4
|
-
[![Code Climate](https://codeclimate.com/github/indieweb/microformats-ruby/badges/gpa.svg)](https://codeclimate.com/github/indieweb/microformats-ruby)
|
3
|
+
**A Ruby gem for parsing HTML documents containing microformats.**
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
[![Gem](https://img.shields.io/gem/v/microformats.svg?style=for-the-badge)](https://rubygems.org/gems/microformats)
|
6
|
+
[![Downloads](https://img.shields.io/gem/dt/microformats.svg?style=for-the-badge)](https://rubygems.org/gems/microformats)
|
7
|
+
[![Build](https://img.shields.io/travis/microformats/microformats-ruby/master.svg?style=for-the-badge)](https://travis-ci.org/microformats/microformats-ruby)
|
8
|
+
[![Maintainability](https://img.shields.io/codeclimate/maintainability/microformats/microformats-ruby.svg?style=for-the-badge)](https://codeclimate.com/github/microformats/microformats-ruby)
|
9
|
+
[![Coverage](https://img.shields.io/codeclimate/c/microformats/microformats-ruby.svg?style=for-the-badge)](https://codeclimate.com/github/microformats/microformats-ruby/code)
|
8
10
|
|
11
|
+
## Key Features
|
9
12
|
|
10
|
-
|
13
|
+
- Compatible with both [classic microformats](http://microformats.org/wiki/Main_Page#Classic_Microformats) and [microformats2](http://microformats.org/wiki/microformats2) syntaxes.
|
14
|
+
- Provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface) for extracting microformats from a URL, file, or string.
|
11
15
|
|
12
|
-
|
16
|
+
## Getting Started
|
13
17
|
|
14
|
-
|
15
|
-
* [parsing a p- property](http://microformats.org/wiki/microformats2-parsing#parsing_a_p-_property)
|
16
|
-
* [parsing a u- property](http://microformats.org/wiki/microformats2-parsing#parsing_a_u-_property)
|
17
|
-
* [parsing a dt- property](http://microformats.org/wiki/microformats2-parsing#parsing_a_dt-_property)
|
18
|
-
* [parsing a e- property](http://microformats.org/wiki/microformats2-parsing#parsing_an_e-_property)
|
19
|
-
* [parsing implied properties](http://microformats.org/wiki/microformats-2-parsing#parsing_for_implied_properties)
|
20
|
-
* nested properties
|
21
|
-
* nested microformat with associated property
|
22
|
-
* dynamic creation of properties
|
23
|
-
* [rel](http://microformats.org/wiki/rel)
|
24
|
-
* [normalize u-* property values](http://microformats.org/wiki/microformats2-parsing-faq#normalizing_u-.2A_property_values)
|
25
|
-
* nested microformat without associated property
|
26
|
-
* [value-class-pattern](http://microformats.org/wiki/value-class-pattern)
|
27
|
-
* recognition of [vendor extensions](http://microformats.org/wiki/microformats2#VENDOR_EXTENSIONS)
|
28
|
-
* backward compatible support for microformats v1
|
29
|
-
|
30
|
-
Not Implemented:
|
31
|
-
|
32
|
-
* [include-pattern](http://microformats.org/wiki/include-pattern)
|
33
|
-
|
34
|
-
|
35
|
-
## Current Version
|
36
|
-
|
37
|
-
4.0.7
|
38
|
-
|
39
|
-
![Version 4.0.7](https://img.shields.io/badge/VERSION-4.0.7-green.svg)
|
40
|
-
|
41
|
-
|
42
|
-
## Requirements
|
43
|
-
|
44
|
-
* [nokogiri](https://github.com/sparklemotion/nokogiri)
|
45
|
-
* [json](https://github.com/flori/json)
|
18
|
+
Before installing and using microformats-ruby, you'll want to have Ruby 2.2.9 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
|
46
19
|
|
20
|
+
microformats-ruby is developed using Ruby 2.4.4 and is additionally tested against version 2.5.1 using [Travis CI](https://travis-ci.org/microformats/microformats-ruby).
|
47
21
|
|
48
22
|
## Installation
|
49
23
|
|
50
|
-
|
24
|
+
If you're using [Bundler](https://bundler.io) to manage gem dependencies, add microformats-ruby to your project's Gemfile:
|
51
25
|
|
52
26
|
```ruby
|
53
|
-
|
27
|
+
source 'https://rubygems.org'
|
28
|
+
|
29
|
+
gem 'microformats', '~> 4.0', '>= 4.0.9'
|
54
30
|
```
|
55
31
|
|
56
|
-
|
32
|
+
…and then run:
|
57
33
|
|
58
|
-
```
|
59
|
-
bundle
|
34
|
+
```sh
|
35
|
+
bundle install
|
60
36
|
```
|
61
37
|
|
62
|
-
|
38
|
+
You may also install microformats-ruby directly using:
|
63
39
|
|
64
|
-
```
|
40
|
+
```sh
|
65
41
|
gem install microformats
|
66
42
|
```
|
67
43
|
|
68
|
-
|
69
44
|
## Usage
|
70
45
|
|
71
|
-
|
72
|
-
require "microformats"
|
46
|
+
An example working with a basic [h-card](http://microformats.org/wiki/h-card):
|
73
47
|
|
74
|
-
|
48
|
+
```ruby
|
49
|
+
source = '<div class="h-card"><p class="p-name">Jessica Lynn Suttles</p></div>'
|
75
50
|
collection = Microformats.parse(source)
|
76
51
|
|
77
|
-
#
|
52
|
+
# Get a copy of the canonical microformats hash structure
|
78
53
|
collection.to_hash
|
79
54
|
|
80
|
-
#
|
55
|
+
# The above as JSON in a string
|
81
56
|
collection.to_json
|
82
57
|
|
83
|
-
#
|
84
|
-
|
85
|
-
# return a string if there is only one item found
|
58
|
+
# Return a string if there is only one item found
|
86
59
|
collection.card.name #=> "Jessica Lynn Suttles"
|
60
|
+
```
|
61
|
+
|
62
|
+
Below is a more complex markup structure using an [h-entry](http://microformats.org/wiki/h-entry) with a nested h-card:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
source = '<article class="h-entry">
|
66
|
+
<h1 class="p-name">Microformats 2</h1>
|
67
|
+
<div class="h-card p-author">
|
68
|
+
<p class="p-name"><span class="p-first-name">Jessica</span> Lynn Suttles</p>
|
69
|
+
</div>
|
70
|
+
</article>'
|
87
71
|
|
88
|
-
source = "<article class='h-entry'>
|
89
|
-
<h1 class='p-name'>Microformats 2</h1>
|
90
|
-
<div class='h-card p-author'><p class='p-name'><span class='p-first-name'>Jessica</span> Lynn Suttles</p></div>
|
91
|
-
</article>"
|
92
72
|
collection = Microformats.parse(source)
|
73
|
+
|
93
74
|
collection.entry.name.to_s #=> "Microformats 2"
|
94
75
|
|
95
|
-
#
|
76
|
+
# Accessing nested microformats
|
96
77
|
collection.entry.author.name.to_s #=> "Jessica Lynn Suttles"
|
97
78
|
|
98
|
-
#
|
79
|
+
# Accessing nested microformats can use shortcuts or expanded method
|
99
80
|
collection.entry.author.name #=> "Jessica Lynn Suttles"
|
100
81
|
collection.entry.properties.author.properties.name.to_s #=> "Jessica Lynn Suttles"
|
101
82
|
|
102
|
-
#
|
83
|
+
# Use `_` instead of `-` to return property values
|
103
84
|
collection.entry.author.first_name #=> "Jessica"
|
104
85
|
collection.rel_urls #=> {}
|
86
|
+
```
|
87
|
+
|
88
|
+
Using the same markup patterns as above, here's an h-entry with multiple authors, each marked up as h-cards:
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
source = '<article class="h-entry">
|
92
|
+
<h1 class="p-name">Microformats 2</h1>
|
93
|
+
<div class="h-card p-author">
|
94
|
+
<p class="p-name"><span class="p-first-name">Jessica</span> Lynn Suttles</p>
|
95
|
+
</div>
|
96
|
+
<div class="h-card p-author">
|
97
|
+
<p class="p-name"><span class="p-first-name">Brandon</span> Edens</p>
|
98
|
+
</div>
|
99
|
+
</article>'
|
105
100
|
|
106
|
-
source = "<article class='h-entry'>
|
107
|
-
<h1 class='p-name'>Microformats 2</h1>
|
108
|
-
<div class='h-card p-author'><p class='p-name'><span class='p-first-name'>Jessica</span> Lynn Suttles</p></div>
|
109
|
-
<div class='h-card p-author'><p class='p-name'><span class='p-first-name'>Brandon</span> Edens</p></div>
|
110
|
-
</article>"
|
111
101
|
collection = Microformats.parse(source)
|
112
102
|
|
113
|
-
#
|
103
|
+
# Arrays of items will always return the first item by default
|
114
104
|
collection.entry.author.name #=> "Jessica Lynn Suttles"
|
115
105
|
collection.entry.author(1).name #=> "Brandon Edens"
|
116
106
|
|
117
|
-
#
|
107
|
+
# Get the actual array of items by using `:all`
|
118
108
|
collection.entry.author(:all).count #=> 2
|
119
109
|
collection.entry.author(:all)[1].name #=> "Brandon Edens"
|
120
|
-
|
121
|
-
```
|
122
|
-
|
123
|
-
* `source` can be a URL, filepath, or HTML
|
124
|
-
|
125
|
-
### Console utility
|
126
|
-
|
127
|
-
This gem also provides a command like script 'microformats' that will return the JSON equivalent
|
128
|
-
```
|
129
|
-
microformats http://example.com
|
130
|
-
```
|
131
|
-
|
132
|
-
You can give the microformats script a URL, filepath, or HTML
|
133
|
-
|
134
|
-
additionally, the script will accept input piped from stdin
|
135
|
-
|
136
110
|
```
|
137
|
-
curl http://example.com | microformats
|
138
|
-
```
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
## Ruby Gem release process
|
143
|
-
|
144
|
-
Check out latest code from GitHub repo.
|
145
|
-
|
146
|
-
```
|
147
|
-
git pull origin master
|
148
|
-
```
|
149
|
-
|
150
|
-
Make sure the version has been bumped up in all four places:
|
151
111
|
|
152
|
-
|
153
|
-
- [README.md (three places)](https://github.com/indieweb/microformats-ruby/blob/master/README.md)
|
112
|
+
### Command Line Interface
|
154
113
|
|
155
|
-
|
114
|
+
microformats-ruby also includes a command like program that will parse HTML and return a JSON representation of the included microformats.
|
156
115
|
|
157
|
-
```
|
158
|
-
|
116
|
+
```sh
|
117
|
+
microformats http://tantek.com
|
159
118
|
```
|
160
119
|
|
161
|
-
|
120
|
+
The program accepts URLs, file paths, or strings of HTML as an argument. Additionally, the script accepts piped input from other programs:
|
162
121
|
|
163
|
-
|
164
|
-
|
122
|
+
```sh
|
123
|
+
curl http://tantek.com | microformats
|
165
124
|
```
|
166
125
|
|
167
|
-
|
126
|
+
## Implementation Status
|
168
127
|
|
169
|
-
|
170
|
-
|
171
|
-
|
128
|
+
| Status | Specification or Parsing Rule |
|
129
|
+
|:------:|:------------------------------|
|
130
|
+
| ✅ | [Parse a document for microformats](http://microformats.org/wiki/microformats2-parsing#parse_a_document_for_microformats) |
|
131
|
+
| ✅ | [Parsing a `p-` property](http://microformats.org/wiki/microformats2-parsing#parsing_a_p-_property) |
|
132
|
+
| ✅ | [Parsing a `u-` property](http://microformats.org/wiki/microformats2-parsing#parsing_a_u-_property) |
|
133
|
+
| ✅ | [Parsing a `dt-` property](http://microformats.org/wiki/microformats2-parsing#parsing_a_dt-_property) |
|
134
|
+
| ✅ | [Parsing an `e-` property](http://microformats.org/wiki/microformats2-parsing#parsing_an_e-_property) |
|
135
|
+
| ✅ | [Parsing for implied properties](http://microformats.org/wiki/microformats2-parsing#parsing_for_implied_properties) |
|
136
|
+
| ✅ | Nested properties |
|
137
|
+
| ✅ | Nested microformat with associated property |
|
138
|
+
| ✅ | Nested microformat without associated property |
|
139
|
+
| ✅ | Recognize dynamically created properties |
|
140
|
+
| ✅ | [Support for `rel` attribute values](http://microformats.org/wiki/rel) |
|
141
|
+
| ✅ | [Normalizing `u-*` property values](http://microformats.org/wiki/microformats2-parsing-faq#normalizing_u-.2A_property_values) |
|
142
|
+
| ✅ | Parse the [value class pattern](http://microformats.org/wiki/value-class-pattern) |
|
143
|
+
| ✅ | Recognize [vendor extensions](http://microformats.org/wiki/microformats2#VENDOR_EXTENSIONS) |
|
144
|
+
| ✅ | Support for [classic microformats](http://microformats.org/wiki/Main_Page#Classic_Microformats) |
|
145
|
+
| ❌ | Recognize the [include pattern](http://microformats.org/wiki/include-pattern)
|
172
146
|
|
173
|
-
|
147
|
+
## Improving microformats-ruby
|
174
148
|
|
175
|
-
|
176
|
-
rake clean
|
177
|
-
rake clobber
|
178
|
-
```
|
179
|
-
|
180
|
-
Assuming your one of the gem owners and have release privileges, release the gem!
|
181
|
-
|
182
|
-
```
|
183
|
-
rake release
|
184
|
-
```
|
149
|
+
Have questions about using microformats-ruby? Found a bug? Have ideas for new or improved features? Want to pitch in and write some code?
|
185
150
|
|
186
|
-
|
151
|
+
Check out [CONTRIBUTING.md](https://github.com/microformats/microformats-ruby/blob/master/CONTRIBUTING.md) for more on how you can help!
|
187
152
|
|
188
|
-
|
153
|
+
## Acknowledgments
|
189
154
|
|
190
|
-
|
155
|
+
The microformats-ruby logo is derived from the [microformats logo mark](http://microformats.org/wiki/spread-microformats) by [Rémi Prévost](http://microformats.org/wiki/User:Remi).
|
191
156
|
|
192
|
-
|
157
|
+
microformats-ruby is written and maintained by:
|
193
158
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
-
|
200
|
-
- Jessica
|
201
|
-
-
|
202
|
-
-
|
203
|
-
-
|
204
|
-
-
|
205
|
-
-
|
206
|
-
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
2. Get it running (see Installation above)
|
212
|
-
3. Create your feature branch (`git checkout -b my-new-feature`)
|
213
|
-
4. Write your code and **specs**
|
214
|
-
5. Commit your changes (`git commit -am 'Add some feature'`)
|
215
|
-
6. Push to the branch (`git push origin my-new-feature`)
|
216
|
-
7. Create new Pull Request
|
217
|
-
|
218
|
-
If you find bugs, have feature requests or questions, please
|
219
|
-
[file an issue](https://github.com/indieweb/microformats-ruby/issues).
|
220
|
-
|
221
|
-
|
222
|
-
## Testing
|
223
|
-
|
224
|
-
### Specs
|
225
|
-
|
226
|
-
This uses a copy of [microformats tests repo](https://github.com/microformats/tests).
|
227
|
-
|
228
|
-
To run specs
|
229
|
-
```
|
230
|
-
rake spec
|
231
|
-
|
232
|
-
### Interactive
|
233
|
-
|
234
|
-
You can use the code interacively for testing but running
|
235
|
-
```
|
236
|
-
bundle console
|
237
|
-
```
|
159
|
+
- Ben Roberts ([@dissolve](https://github.com/dissolve))
|
160
|
+
- Jason Garber [(@jgarber623](https://github.com/jgarber623))
|
161
|
+
- Jessica Suttles ([@jlsuttles](https://github.com/jlsuttles))
|
162
|
+
- Shane Becker ([@veganstraightedge](https://github.com/veganstraightedge))
|
163
|
+
- Chris Stringer ([@jcstringer](https://github.com/jcstringer))
|
164
|
+
- Michael Mitchell ([@variousred](https://github.com/variousred))
|
165
|
+
- Jessica Dillon ([@jessicard](https://github.com/jessicard))
|
166
|
+
- Jeena Paradies ([@jeena](https://github.com/jeena))
|
167
|
+
- Marty McGuire ([@martymcguire](https://github.com/martymcguire))
|
168
|
+
- Tom Morris [(@tommorris](https://github.com/tommorris))
|
169
|
+
- Don Peterson [(@dpetersen](https://github.com/dpetersen))
|
170
|
+
- Matt Bohme [(@quady](https://github.com/quady))
|
171
|
+
- Brian Miller [(@BRIMIL01](https://github.com/BRIMIL01))
|
172
|
+
- Christian Weiske [(@cweiske](https://github.com/cweiske))
|
173
|
+
- Christian Kruse [(@ckruse](https://github.com/ckruse))
|
174
|
+
- Barnaby Walters [(@barnabywalters](https://github.com/barnabywalters))
|
175
|
+
- Jeremy Keith [(@adactio](https://github.com/adactio))
|
238
176
|
|
239
177
|
## License
|
240
178
|
|
241
|
-
|
179
|
+
microformats-ruby is dedicated to the public domain using the [Creative Commons CC0 1.0 Universal license](https://creativecommons.org/publicdomain/zero/1.0/).
|
180
|
+
|
181
|
+
The authors waive all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, and distribute the work, even for commercial purposes, all without asking permission.
|
242
182
|
|
243
|
-
|
183
|
+
See [LICENSE](https://github.com/microformats/microformats-ruby/blob/master/LICENSE) for more details.
|