Permalink
Browse files

removed jeweler

  • Loading branch information...
1 parent 703e230 commit 71d4109614d3173eef02a669b5b04a383b3bf8d8 Jakub Kuźma committed Apr 20, 2010
Showing with 58 additions and 155 deletions.
  1. +0 −5 .document
  2. +0 −11 README.rdoc
  3. +32 −70 Rakefile
  4. +0 −1 VERSION
  5. +2 −0 lib/magic.rb
  6. +20 −64 magic.gemspec
  7. +3 −3 test/helper.rb
  8. +1 −1 test/test_magic.rb
View
@@ -1,5 +0,0 @@
-README.rdoc
-lib/**/*.rb
-bin/*
-features/**/*.feature
-LICENSE
View
@@ -16,17 +16,6 @@ See {project page}[http://jah.pl/projects/magic.html] for details.
* {issue tracker}[http://github.com/qoobaa/magic/issues]
* rdoc[http://qoobaa.github.com/magic]
-== Note on Patches/Pull Requests
-
-* Fork the project.
-* Make your feature addition or bug fix.
-* Add tests for it. This is important so I don't break it in a future
- version unintentionally.
-* Commit, do not mess with rakefile, version, or history. (if you want
- to have your own version, that is fine but bump version in a commit
- by itself I can ignore when I pull)
-* Send me a pull request. Bonus points for topic branches.
-
== Copyright
Copyright (c) 2010 Jakub Kuźma. See
View
102 Rakefile
@@ -1,83 +1,45 @@
# encoding: utf-8
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "magic"
- gem.summary = %Q{Determine file type and encoding using "magic" numbers}
- gem.description = %Q{Ruby FFI bindings to libmagic}
- gem.email = "qoobaa@gmail.com"
- gem.homepage = "http://github.com/qoobaa/magic"
- gem.authors = ["Jakub Kuźma"]
- gem.add_dependency "ffi", ">= 0.6.0"
- gem.add_development_dependency "test-unit", ">= 2.0"
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- gem.post_install_message = <<-EOM
-+-NOTE FOR LINUX USERS----------------------------------------------+
-| |
-| Install libmagic using your package manager, e.g. |
-| |
-| sudo apt-get install file |
-| |
-+-NOTE FOR WINDOWS USERS -------------------------------------------+
-| |
-| Install File for Windows from |
-| |
-| http://gnuwin32.sourceforge.net/packages/file.htm |
-| |
-| You'll also need to set your PATH environment variable to the |
-| directory of the magic1.dll file |
-| |
-| set PATH=C:\\Program Files\\GnuWin32\\bin;%PATH% |
-| |
-+-NOTE FOR MAC OS USERS --------------------------------------------+
-| |
-| If you don't have libmagic.1.dylib file in your system, you need |
-| to install it using port command |
-| |
-| sudo port install file |
-| |
-+-------------------------------------------------------------------+
-EOM
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+$:.unshift File.expand_path("../lib", __FILE__)
+
+require "rubygems"
+require "rubygems/specification"
+require "rake/testtask"
+require "rake/rdoctask"
+require "rake/gempackagetask"
+require "magic"
+
+def gemspec
+ file = File.expand_path('../magic.gemspec', __FILE__)
+ eval(File.read(file), binding, file)
end
-require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
+ test.libs << "lib" << "test"
+ test.pattern = "test/**/test_*.rb"
test.verbose = true
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
+Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = "rdoc"
+ rdoc.title = "magic #{Magic::VERSION}"
+ rdoc.rdoc_files.include("README.rdoc")
+ rdoc.rdoc_files.include("lib/**/*.rb")
end
-task :test => :check_dependencies
-
-task :default => :test
+Rake::GemPackageTask.new(gemspec) do |pkg|
+ pkg.gem_spec = gemspec
+end
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
+desc "Install the gem locally"
+task :install => :package do
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
+end
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "magic #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
+desc "Validate the gemspec"
+task :gemspec do
+ gemspec.validate
end
+
+task :gem => :gemspec
+task :default => :test
View
@@ -1 +0,0 @@
-0.2.4
View
@@ -8,6 +8,8 @@
require "magic/database"
module Magic
+ VERSION = "0.2.5"
+
class << self
# Guesses mime of given file
#
View
@@ -1,43 +1,24 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{magic}
- s.version = "0.2.4"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.name = "magic"
+ s.version = Magic::VERSION
+ s.platform = Gem::Platform::RUBY
s.authors = ["Jakub Kuźma"]
- s.date = %q{2010-02-10}
- s.description = %q{Ruby FFI bindings to libmagic}
- s.email = %q{qoobaa@gmail.com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- ".gitignore",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "lib/magic.rb",
- "lib/magic/api.rb",
- "lib/magic/constants.rb",
- "lib/magic/database.rb",
- "lib/magic/errors.rb",
- "magic.gemspec",
- "test/fixtures/filelogo.jpg",
- "test/fixtures/magic.txt",
- "test/fixtures/magic_empty",
- "test/fixtures/magic_jpeg",
- "test/helper.rb",
- "test/test_magic.rb"
- ]
- s.homepage = %q{http://github.com/qoobaa/magic}
- s.post_install_message = %q{+-NOTE FOR LINUX USERS----------------------------------------------+
+ s.email = "qoobaa@gmail.com"
+ s.homepage = "http://jah.pl/projects/magic.html"
+ s.summary = 'Determine file type and encoding using "magic" numbers'
+ s.description = "Ruby FFI bindings to libmagic"
+
+ s.required_rubygems_version = ">= 1.3.6"
+
+ s.add_runtime_dependency "ffi", [">= 0.6.3"]
+ s.add_development_dependency "test-unit", [">= 2.0"]
+
+ s.files = Dir.glob("lib/**/*") + %w(LICENSE README.rdoc)
+
+ s.post_install_message = <<-EOM
++-NOTE FOR LINUX USERS----------------------------------------------+
| |
| Install libmagic using your package manager, e.g. |
| |
@@ -52,7 +33,7 @@ Gem::Specification.new do |s|
| You'll also need to set your PATH environment variable to the |
| directory of the magic1.dll file |
| |
-| set PATH=C:\Program Files\GnuWin32\bin;%PATH% |
+| set PATH=C:\\Program Files\\GnuWin32\\bin;%PATH% |
| |
+-NOTE FOR MAC OS USERS --------------------------------------------+
| |
@@ -62,30 +43,5 @@ Gem::Specification.new do |s|
| sudo port install file |
| |
+-------------------------------------------------------------------+
-}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Determine file type and encoding using "magic" numbers}
- s.test_files = [
- "test/test_magic.rb",
- "test/helper.rb"
- ]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<ffi>, [">= 0.6.0"])
- s.add_development_dependency(%q<test-unit>, [">= 2.0"])
- else
- s.add_dependency(%q<ffi>, [">= 0.6.0"])
- s.add_dependency(%q<test-unit>, [">= 2.0"])
- end
- else
- s.add_dependency(%q<ffi>, [">= 0.6.0"])
- s.add_dependency(%q<test-unit>, [">= 2.0"])
- end
+ EOM
end
-
View
@@ -1,10 +1,10 @@
-require 'rubygems'
+require "rubygems"
gem "test-unit"
require "test/unit"
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'magic'
+require "magic"
class Test::Unit::TestCase
def fixture(filename)
View
@@ -1,4 +1,4 @@
-require 'helper'
+require "helper"
class TestMagic < Test::Unit::TestCase
test "guess magic.txt mime" do

0 comments on commit 71d4109

Please sign in to comment.