Skip to content

Commit 2ee5565

Browse files
committed
Finish 2.2.5
2 parents b9df327 + b016e5e commit 2ee5565

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.4
1+
2.2.5

lib/rdf/format.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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]

lib/rdf/util/file.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'net/http'
22
require 'link_header'
33
require 'time'
4+
require 'openssl'
45

56
module RDF; module Util
67
##

spec/format_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)