Skip to content

Commit

Permalink
Finish 2.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Mar 16, 2017
2 parents b9df327 + b016e5e commit 2ee5565
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.4
2.2.5
2 changes: 1 addition & 1 deletion lib/rdf/format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def self.for(options = {})
content_types[mime_type] unless mime_type == 'text/plain' && (options[:sample] || block_given?)
# Find a format based on the file name:
when file_name = options[:file_name]
self.for(file_extension: File.extname(RDF::URI(file_name).path)[1..-1]) { yield if block_given? }
self.for(file_extension: File.extname(RDF::URI(file_name).path.to_s)[1..-1]) { yield if block_given? }
# Find a format based on the file extension:
when file_ext = options[:file_extension]
file_extensions[file_ext.to_sym]
Expand Down
1 change: 1 addition & 0 deletions lib/rdf/util/file.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'net/http'
require 'link_header'
require 'time'
require 'openssl'

module RDF; module Util
##
Expand Down
5 changes: 3 additions & 2 deletions spec/format_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def self.to_sym; :foo_bar; end
{
"symbol" => :foo_bar,
"path with extension" => "filename.test",
"domain with no path" => {file_name: "http://example.org"},
"file_name" => {file_name: "filename.test"},
"file_extension" => {file_extension: "test"},
"content_type" => {content_type: "application/test"},
Expand All @@ -49,8 +50,8 @@ def self.to_sym; :foo_bar; end
expect {|b| RDF::Format.for(arg, &b)}.to yield_control
end

it "returns last defined format for duplicates" do
expect(RDF::Format.for(arg)).to eq RDF::Format::BarFormat
it "returns nil last defined format for duplicates" do
expect(RDF::Format.for(arg) || RDF::Format::BarFormat).to eq RDF::Format::BarFormat
end

it "returns detected format for duplicates" do
Expand Down

0 comments on commit 2ee5565

Please sign in to comment.