-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uses a stub for the two mime-types methods used by rest-client and mail (the only dependencies of mime-types) and forwards them on to mini-mime. Should reduce the memory footprint from that gem... hopefully...
- Loading branch information
1 parent
ed707ba
commit 8cfab3b
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'mini_mime' | ||
|
||
module MIME | ||
class Types | ||
class << self | ||
def [](type) | ||
Array.wrap MiniMime.lookup_by_content_type(type) | ||
end | ||
|
||
def type_for(filename) | ||
Array.wrap MiniMime.lookup_by_filename(filename) | ||
end | ||
alias_method :of, :type_for | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'mime-types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- encoding: utf-8 -*- | ||
# stub: mime-types 3.1 ruby lib | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "mime-types" | ||
s.version = "2.6.1" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.require_paths = ["lib"] | ||
s.authors = ["Nick LaMuro"] | ||
s.date = "2017-03-27" | ||
s.description = "Stub mime-types repo that redirects to mini-mime" | ||
s.files = ["lib/mime-types.rb", "lib/mime/types.rb"] | ||
s.required_ruby_version = Gem::Requirement.new(">= 2.0") | ||
s.rubygems_version = "2.6.4" | ||
s.summary = "Stub mime-types repo that redirects to mini-mime" | ||
|
||
s.add_dependency 'mini_mime', '>= 0.1.1' | ||
end |