Permalink
Browse files

basic rake tasks

  • Loading branch information...
1 parent 690c7b2 commit 251524ccfd3597455a50e84f50ec376184f9a336 @mkristian committed Jul 28, 2010
Showing with 20 additions and 13 deletions.
  1. +18 −13 Rakefile
  2. +2 −0 spec/spec_helper.rb
View
31 Rakefile
@@ -1,28 +1,33 @@
# -*- ruby -*-
require 'rubygems'
-require 'hoe'
require './lib/slf4r/version.rb'
require 'spec'
require 'spec/rake/spectask'
require 'pathname'
-Hoe.new('slf4r', Slf4r::VERSION) do |p|
- p.rubyforge_name = 'slf4r' # if different than lowercase project name
- p.summary = 'Slf4r provides a uniform interface for instantiating und using of a logger'
- p.url = 'http://slf4r.rubyforge.com/'
- p.developer('mkristian', 'm.kristian@web.de')
- p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
- p.remote_rdoc_dir = '' # Release to root
+build_dir = 'target'
+
+desc 'clean up'
+task :clean do
+ FileUtils.rm_rf(build_dir)
+ FileUtils.rm_rf('tmp')
+end
+
+desc 'package as a gem.'
+task :package do
+ require 'fileutils'
+ gemspec = Dir['*.gemspec'].first
+ sh "gem build #{gemspec}"
+ FileUtils.mkdir_p(build_dir)
+ gem = Dir['*.gem'].first
+ FileUtils.mv(gem, File.join(build_dir,"#{gem}"))
end
desc 'Install the package as a gem.'
-task :install => [:clean, :package] do
- Dir.new('tmp').each do |f|
- File.delete('tmp/' + f) if File.file?('tmp/' + f)
- end
- gem = Dir['pkg/*.gem'].first
+task :install => [:package] do
+ gem = Dir[File.join(build_dir, '*.gem')].first
sh "gem install --local #{gem} --no-ri --no-rdoc"
end
View
2 spec/spec_helper.rb
@@ -12,6 +12,8 @@ def initialize(file)
end
+require 'rubygems'
+
$LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'
require 'slf4r'

0 comments on commit 251524c

Please sign in to comment.