Permalink
Browse files

Use Bundler for packaging

  • Loading branch information...
1 parent 0e2ea0c commit 7390c3a4b5a21044bd992914fae9f6442958c061 @tpope committed Feb 13, 2011
Showing with 36 additions and 77 deletions.
  1. +2 −0 .gitignore
  2. +2 −0 Gemfile
  3. +8 −70 Rakefile
  4. +23 −0 girth.gemspec
  5. +1 −7 lib/girth/version.rb
View
@@ -1,3 +1,5 @@
/pkg
/doc
/coverage
+/.bundle
+/Gemfile.lock
View
@@ -0,0 +1,2 @@
+source "http://rubygems.org"
+gemspec
View
@@ -1,82 +1,20 @@
-begin
- require 'rubygems'
-rescue LoadError
-end
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/packagetask'
-require 'rake/gempackagetask'
-$:.unshift(File.dirname(__FILE__), 'lib')
-require 'girth'
-
-PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
-PKG_NAME = 'girth'
-PKG_VERSION = Girth::VERSION::STRING
-PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
-
-desc "Default task: test"
-task :default => [ :test ]
+require 'bundler'
+Bundler::GemHelper.install_tasks
+task :default => :test
-# Run the unit tests
-Rake::TestTask.new { |t|
+require 'rake/testtask'
+Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = Dir['test/*_test.rb']
t.verbose = true
-}
-
+end
-# Generate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.rdoc_files.add('lib')
rdoc.rdoc_files.add('README.rdoc')
rdoc.main = "README.rdoc"
rdoc.title = "Girth"
- rdoc.options << '--inline-source'
-}
-
-
-# Create compressed packages
-spec = Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = PKG_NAME
- s.summary = 'Syntactically rich Git library with a bias towards IRB'
- s.description = 'Syntactically rich Git library with a bias towards IRB. Includes a git-irb command.'
- s.version = PKG_VERSION
-
- s.author = 'Tim Pope'
- s.email = 'ruby@tp0pe.0rg'.gsub(/0/,'o')
- s.rubyforge_project = PKG_NAME
- s.homepage = "http://#{PKG_NAME}.rubyforge.org"
-
- s.has_rdoc = true
- # s.requirements << 'none'
- s.require_path = 'lib'
-
- s.bindir = "bin"
- s.executables = ["git-irb"]
- s.default_executable = "git-irb"
-
- s.files = [ "Rakefile", "README.rdoc" ]
- s.files = s.files + Dir.glob( "lib/**/*.rb" )
- s.files = s.files + Dir.glob( "test/**/*" ).reject { |item| item[-1] == ?~ || item.include?( "\.svn" ) }
-end
-
-Rake::GemPackageTask.new(spec) do |p|
- p.gem_spec = spec
- p.need_tar = true
- p.need_zip = true
-end
-
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |t|
- t.test_files = Dir['test/*_test.rb']
- t.verbose = true
- t.rcov_opts << "--text-report"
- # t.rcov_opts << "--exclude '/(mechanize|hpricot)\\b'"
- end
-rescue LoadError
end
View
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "girth/version"
+
+Gem::Specification.new do |s|
+ s.name = "girth"
+ s.version = Girth::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ['Tim Pope']
+ s.email = 'ruby@tp0pe.0rg'.gsub(/0/,'o')
+ s.homepage = "http://github.com/tpope/girth"
+ s.has_rdoc = true
+ s.summary = 'Syntactically rich Git library with a bias towards IRB'
+ s.description = 'Syntactically rich Git library with a bias towards IRB. Includes a git-irb command.'
+
+ s.rubyforge_project = "girth"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.default_executable = "git-irb"
+ s.require_paths = ["lib"]
+end
View
@@ -1,9 +1,3 @@
module Girth
- module VERSION #:nodoc:
- MAJOR = 0
- MINOR = 0
- TINY = 1
-
- STRING = [MAJOR, MINOR, TINY].join('.')
- end
+ VERSION = "0.0.1"
end

0 comments on commit 7390c3a

Please sign in to comment.