Skip to content

Commit

Permalink
Fixed some warnings
Browse files Browse the repository at this point in the history
Both of these were "assigned but unused variable" warnings.
  • Loading branch information
sarahhodne committed Nov 6, 2011
1 parent 06d0e5d commit 8987d9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/mime/types.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/test_mime_type.rb
Expand Up @@ -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
Expand Down

0 comments on commit 8987d9f

Please sign in to comment.