diff --git a/README.txt b/README.md similarity index 89% rename from README.txt rename to README.md index b8a0033..d47bbdf 100644 --- a/README.txt +++ b/README.md @@ -14,7 +14,7 @@ Generic Microformats 2 Extractor ## SYNOPSIS - Microformats2.parse(File.open("http://iamshane.html")) + Microformats2.parse(File.open("example.html")) ## REQUIREMENTS @@ -36,6 +36,6 @@ run the tests/specs, and generate the RDoc. ## LICENSE -PUBLIC DOMAIN. +**PUBLIC DOMAIN.** Your heart is as free as the air you breathe. The ground you stand on is liberated territory. diff --git a/Rakefile b/Rakefile index e396157..2b4a243 100644 --- a/Rakefile +++ b/Rakefile @@ -6,6 +6,7 @@ require 'hoe' Hoe.spec 'microformats2' do developer('Shane Becker', 'veganstraightedge@gmail.com') extra_deps << ['nokogiri', ">= 0"] + self.readme_file = "README.md" end diff --git a/lib/microformats2.rb b/lib/microformats2.rb index c1eedb5..4c994ed 100644 --- a/lib/microformats2.rb +++ b/lib/microformats2.rb @@ -3,7 +3,7 @@ require 'time' require 'date' module Microformats2 - VERSION = "1.0.0" + VERSION = "1.0.1" class LoadError < StandardError; end diff --git a/test/test_microformats2.rb b/test/test_microformats2.rb index d8a254c..0ce65f1 100644 --- a/test/test_microformats2.rb +++ b/test/test_microformats2.rb @@ -7,12 +7,12 @@ class TestMicroformats2 < Test::Unit::TestCase Microformats2.parse(nil) end end - + def test_returns_hash_of_microformat_objects result = Microformats2.parse("A String") assert_equal Hash, result.class end - + def test_only_parse_microformats result = Microformats2.parse("
Something
") assert_equal 0, result.size @@ -23,19 +23,25 @@ class TestMicroformats2 < Test::Unit::TestCase assert_equal HCard, result[:hcard].first.class assert_equal 2, result[:hcard].length end - + def test_extracts_name_from_tag_with_multiple_classes result = Microformats2.parse(File.open(File.join(File.dirname(__FILE__), "simple.html"))) assert_equal "Chris", result[:hcard].first.given_name end + def test_extracts_hcalendar_from_an_html_file + result = Microformats2.parse(File.open(File.join(File.dirname(__FILE__), "IndieWebCamp.html"))) + assert_equal 1, result[:hevent].length + assert result[:hcard].map { |h| h.name }.include?("Urban Airship") + end + def test_extracts_hcard_from_html hcard = <<-END