From 68110310a7f80fc66150f792a3b839f9bb9856e4 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Wed, 1 Jun 2011 23:19:11 -0500 Subject: [PATCH] Kill unused Pathname #media_type and #sub_type --- lib/linguist/pathname.rb | 24 ------------------------ test/test_pathname.rb | 6 ------ 2 files changed, 30 deletions(-) diff --git a/lib/linguist/pathname.rb b/lib/linguist/pathname.rb index 56b3a248..9238de58 100644 --- a/lib/linguist/pathname.rb +++ b/lib/linguist/pathname.rb @@ -85,30 +85,6 @@ module Linguist @mime_type ||= Mime.mime_for(extname) end - # Public: Get the mime media type - # - # Examples - # - # Pathname.new('index.html').media_type - # # => 'text' - # - # Returns a media type String. - def media_type - mime_type.split('/')[0] - end - - # Public: Get the mime sub type - # - # Examples - # - # Pathname.new('index.html').sub_type - # # => 'html' - # - # Returns a media type String. - def sub_type - mime_type.split('/')[1] - end - # Public: Get the Content-Type header # # This value is used when serving raw blobs. diff --git a/test/test_pathname.rb b/test/test_pathname.rb index 9486e164..62ab81ff 100644 --- a/test/test_pathname.rb +++ b/test/test_pathname.rb @@ -63,10 +63,4 @@ class TestPathname < Test::Unit::TestCase assert_equal 'text/plain; charset=utf-8', Pathname.new("file.rb").content_type assert_equal 'image/png', Pathname.new("octocat.png").content_type end - - def test_media_type - assert_equal 'text', Pathname.new("file.js").media_type - assert_equal 'text', Pathname.new("file.txt").media_type - assert_equal 'text', Pathname.new("defun.kt").media_type - end end