Skip to content

Commit

Permalink
Updates for keyword arguments. (reverted from commit e08d5b4)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Dec 29, 2015
1 parent e038668 commit ea989c2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ env:
rvm:
- 2.0
- 2.1
- 2.2.4
- jruby-9.0.4.0
- 2.2.1
- jruby
- rbx-2
gemfile:
- Gemfile
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ The template hash defines four Haml templates:
}

## Dependencies
* [Ruby](http://ruby-lang.org/) (>= 2.0)
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 2.0)
* [Ruby](http://ruby-lang.org/) (>= 1.9.3)
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.1)
* [Haml](https://rubygems.org/gems/haml) (>= 4.0)
* [HTMLEntities](https://rubygems.org/gems/htmlentities) (>= 4.3.4)
* Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6.6)
* [HTMLEntities](https://rubygems.org/gems/htmlentities) (>= 4.3.1)
* Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6.1)

## Documentation
Full documentation available on [Rubydoc.info][RDFa doc]
Expand Down
8 changes: 4 additions & 4 deletions lib/rdf/rdfa/expansion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ def initialize(name, &block)
end
end

def antecedent(subject, predicate, object)
antecedents << RDF::Query::Pattern.new(subject: subject, predicate: predicate, object: object)
def antecedent(subject, prediate, object)
antecedents << RDF::Query::Pattern.new(subject, prediate, object)
end

def consequent(subject, predicate, object)
consequents << RDF::Query::Pattern.new(subject: subject, predicate: predicate, object: object)
def consequent(subject, prediate, object)
consequents << RDF::Query::Pattern.new(subject, prediate, object)
end

##
Expand Down
18 changes: 9 additions & 9 deletions lib/rdf/rdfa/reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def extract_script(el, input, type, options, &block)
when nil
yield statement if @options[:rdfagraph].include?(:output)
when RDF::RDFA.ProcessorGraph
yield RDF::Statement(*statement.to_triple) if @options[:rdfagraph].include?(:processor)
yield RDF::Statement.new(*statement.to_triple) if @options[:rdfagraph].include?(:processor)
end
end

Expand Down Expand Up @@ -532,17 +532,17 @@ def add_processor_message(node, message, process_class, &block)
if @options[:processor_callback] || @options[:rdfagraph].include?(:processor)
n = RDF::Node.new
processor_statements = [
RDF::Statement(n, RDF["type"], process_class, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement(n, RDF::URI("http://purl.org/dc/terms/description"), message, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement(n, RDF::URI("http://purl.org/dc/terms/date"), RDF::Literal::Date.new(DateTime.now), graph_name: RDF::RDFA.ProcessorGraph)
RDF::Statement.new(n, RDF["type"], process_class, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement.new(n, RDF::URI("http://purl.org/dc/terms/description"), message, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement.new(n, RDF::URI("http://purl.org/dc/terms/date"), RDF::Literal::Date.new(DateTime.now), graph_name: RDF::RDFA.ProcessorGraph)
]
processor_statements << RDF::Statement(n, RDF::RDFA.context, base_uri, graph_name: RDF::RDFA.ProcessorGraph) if base_uri
processor_statements << RDF::Statement.new(n, RDF::RDFA.context, base_uri, graph_name: RDF::RDFA.ProcessorGraph) if base_uri
if node.respond_to?(:path)
nc = RDF::Node.new
processor_statements += [
RDF::Statement(n, RDF::RDFA.context, nc, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement(nc, RDF["type"], RDF::PTR.XPathPointer, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement(nc, RDF::PTR.expression, node.path, graph_name: RDF::RDFA.ProcessorGraph)
RDF::Statement.new(n, RDF::RDFA.context, nc, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement.new(nc, RDF["type"], RDF::PTR.XPathPointer, graph_name: RDF::RDFA.ProcessorGraph),
RDF::Statement.new(nc, RDF::PTR.expression, node.path, graph_name: RDF::RDFA.ProcessorGraph)
]
end

Expand All @@ -564,7 +564,7 @@ def add_processor_message(node, message, process_class, &block)
# @param [RDF::Value] graph_name the graph name of the statement
# @raise [RDF::ReaderError] Checks parameter types and raises if they are incorrect if parsing mode is _validate_.
def add_triple(node, subject, predicate, object, graph_name = nil)
statement = RDF::Statement.new(subject: subject, predicate: predicate, object: object)
statement = RDF::Statement.new(subject, predicate, object)
add_error(node, "statement #{RDF::NTriples.serialize(statement)} is invalid") unless statement.valid?
if subject && predicate && object # Basic sanity checking
add_info(node, "statement: #{RDF::NTriples.serialize(statement)}")
Expand Down
4 changes: 2 additions & 2 deletions rdf-rdfa.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Gem::Specification.new do |gem|
gem.require_paths = %w(lib)
gem.has_rdoc = false

gem.required_ruby_version = '>= 2.0'
gem.required_ruby_version = '>= 1.9.3'
gem.requirements = []

gem.add_runtime_dependency 'rdf', '~> 1.99'
gem.add_runtime_dependency 'haml', '~> 4.0'
gem.add_runtime_dependency 'rdf-xsd', '~> 1.1'
gem.add_runtime_dependency 'rdf-aggregate-repo', '~> 1.1'
gem.add_runtime_dependency 'htmlentities', '~> 4.3', '>= 4.3.4'
gem.add_runtime_dependency 'htmlentities', '~> 4.3'

gem.add_development_dependency 'open-uri-cached', '~> 0.0', '>= 0.0.5'
gem.add_development_dependency 'json-ld', '~> 1.1'
Expand Down
16 changes: 8 additions & 8 deletions spec/reader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
html = %(
<div resource="foo"><span property="dc:title">Title</span></div>
)
expected = RDF::Graph.new << RDF::Statement(RDF::URI("foo"), RDF::Vocab::DC.title, "Title")
expected = RDF::Graph.new << RDF::Statement.new(RDF::URI("foo"), RDF::Vocab::DC.title, "Title")
expect(parse(html)).to be_equivalent_graph(expected, logger: logger, format: :ttl)
end

Expand Down Expand Up @@ -366,7 +366,7 @@
html = %(
<div about="foo"><a href="bar" rel="rdf:value"></a></div>
)
expected = RDF::Graph.new << RDF::Statement(RDF::URI("foo"), RDF.value, RDF::URI("bar"))
expected = RDF::Graph.new << RDF::Statement.new(RDF::URI("foo"), RDF.value, RDF::URI("bar"))
expect(parse(html)).to be_equivalent_graph(expected, logger: logger, format: :ttl)
end
end
Expand All @@ -381,16 +381,16 @@
}
context "RDFa 1.0" do
it "creates a statement with subject from @src" do
expected = RDF::Graph.new << RDF::Statement(RDF::URI("bar"), RDF::Vocab::DC.title, "Title")
expected = RDF::Graph.new << RDF::Statement.new(RDF::URI("bar"), RDF::Vocab::DC.title, "Title")
expect(parse(subject, version: "rdfa1.0")).to be_equivalent_graph(expected, logger: logger, format: :ttl)
end
end

context "RDFa 1.1" do
it "creates a statement with object from @src" do
expected = RDF::Graph.new <<
RDF::Statement(RDF::URI("foo"), RDF.value, RDF::URI("bar")) <<
RDF::Statement(RDF::URI("foo"), RDF::Vocab::DC.title, "Title")
RDF::Statement.new(RDF::URI("foo"), RDF.value, RDF::URI("bar")) <<
RDF::Statement.new(RDF::URI("foo"), RDF::Vocab::DC.title, "Title")
expect(parse(subject)).to be_equivalent_graph(expected, logger: logger, format: :ttl)
end
end
Expand Down Expand Up @@ -425,7 +425,7 @@

it "empty @typeof on root" do
html = %(<html typeof=""><span property="dc:title">Title</span></html>)
expected = RDF::Graph.new << RDF::Statement(RDF::URI(""), RDF::Vocab::DC.title, "Title")
expected = RDF::Graph.new << RDF::Statement.new(RDF::URI(""), RDF::Vocab::DC.title, "Title")

expect(parse(html)).to be_equivalent_graph(expected, logger: logger, format: :ttl)
end
Expand Down Expand Up @@ -573,7 +573,7 @@
before(:all) do
@rdfa = %(<span about="" property="rdf:value" datatype="#{dt}" content="#{value}"/>)
dt_uri = RDF::XSD.send(dt.split(':').last)
@expected = RDF::Graph.new << RDF::Statement(RDF::URI(""), RDF.value, RDF::Literal.new(value, datatype: dt_uri))
@expected = RDF::Graph.new << RDF::Statement.new(RDF::URI(""), RDF.value, RDF::Literal.new(value, datatype: dt_uri))
end

context "with #{value}" do
Expand All @@ -597,7 +597,7 @@
<div property="foo:due:to:facebook:interpretation:of:CURIE">Value</div>
</html>
)
expected = RDF::Graph.new << RDF::Statement(
expected = RDF::Graph.new << RDF::Statement.new(
RDF::URI(""),
RDF::URI("http://example/due:to:facebook:interpretation:of:CURIE"),
"Value"
Expand Down

0 comments on commit ea989c2

Please sign in to comment.