diff options
author | Austin Ziegler <austin@zieglers.ca> | 2023-02-16 21:45:29 -0500 |
---|---|---|
committer | Austin Ziegler <austin@zieglers.ca> | 2023-02-17 00:36:52 -0500 |
commit | b9382fe8c1593c7d6589cd62d59903926cfca51b (patch) | |
tree | 62a7c891831bd155365fa5577d6a1060ccd94afa /lib/mime/types | |
parent | 0bf7805068a6b8e53abbe5ac7c09aedda63ee54f (diff) | |
download | mime-types-main.tar.gz |
- Update the .github/workflows/ci.yml workflow to test Ruby 3.2 and more
reliably test certain combinations rather than depending on
exclusions.
- Change `.standard.yml` configuration to format for Ruby 2.3 as certain
files are not properly detected with Ruby 2.0.
- Change from `hoe-git` to `hoe-git2` to support Hoe version 4.
- Apply `standardrb --fix`.
- Update other dependencies.
Diffstat (limited to 'lib/mime/types')
-rw-r--r-- | lib/mime/types/cache.rb | 6 | ||||
-rw-r--r-- | lib/mime/types/deprecations.rb | 22 |
2 files changed, 12 insertions, 16 deletions
diff --git a/lib/mime/types/cache.rb b/lib/mime/types/cache.rb index 71d488e..2e70775 100644 --- a/lib/mime/types/cache.rb +++ b/lib/mime/types/cache.rb @@ -49,10 +49,6 @@ class << MIME::Types::Cache types ||= MIME::Types.send(:__types__) - File.open(cache_file, "wb") do |f| - f.write( - Marshal.dump(new(MIME::Types::Data::VERSION, Marshal.dump(types))) - ) - end + File.binwrite(cache_file, Marshal.dump(new(MIME::Types::Data::VERSION, Marshal.dump(types)))) end end diff --git a/lib/mime/types/deprecations.rb b/lib/mime/types/deprecations.rb index 3c64977..cf9c297 100644 --- a/lib/mime/types/deprecations.rb +++ b/lib/mime/types/deprecations.rb @@ -10,20 +10,20 @@ module MIME def self.deprecated(klass, sym, message = nil, &block) # :nodoc: level = case klass - when Class, Module - "." - else - klass = klass.class - "#" + when Class, Module + "." + else + klass = klass.class + "#" end message = case message - when :private, :protected - "and will be #{message}" - when nil - "and will be removed" - else - message + when :private, :protected + "and will be #{message}" + when nil + "and will be removed" + else + message end MIME::Types.logger.warn <<-WARNING.chomp.strip #{caller(2..2).first}: #{klass}#{level}#{sym} is deprecated #{message}. |