File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 2.2.4
1+ 2.2.5
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ def self.for(options = {})
110110 content_types [ mime_type ] unless mime_type == 'text/plain' && ( options [ :sample ] || block_given? )
111111 # Find a format based on the file name:
112112 when file_name = options [ :file_name ]
113- self . for ( file_extension : File . extname ( RDF ::URI ( file_name ) . path ) [ 1 ..-1 ] ) { yield if block_given? }
113+ self . for ( file_extension : File . extname ( RDF ::URI ( file_name ) . path . to_s ) [ 1 ..-1 ] ) { yield if block_given? }
114114 # Find a format based on the file extension:
115115 when file_ext = options [ :file_extension ]
116116 file_extensions [ file_ext . to_sym ]
Original file line number Diff line number Diff line change 11require 'net/http'
22require 'link_header'
33require 'time'
4+ require 'openssl'
45
56module RDF ; module Util
67 ##
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ def self.to_sym; :foo_bar; end
3737 {
3838 "symbol" => :foo_bar ,
3939 "path with extension" => "filename.test" ,
40+ "domain with no path" => { file_name : "http://example.org" } ,
4041 "file_name" => { file_name : "filename.test" } ,
4142 "file_extension" => { file_extension : "test" } ,
4243 "content_type" => { content_type : "application/test" } ,
@@ -49,8 +50,8 @@ def self.to_sym; :foo_bar; end
4950 expect { |b | RDF ::Format . for ( arg , &b ) } . to yield_control
5051 end
5152
52- it "returns last defined format for duplicates" do
53- expect ( RDF ::Format . for ( arg ) ) . to eq RDF ::Format ::BarFormat
53+ it "returns nil last defined format for duplicates" do
54+ expect ( RDF ::Format . for ( arg ) || RDF :: Format :: BarFormat ) . to eq RDF ::Format ::BarFormat
5455 end
5556
5657 it "returns detected format for duplicates" do
You can’t perform that action at this time.
0 commit comments