Skip to content

Commit

Permalink
removed hoe dependency, fix
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Aug 21, 2010
1 parent a746657 commit 532adc4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
12 changes: 4 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
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
4 changes: 1 addition & 3 deletions lib/mimemagic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ def self.by_extension(ext)
# 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
Expand Down
17 changes: 2 additions & 15 deletions mimemagic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

2 changes: 0 additions & 2 deletions test/test_mimemagic.rb → test/mimemagic_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
gem 'bacon', '>= 0'

require 'bacon'
require 'mimemagic'

Expand Down

0 comments on commit 532adc4

Please sign in to comment.