Skip to content

Commit

Permalink
Finish 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed May 18, 2017
2 parents 08d74e4 + 4fb77f8 commit 8f5ace0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0
2.2.2
2 changes: 1 addition & 1 deletion lib/rdf/rdfa/reader/nokogiri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def doc_errors
# FIXME: Nokogiri version 1.5 thinks many HTML5 elements are invalid, so just ignore all Tag errors.
# Nokogumbo might make this simpler
if @host_language == :html5
@doc.errors
@doc.errors.reject {|e| e.to_s =~ /The doctype must be the first token in the document/}
else
@doc.errors.reject {|e| e.to_s =~ /(?:Tag \w+ invalid)|(?:Missing attribute name)/}
end
Expand Down
6 changes: 2 additions & 4 deletions lib/rdf/rdfa/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ class Writer < RDF::Writer
# @return [Array<URI>]
attr :heading_predicates

HAML_OPTIONS = {
ugly: false, # to preserve whitespace without using entities
}
HAML_OPTIONS = {}

# @return [Graph] Graph of statements serialized
attr_accessor :graph
Expand Down Expand Up @@ -113,7 +111,7 @@ def self.options
# Defines order of predicates to use in heading.
# @option options [String, Symbol, Hash{Symbol => String}] :haml (DEFAULT_HAML) HAML templates used for generating code
# @option options [Hash] :haml_options (HAML_OPTIONS)
# Options to pass to Haml::Engine.new. Default options set `ugly: false` to ensure that whitespace in literals with newlines is properly preserved.
# Options to pass to Haml::Engine.new.
# @yield [writer]
# @yieldparam [RDF::Writer] writer
def initialize(output = $stdout, options = {}, &block)
Expand Down
2 changes: 1 addition & 1 deletion rdf-rdfa.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |gem|
gem.requirements = []

gem.add_runtime_dependency 'rdf', '~> 2.2'
gem.add_runtime_dependency 'haml', '~> 4.0'
gem.add_runtime_dependency 'haml', '~> 5.0'
gem.add_runtime_dependency 'rdf-xsd', '~> 2.1'
gem.add_runtime_dependency 'rdf-aggregate-repo', '~> 2.2'
gem.add_runtime_dependency 'htmlentities', '~> 4.3'
Expand Down
6 changes: 2 additions & 4 deletions spec/reader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@

context :interface do
subject {
%(<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:dc="http://purl.org/dc/elements/1.1/">
%(<!DOCTYPE html>
<html prefixes="dc: http://purl.org/dc/elements/1.1/">
<head>
<title>Test 0001</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion spec/suite_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Fixtures::TestCase.for_specific(host_language, version, Fixtures::TestCase::Test.send(classification)) do |t|
specify "test #{t.num}: #{t.description}#{", (negative test)" if t.expectedResults.false?}" do
pending "Invalid SPARQL query" if %w(0279 0284).include?(t.num)
pending "CDN messes up email addresses" if %w(0065 0176).include?(t.num)
skip "CDN messes up email addresses" if %w(0065 0176).include?(t.num)
pending "Nokogumbo error" if t.num == "0216" && host_language == "xhtml5"
skip "XMLLiteral" if %w(0198).include?(t.num)
begin
Expand Down
30 changes: 15 additions & 15 deletions spec/writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context "plain literal" do
subject do
@graph << [EX.a, EX.b, "foo"]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand Down Expand Up @@ -93,7 +93,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context "typed resource" do
subject do
@graph << [EX.a, RDF.type, EX.Type]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand All @@ -110,7 +110,7 @@ class EX < RDF::Vocabulary("http://example/"); end
subject do
@graph << [EX.a, RDF.type, EX.t1]
@graph << [EX.a, RDF.type, EX.t2]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand Down Expand Up @@ -217,7 +217,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context v do
subject {
@graph << [EX.a, EX.b, RDF::Literal::Date.new(v)]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
}
matches.each do |path, value|
it "returns #{value.inspect} for xpath #{path}" do
Expand Down Expand Up @@ -252,7 +252,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context v do
subject {
@graph << [EX.a, EX.b, RDF::Literal::Time.new(v)]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
}
matches.each do |path, value|
it "returns #{value.inspect} for xpath #{path}" do
Expand Down Expand Up @@ -287,7 +287,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context v do
subject {
@graph << [EX.a, EX.b, RDF::Literal::DateTime.new(v)]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
}
matches.each do |path, value|
it "returns #{value.inspect} for xpath #{path}" do
Expand All @@ -301,7 +301,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context "rdf:XMLLiteral" do
subject do
@graph << [EX.a, EX.b, RDF::Literal::XML.new("E = mc<sup>2</sup>: The Most Urgent Problem of Our Time")]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand All @@ -318,7 +318,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context "xsd:string" do
subject do
@graph << [EX.a, EX.b, RDF::Literal.new("Albert Einstein", datatype: RDF::XSD.string)]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand All @@ -335,7 +335,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context "unknown" do
subject do
@graph << [EX.a, EX.b, RDF::Literal.new("Albert Einstein", datatype: EX.unknown)]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand All @@ -354,7 +354,7 @@ class EX < RDF::Vocabulary("http://example/"); end
subject do
@graph << [EX.a, EX.b, "c"]
@graph << [EX.a, EX.b, "d"]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand All @@ -370,7 +370,7 @@ class EX < RDF::Vocabulary("http://example/"); end
context "resource objects" do
subject do
@graph << [EX.a, EX.b, EX.c]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand All @@ -388,7 +388,7 @@ class EX < RDF::Vocabulary("http://example/"); end
subject do
@graph << [EX.a, EX.b, EX.c]
@graph << [EX.a, EX.b, EX.d]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand Down Expand Up @@ -513,7 +513,7 @@ class EX < RDF::Vocabulary("http://example/"); end
pending("Serializing multiple lists") if test == "multiple collections"
skip "REXML" if test == 'issue 14' && !Module.constants.include?(:Nokogiri)
@graph = parse(input, format: :ttl)
html = serialize(haml_options: {ugly: false})
html = serialize(haml_options: {})
result.each do |path, value|
expect(html).to have_xpath(path, value, logger)
end
Expand All @@ -525,7 +525,7 @@ class EX < RDF::Vocabulary("http://example/"); end
subject do
@graph << [EX.a, EX.b, EX.c]
@graph << [EX.c, EX.d, EX.e]
serialize(haml_options: {ugly: false})
serialize(haml_options: {})
end

{
Expand Down Expand Up @@ -561,7 +561,7 @@ class EX < RDF::Vocabulary("http://example/"); end
end
input = t.input("html5", "rdfa1.1")
@graph = RDF::Repository.load(t.input("html5", "rdfa1.1"), logger: false)
result = serialize(haml: template, haml_options: {ugly: false})
result = serialize(haml: template, haml_options: {})
logger.info result.force_encoding("utf-8")
graph2 = parse(result, format: :rdfa, logger: logger)
# Need to put this in to avoid problems with added markup
Expand Down

0 comments on commit 8f5ace0

Please sign in to comment.