diff options
| author | 2022-03-19 21:48:07 -0400 | |
|---|---|---|
| committer | 2022-03-19 21:48:07 -0400 | |
| commit | a6e765da9b4da8cf9ddedcbaeb29fe5dca5df263 (patch) | |
| tree | 39a2e5d06c16d048e9618e1170e3b6304fbade2e /lib/roo/spreadsheet.rb | |
| parent | e67f4551479264125a641b955523d95e192b6d44 (diff) | |
| parent | f5fb17e5a64b215644bc104f099dad8c2f10c37d (diff) | |
Update upstream source from tag 'upstream/2.9.0'
Update to upstream version '2.9.0'
with Debian dir 41b8f9c552bbf25b076de11901d6f615d684366f
Diffstat (limited to 'lib/roo/spreadsheet.rb')
| -rw-r--r-- | lib/roo/spreadsheet.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/roo/spreadsheet.rb b/lib/roo/spreadsheet.rb index cdc93f0..54063b6 100644 --- a/lib/roo/spreadsheet.rb +++ b/lib/roo/spreadsheet.rb @@ -24,8 +24,14 @@ module Roo options[:file_warning] = :ignore extension.tr('.', '').downcase.to_sym else - res = ::File.extname((path =~ /\A#{::URI::DEFAULT_PARSER.make_regexp}\z/) ? ::URI.parse(::URI.encode(path)).path : path) - res.tr('.', '').downcase.to_sym + parsed_path = + if path =~ /\A#{::URI::DEFAULT_PARSER.make_regexp}\z/ + # path is 7th match + Regexp.last_match[7] + else + path + end + ::File.extname(parsed_path).tr('.', '').downcase.to_sym end end end |
