Skip to content

Commit 50f2a64

Browse files
committed
Finish 2.0.0
2 parents b4cb770 + b402cf3 commit 50f2a64

9 files changed

Lines changed: 32 additions & 71 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0.beta2
1+
2.0.0

lib/rdf.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,7 @@ def self.Literal(*args, &block)
120120
#
121121
# @param (see RDF::Graph#initialize)
122122
# @return [RDF::Graph]
123-
def self.Graph(*args, **options, &block)
124-
unless args.empty?
125-
warn "[DEPRECATION] Graph#initialize now uses keyword arguments. Called from #{Gem.location_of_caller.join(':')}"
126-
options[:graph_name] ||= args.first
127-
end
123+
def self.Graph(**options, &block)
128124
Graph.new(options, &block)
129125
end
130126

lib/rdf/model/graph.rb

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,13 @@ def self.load(url, graph_name: nil, **options, &block)
8787
end
8888

8989
##
90-
# @overload initialize(graph_name, options)
91-
# @param [RDF::Resource] graph_name
92-
# The graph_name from the associated {RDF::Queryable} associated
93-
# with this graph as provided with the `:data` option
94-
# (only for {RDF::Queryable} instances supporting
95-
# named graphs).
96-
# @param [Hash{Symbol => Object}] options
97-
# @option options [RDF::Queryable] :data (RDF::Repository.new)
98-
# Storage behind this graph.
99-
# @deprecated This form is deprecated in version 2.0.
100-
#
101-
# @overload initialize(graph_name: nil, data: nil)
102-
# @param [RDF::Resource] graph_name
103-
# The graph_name from the associated {RDF::Queryable} associated
104-
# with this graph as provided with the `:data` option
105-
# (only for {RDF::Queryable} instances supporting
106-
# named graphs).
107-
# @param [RDF::Queryable] :data (RDF::Repository.new)
108-
# Storage behind this graph.
90+
# @param [RDF::Resource] graph_name
91+
# The graph_name from the associated {RDF::Queryable} associated
92+
# with this graph as provided with the `:data` option
93+
# (only for {RDF::Queryable} instances supporting
94+
# named graphs).
95+
# @param [RDF::Queryable] :data (RDF::Repository.new)
96+
# Storage behind this graph.
10997
#
11098
# @raise [ArgumentError] if a `data` does not support named graphs.
11199
# @note
@@ -115,12 +103,7 @@ def self.load(url, graph_name: nil, **options, &block)
115103
# graphs which are named, but the name is not a property of the graph.
116104
# @yield [graph]
117105
# @yieldparam [Graph]
118-
def initialize(*args, graph_name: nil, data: nil, **options, &block)
119-
unless args.empty?
120-
warn "[DEPRECATION] Graph#initialize now uses keyword arguments. Called from #{Gem.location_of_caller.join(':')}"
121-
graph_name ||= args.first
122-
end
123-
106+
def initialize(graph_name: nil, data: nil, **options, &block)
124107
@graph_name = case graph_name
125108
when nil then nil
126109
when RDF::Resource then graph_name

lib/rdf/model/list.rb

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,14 @@ def self.[](*values)
4848
# g = RDF::Graph.new << l
4949
# g.count # => l.count
5050
#
51-
# @overload initialize(subject = nil, graph = nil, values = nil, &block)
52-
# @param [RDF::Resource] subject
53-
# Subject should be an {RDF::Node}, not a {RDF::URI}. A list with an IRI head will not validate, but is commonly used to detect if a list is valid.
54-
# @param [RDF::Graph] graph
55-
# @param [Array<RDF::Term>] values
56-
# Any values which are not terms are coerced to `RDF::Literal`.
57-
# @yield [list]
58-
# @yieldparam [RDF::List] list
59-
# @deprecated This form is deprecated in version 2.0
60-
#
61-
# @overload initialize(subject: nil, graph: nil, values: nil, &block)
62-
# @param [RDF::Resource] subject (RDF.nil)
63-
# Subject should be an {RDF::Node}, not a {RDF::URI}. A list with an IRI head will not validate, but is commonly used to detect if a list is valid.
64-
# @param [RDF::Graph] graph (RDF::Graph.new)
65-
# @param [Array<RDF::Term>] values
66-
# Any values which are not terms are coerced to `RDF::Literal`.
67-
# @yield [list]
68-
# @yieldparam [RDF::List] list
69-
#
70-
def initialize(*args, subject: nil, graph: nil, values: nil, &block)
71-
unless args.empty?
72-
raise ArgumentError, "[FATAL DEPRECATION] List#initialize now uses keyword arguments. Called from #{Gem.location_of_caller.join(':')}"
73-
end
51+
# @param [RDF::Resource] subject (RDF.nil)
52+
# Subject should be an {RDF::Node}, not a {RDF::URI}. A list with an IRI head will not validate, but is commonly used to detect if a list is valid.
53+
# @param [RDF::Graph] graph (RDF::Graph.new)
54+
# @param [Array<RDF::Term>] values
55+
# Any values which are not terms are coerced to `RDF::Literal`.
56+
# @yield [list]
57+
# @yieldparam [RDF::List] list
58+
def initialize(subject: nil, graph: nil, values: nil, &block)
7459
@subject = subject || RDF.nil
7560
@graph = graph || RDF::Graph.new
7661
is_empty = @graph.query(subject: subject, predicate: RDF.first).empty?

