Permalink
Browse files

Merge pull request #7 from dvyjones/fix-warnings

Fixed some warnings. Will be in place for 1.18.
  • Loading branch information...
2 parents 06d0e5d + 8987d9f commit 9c9a87dafed9b59d80a7a155c966099eead7f5b2 @halostatue committed Nov 7, 2011
Showing with 7 additions and 7 deletions.
  1. +6 −6 lib/mime/types.rb
  2. +1 −1 test/test_mime_type.rb
View
@@ -44,7 +44,7 @@ class Type
LTSW_URL = "http://www.ltsw.se/knbase/internet/%s.htp"
CONTACT_URL = "http://www.iana.org/assignments/contact-people.htm#%s"
- # Returns +true+ if the simplified type matches the current
+ # Returns +true+ if the simplified type matches the current
def like?(other)
if other.respond_to?(:simplified)
@simplified == other.simplified
@@ -138,7 +138,7 @@ def eql?(other)
# x-chemical/x-pdb => pdb
attr_reader :sub_type
# Returns the media type of the unmodified MIME type.
- #
+ #
# text/plain => plain
# x-chemical/x-pdb => x-pdb
attr_reader :raw_sub_type
@@ -185,7 +185,7 @@ def encoding=(enc) #:nodoc:
# The regexp for the operating system that this MIME::Type is specific
# to.
attr_accessor :system
- remove_method :system= ;
+ remove_method :system= ;
def system=(os) #:nodoc:
if os.nil? or os.kind_of?(Regexp)
@system = os
@@ -359,7 +359,7 @@ def from_array(*args) #:yields MIME::Type.new:
# end
def from_hash(hash) #:yields MIME::Type.new:
type = {}
- hash.each_pair do |k, v|
+ hash.each_pair do |k, v|
type[k.to_s.tr('A-Z', 'a-z').gsub(/-/, '_').to_sym] = v
end
@@ -400,7 +400,7 @@ def from_mime_type(mime_type) #:yields the new MIME::Type:
t.registered = mime_type.registered?
mime_type.docs && t.docs = mime_type.docs.dup
-
+
end
yield m if block_given?
@@ -765,7 +765,7 @@ def load_from_file(filename) #:nodoc:
begin
m = TEXT_FORMAT_RE.match(item).captures
- rescue Exception => ex
+ rescue Exception
puts "#{filename}:#{index}: Parsing error in MIME type definitions."
puts "=> #{line}"
raise
@@ -6,7 +6,7 @@
class TestMIME_Type < MiniTest::Unit::TestCase
def yaml_mime_type_from_array
- yaml = MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit', 'linux')
+ MIME::Type.from_array('text/x-yaml', %w(yaml yml), '8bit', 'linux')
end
def setup

0 comments on commit 9c9a87d

Please sign in to comment.