Commit 532adc43 by minad

removed hoe dependency, fix

parent a7466579
require 'hoe'
task :default => :test
$:.unshift 'lib'
require 'mimemagic'
Hoe.spec 'mimemagic' do
version = MimeMagic::VERSION
developer 'Daniel Mendler', 'mail@daniel-mendler.de'
summary = 'Mime detection by extension or content'
desc 'Run tests with bacon'
task :test => FileList['test/*_test.rb'] do |t|
sh "bacon -q -Ilib:test #{t.prerequisites.join(' ')}"
end
......@@ -73,9 +73,7 @@ class MimeMagic
# This is a slow operation.
def self.by_magic(io)
if !(io.respond_to?(:seek) && io.respond_to?(:read))
io = io.to_s
io.force_encoding('ascii-8bit') if io.respond_to?(:force_encoding)
io = StringIO.new(io, 'rb')
io = StringIO.new(io.to_s, 'rb:binary')
end
mime = MAGIC.find {|type, matches| magic_match(io, matches) }
mime ? new(mime[0]) : nil
......
......@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.files = %w{
lib/mimemagic.rb
lib/mimemagic_tables.rb
test/test_mimemagic.rb
test/mimemagic_test.rb
test/files/application.x-bzip
test/files/image.jpeg
test/files/image.png
......@@ -31,19 +31,6 @@ README
s.rubygems_version = %q{1.3.1}
s.summary = %q{Mime detection by extension or content}
s.homepage = 'https://github.com/minad/mimemagic'
s.test_files = ["test/test_mimemagic.rb"]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<hoe>, [">= 1.8.3"])
else
s.add_dependency(%q<hoe>, [">= 1.8.3"])
end
else
s.add_dependency(%q<hoe>, [">= 1.8.3"])
end
s.test_files = ["test/mimemagic_test.rb"]
end
gem 'bacon', '>= 0'
require 'bacon'
require 'mimemagic'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment