Permalink
Browse files

Add some more useful rake tasks from mojombo

  • Loading branch information...
1 parent 9a88c17 commit 5643666b5e4b6b7ef50ac1df1662f1ccc2d086c0 @wingrunr21 committed Oct 22, 2011
Showing with 31 additions and 8 deletions.
  1. +2 −0 .gitignore
  2. +2 −0 Gemfile.lock
  3. +26 −8 Rakefile
  4. +1 −0 gitolite.gemspec
View
@@ -2,3 +2,5 @@ pkg/*
*.gem
.bundle
rdoc/*
+*.conf
+coverage
View
@@ -15,6 +15,7 @@ GEM
mime-types (~> 1.15)
hashery (1.4.0)
mime-types (1.16)
+ rcov (0.9.11)
rdoc (3.9.4)
rspec (2.6.0)
rspec-core (~> 2.6.0)
@@ -31,5 +32,6 @@ PLATFORMS
DEPENDENCIES
forgery (~> 0.5.0)
gitolite!
+ rcov (~> 0.9.11)
rdoc (~> 3.9.4)
rspec (~> 2.6.0)
View
@@ -2,15 +2,33 @@ require 'bundler'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
+# Rake tasks from https://github.com/mojombo/rakegem/blob/master/Rakefile
+
+# Helper Functions
+def name
+ @name ||= Dir['*.gemspec'].first.split('.').first
+end
+
+def version
+ line = File.read("lib/#{name}/version.rb")[/^\s*VERSION\s*=\s*.*/]
+ line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
+end
+
+# Standard tasks
+require 'rcov'
RSpec::Core::RakeTask.new(:spec)
task :test => :spec
task :default => :spec
-# FIXME warns "already initialized constant Task"
-# FIXME aborts with "uninitialized constant RDoc::VISIBILITIES"
-# require 'rdoc/task'
-#
-# RDoc::Task.new do |rdoc|
-# rdoc.main = "README.rdoc"
-# rdoc.rdoc_files.include("README.rdoc", "lib/**/*.rb")
-# end
+require 'rdoc/task'
+Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "#{name} #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+desc "Open an irb session preloaded with this library"
+task :console do
+ sh "irb -rubygems -r ./lib/#{name}.rb"
+end
View
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rspec", "~> 2.6.0"
s.add_development_dependency "forgery", "~> 0.5.0"
s.add_development_dependency "rdoc", "~> 3.9.4"
+ s.add_development_dependency "rcov", "~> 0.9.11"
s.add_dependency "grit", "~> 2.4.1"
s.add_dependency "hashery", "~> 1.4.0"

0 comments on commit 5643666

Please sign in to comment.