Skip to content

Commit d6dd27d

Browse files
committed
Don't use canonicalize option to trigger writing VERSION, just use the absence of a version option. Otherwise, canonicalize will modify literals and IRIs to their canonical form.
1 parent 68050ab commit d6dd27d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/rdf/ntriples/writer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def initialize(output = $stdout, validate: true, **options, &block)
217217
# @return [self]
218218
# @abstract
219219
def write_prologue
220-
puts %(VERSION #{version.inspect}) if version && !canonicalize?
220+
puts %(VERSION #{version.inspect}) if version
221221
@logged_errors_at_prolog = log_statistics[:error].to_i
222222
super
223223
end

spec/nquads_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,9 @@
322322
end.to write(%(VERSION "1.2"))
323323
end
324324

325-
it "does not write version with :version and :canonicalize options" do
325+
it " not write version with unless specified" do
326326
expect do
327-
described_class.new($stdout, version: "1.2", canonicalize: true) do |w|
327+
described_class.new($stdout, version: nil) do |w|
328328
w.insert(graph)
329329
end
330330
end.not_to write(%(VERSION "1.2"))

spec/ntriples_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,9 +931,9 @@
931931
end.to write(%(VERSION "1.2"))
932932
end
933933

934-
it "does not write version with :version and :canonicalize options" do
934+
it "does not write version with unless specified" do
935935
expect do
936-
writer.new($stdout, version: "1.2", canonicalize: true) do |w|
936+
writer.new($stdout, version: nil) do |w|
937937
w.insert(graph)
938938
end
939939
end.not_to write(%(VERSION "1.2"))

0 commit comments

Comments
 (0)