Permalink
Browse files

removed hoe dependency, fix

  • Loading branch information...
1 parent a746657 commit 532adc43eb8341373c3dea3cb9f9a9cc2f29215f @minad committed Aug 21, 2010
Showing with 7 additions and 28 deletions.
  1. +4 −8 Rakefile
  2. +1 −3 lib/mimemagic.rb
  3. +2 −15 mimemagic.gemspec
  4. +0 −2 test/{test_mimemagic.rb → mimemagic_test.rb}
View
@@ -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
View
@@ -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
View
@@ -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
@@ -1,5 +1,3 @@
-gem 'bacon', '>= 0'
-
require 'bacon'
require 'mimemagic'

0 comments on commit 532adc4

Please sign in to comment.