Skip to content

Commit

Permalink
Use casecmp? to match folders and files (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhocquet authored Nov 17, 2019
1 parent b65fac7 commit 15f583f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/boxr/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def file_from_path(path)
folder = folder_from_path(path_items.join('/'))

files = folder_items(folder, fields: [:id, :name]).files
file = files.select{|f| f.name == file_name}.first
file = files.select{|f| f.name.casecmp?(file_name) }.first
raise BoxrError.new(boxr_message: "File not found: '#{file_name}'") if file.nil?
file
end
Expand Down
2 changes: 1 addition & 1 deletion lib/boxr/folders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def folder_from_path(path)

folder = path_folders.inject(Boxr::ROOT) do |parent_folder, folder_name|
folders = folder_items(parent_folder, fields: [:id, :name]).folders
folder = folders.select{|f| f.name == folder_name}.first
folder = folders.select{|f| f.name.casecmp?(folder_name) }.first
raise BoxrError.new(boxr_message: "Folder not found: '#{folder_name}'") if folder.nil?
folder
end
Expand Down
2 changes: 1 addition & 1 deletion lib/boxr/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Boxr
VERSION = "1.13.0".freeze
VERSION = "1.13.1".freeze
end

0 comments on commit 15f583f

Please sign in to comment.