lib/rdf/transaction.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def self.begin(repository, mutable: false, **options, &block)
118118
#
119119
# @deprecated
120120
# @return [RDF::Enumerable]
121-
attr_reader :deletes
122121
def deletes
122+
warn "[DEPRECATION] Transaction#deletes now uses keyword arguments. Called from #{Gem.location_of_caller.join(':')}"
123123
self.changes.deletes
124124
end
125125

@@ -128,8 +128,8 @@ def deletes
128128
#
129129
# @deprecated
130130
# @return [RDF::Enumerable]
131-
attr_reader :inserts
132131
def inserts
132+
warn "[DEPRECATION] Transaction#inserts now uses keyword arguments. Called from #{Gem.location_of_caller.join(':')}"
133133
self.changes.inserts
134134
end
135135

lib/rdf/vocab/writer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ def write_epilogue
9292

9393
@output.print %(# -*- encoding: utf-8 -*-
9494
# frozen_string_literal: true
95-
# This file generated automatically using vocab-fetch from #{source}
95+
# This file generated automatically using rdf vocabulary format from #{source}
9696
require 'rdf'
9797
module #{module_name}
9898
# @!parse
9999
# # Vocabulary for <#{base_uri}>
100-
# class #{vocab.name} < RDF::#{"Strict" if strict}Vocabulary
100+
# class #{class_name} < RDF::#{"Strict" if strict}Vocabulary
101101
# end
102-
class #{vocab.name} < RDF::#{"Strict" if strict}Vocabulary("#{base_uri}")
102+
class #{class_name} < RDF::#{"Strict" if strict}Vocabulary("#{base_uri}")
103103
).gsub(/^ /, '')
104104

105105
# Split nodes into Class/Property/Datatype/Other

rdf.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
2929
gem.requirements = []
3030
gem.add_runtime_dependency 'link_header', '~> 0.0', '>= 0.0.8'
3131
gem.add_runtime_dependency 'hamster', '~> 3.0'
32-
gem.add_development_dependency 'rdf-spec', '>= 2.0.0.beta', '< 3'
33-
gem.add_development_dependency 'rdf-vocab', '>= 2.0.0.beta', '< 3'
34-
gem.add_development_dependency 'rdf-xsd', '>= 2.0.0.beta', '< 3'
32+
gem.add_development_dependency 'rdf-spec', '~> 2.0'
33+
gem.add_development_dependency 'rdf-vocab', '~> 2.0'
34+
gem.add_development_dependency 'rdf-xsd', '~> 2.0'
3535
gem.add_development_dependency 'rest-client', '~> 1.7'
3636
gem.add_development_dependency 'rspec', '~> 3.0'
3737
gem.add_development_dependency 'rspec-its', '~> 1.0'

spec/model_graph_spec.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@
1717
context "as method" do
1818
it "with keyword arg" do
1919
expect(described_class).to receive(:new).with(graph_name: "http://ruby-rdf.github.com/rdf/etc/doap.nt")
20-
expect {
21-
RDF::Graph(graph_name: "http://ruby-rdf.github.com/rdf/etc/doap.nt")
22-
}.not_to write('[DEPRECATION]').to(:error)
20+
RDF::Graph(graph_name: "http://ruby-rdf.github.com/rdf/etc/doap.nt")
2321
end
2422

25-
it "with positional arg (DEPRECATED)" do
26-
expect(described_class).to receive(:new).with(graph_name: "http://ruby-rdf.github.com/rdf/etc/doap.nt")
23+
it "with positional arg (removed)" do
2724
expect {
2825
RDF::Graph("http://ruby-rdf.github.com/rdf/etc/doap.nt")
29-
}.to write('[DEPRECATION]').to(:error)
26+
}.to raise_error(ArgumentError)
3027
end
3128
end
3229

@@ -56,10 +53,10 @@
5653
expect { subject }.to_not raise_error
5754
end
5855

59-
it "should be instantiable with positional arg (DEPRECATED)" do
56+
it "should not be instantiable with positional arg" do
6057
expect {
6158
described_class.new("http://ruby-rdf.github.com/rdf/etc/doap.nt", data: RDF::Repository.new)
62-
}.to write('[DEPRECATION]').to(:error)
59+
}.to raise_error(ArgumentError)
6360
end
6461

6562
it "should not be instantiable by default" do

spec/model_list_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
expect(l.subject).to eq(n)
143143
end
144144

145-
it "should be instantiable with positional args (DEPRECATED)" do
145+
it "should not be instantiable with positional args" do
146146
expect {
147147
described_class.new(RDF::Node.new, graph)
148148
}.to raise_error ArgumentError

0 commit comments

Comments
 (0)