Bump Chunker to 1.0.0 (release), updates for rspec 2.
This commit is contained in:
parent
935090c21b
commit
6667792230
5 changed files with 94 additions and 93 deletions
|
|
@ -1,17 +1,14 @@
|
|||
#!/usr/bin/env rake
|
||||
#
|
||||
# Chunker Rakefile
|
||||
#
|
||||
|
||||
require 'rubygems'
|
||||
require 'pathname'
|
||||
|
||||
require 'rake'
|
||||
require 'spec'
|
||||
require 'rake/testtask'
|
||||
require 'rspec'
|
||||
require 'rspec/core/rake_task'
|
||||
require 'rake/packagetask'
|
||||
require 'rake/gempackagetask'
|
||||
require 'spec/rake/spectask'
|
||||
require 'rubygems/installer'
|
||||
require 'rubygems/uninstaller'
|
||||
|
||||
|
|
@ -25,10 +22,10 @@ BASEDIR = Pathname.new( __FILE__ ).expand_path.dirname.relative_path_from( Pathn
|
|||
TEXT_FILES = %w{ Rakefile README LICENSE }.collect {|f| BASEDIR + f }
|
||||
|
||||
SPECDIR = BASEDIR + 'spec'
|
||||
SPEC_FILES = Pathname.glob( SPECDIR + '**/*_spec.rb' ).reject {|f| f =~ /^\.svn/ }
|
||||
SPEC_FILES = Pathname.glob( SPECDIR + '**/*_spec.rb' )
|
||||
|
||||
LIBDIR = BASEDIR + 'lib'
|
||||
LIB_FILES = Pathname.glob( LIBDIR + '**/*.rb').reject {|i| i =~ /\.svn/ }
|
||||
LIB_FILES = Pathname.glob( LIBDIR + '**/*.rb')
|
||||
|
||||
RELEASE_FILES = TEXT_FILES + LIB_FILES + SPEC_FILES
|
||||
|
||||
|
|
@ -56,27 +53,32 @@ end
|
|||
######################################################################
|
||||
|
||||
PKG_NAME = 'chunker'
|
||||
PKG_VERSION = find_pattern( LIBDIR + 'chunker.rb', /VERSION = ['"](\d\.\d(?:\/\d)?)['"]/ )
|
||||
PKG_REVISION = find_pattern( LIBDIR + 'chunker.rb', /SVNRev = .+Rev: (\d+)/ )
|
||||
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}.#{PKG_REVISION}"
|
||||
PKG_VERSION = find_pattern( LIBDIR + 'chunker.rb', /VERSION = ['"](.+)['"]/ )
|
||||
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
||||
|
||||
|
||||
######################################################################
|
||||
### T A S K S
|
||||
######################################################################
|
||||
|
||||
task :default => [ :test, :package ]
|
||||
task :test => 'test:spec'
|
||||
task :default => :test
|
||||
# task :default => [ :test, :package ]
|
||||
|
||||
namespace :test do
|
||||
desc 'Generate verbose and pretty output'
|
||||
RSpec::Core::RakeTask.new( :spec ) do |task|
|
||||
task.pattern = SPEC_FILES
|
||||
task.rspec_opts = ['-b', '-fd', '-c']
|
||||
end
|
||||
|
||||
### Task: run rspec tests
|
||||
###
|
||||
desc "Run tests"
|
||||
Spec::Rake::SpecTask.new('test') do |task|
|
||||
task.spec_files = SPEC_FILES
|
||||
task.spec_opts = %w{ -c -fs }
|
||||
desc 'Generate quiet non-colored plain-text output'
|
||||
RSpec::Core::RakeTask.new( :quiet ) do |task|
|
||||
task.pattern = SPEC_FILES
|
||||
task.rspec_opts = ['-f', 'p']
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
### Task: generate ctags
|
||||
### This assumes exuberant ctags, since ctags 'native' doesn't support ruby anyway.
|
||||
###
|
||||
|
|
@ -89,15 +91,12 @@ end
|
|||
### Task: Create gem from source
|
||||
###
|
||||
gem = Gem::Specification.new do |gem|
|
||||
pkg_build = PKG_REVISION || 0
|
||||
|
||||
gem.summary = "A convenience library for parsing __END__ tokens consistently."
|
||||
gem.name = PKG_NAME
|
||||
gem.version = "%s.%s" % [ PKG_VERSION, pkg_build ]
|
||||
gem.version = PKG_VERSION
|
||||
gem.author = 'Mahlon E. Smith'
|
||||
gem.email = 'mahlon@martini.nu'
|
||||
gem.homepage = 'http://projects.martini.nu/ruby-modules/wiki/Chunker'
|
||||
gem.rubyforge_project = 'mahlon'
|
||||
gem.has_rdoc = true
|
||||
|
||||
gem.files = RELEASE_FILES.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue