summaryrefslogtreecommitdiff
path: root/lib/mime/types
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mime/types')
-rw-r--r--lib/mime/types/cache.rb6
-rw-r--r--lib/mime/types/deprecations.rb22
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}.