Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed some warnings

Both of these were "assigned but unused variable" warnings.
  • Loading branch information...
commit 8987d9f69af3adc3cf250f679aa48a5725897ad2 1 parent 06d0e5d
@henrikhodne henrikhodne authored
Showing with 7 additions and 7 deletions.
  1. +6 −6 lib/mime/types.rb
  2. +1 −1  test/test_mime_type.rb
View
12 lib/mime/types.rb
@@ -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
View
2  test/test_mime_type.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.