@@ -168,8 +168,8 @@ def self.options
168168 symbol : :validate ,
169169 datatype : TrueClass ,
170170 control : :checkbox ,
171- on : [ "--validate" ] ,
172- description : "Validate input file ." ) ,
171+ on : [ "--[no-] validate" ] ,
172+ description : "Validate on input and output ." ) ,
173173 RDF ::CLI ::Option . new (
174174 symbol : :verifySSL ,
175175 datatype : TrueClass ,
@@ -181,7 +181,7 @@ def self.options
181181 symbol : :version ,
182182 control : :select ,
183183 datatype : RDF ::Format ::VERSIONS , # 1.1, 1.2, or 1.2-basic
184- on : [ "--version" ] ,
184+ on : [ "--version VERSION " ] ,
185185 description : "RDF Version." ) ,
186186 ]
187187 end
@@ -290,7 +290,7 @@ def to_sym
290290 # any additional options
291291 # @param [Boolean] validate (false)
292292 # whether to validate the parsed statements and values
293- # @option options [String] :version ("1.2")
293+ # @option options [String] :version
294294 # Parse a specific version of RDF ("1.1', "1.2", or "1.2-basic"")
295295 # @yield [reader] `self`
296296 # @yieldparam [RDF::Reader] reader
@@ -320,6 +320,10 @@ def initialize(input = $stdin,
320320 # The rdfstar option implies version 1.2, but can be overridden
321321 @options [ :version ] ||= "1.2" if @options [ :rdfstar ]
322322
323+ unless self . version . nil? || RDF ::Format ::VERSIONS . include? ( self . version )
324+ log_error ( "Expected version to be one of #{ RDF ::Format ::VERSIONS . join ( ', ' ) } , was #{ self . version } " )
325+ end
326+
323327 @input = case input
324328 when String then StringIO . new ( input )
325329 else input
@@ -406,10 +410,10 @@ def prefix(name, uri = nil)
406410 # Returns the RDF version determined by this reader.
407411 #
408412 # @example
409- # reader.version #=> RDF::URI('http://purl.org/dc/terms/')
413+ # reader.version #=> "1.2"
410414 #
411415 # @return [String]
412- # @since 3.3.2
416+ # @since 3.3.4
413417 def version
414418 @options [ :version ]
415419 end
0 commit comments