File tree Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Expand file tree Collapse file tree 4 files changed +6
-4
lines changed 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 = {})
110
110
content_types [ mime_type ] unless mime_type == 'text/plain' && ( options [ :sample ] || block_given? )
111
111
# Find a format based on the file name:
112
112
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? }
114
114
# Find a format based on the file extension:
115
115
when file_ext = options [ :file_extension ]
116
116
file_extensions [ file_ext . to_sym ]
Original file line number Diff line number Diff line change 1
1
require 'net/http'
2
2
require 'link_header'
3
3
require 'time'
4
+ require 'openssl'
4
5
5
6
module RDF ; module Util
6
7
##
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ def self.to_sym; :foo_bar; end
37
37
{
38
38
"symbol" => :foo_bar ,
39
39
"path with extension" => "filename.test" ,
40
+ "domain with no path" => { file_name : "http://example.org" } ,
40
41
"file_name" => { file_name : "filename.test" } ,
41
42
"file_extension" => { file_extension : "test" } ,
42
43
"content_type" => { content_type : "application/test" } ,
@@ -49,8 +50,8 @@ def self.to_sym; :foo_bar; end
49
50
expect { |b | RDF ::Format . for ( arg , &b ) } . to yield_control
50
51
end
51
52
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
54
55
end
55
56
56
57
it "returns detected format for duplicates" do
You can’t perform that action at this time.
0 commit comments