Skip to content

Commit

Permalink
backport from github, attempt to load mime-types locally before loadi…
Browse files Browse the repository at this point in the history
…ng rubygems
  • Loading branch information
technoweenie committed Oct 8, 2010
1 parent f569b05 commit 120baf9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/grit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@
end

# third party
require 'rubygems'

begin
gem "mime-types", ">=0"
require 'mime/types'
rescue Gem::LoadError => e
puts "WARNING: Gem LoadError: #{e.message}"
require 'rubygems'
rescue LoadError
require 'rubygems'
begin
gem "mime-types", ">=0"
require 'mime/types'
rescue Gem::LoadError => e
puts "WARNING: Gem LoadError: #{e.message}"
end
end

# ruby 1.9 compatibility
Expand Down

0 comments on commit 120baf9

Please sign in to comment.