Rakefile in spraypaint-1.0.2 vs Rakefile in spraypaint-1.0.3
- old
+ new
@@ -1,10 +1,12 @@
$: << File.expand_path(File.join(File.dirname(__FILE__), "lib"))
require 'spraypaint/version'
require 'spec/rake/spectask' rescue nil
+SPRAYPAINT_ROOT = File.dirname(__FILE__)
+
namespace :spraypaint do
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "spraypaint"
@@ -23,21 +25,21 @@
if Object.const_defined?(:Spec)
desc "Run specs for spraypaint"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts = ["-f n -c"]
- t.spec_files = FileList["#{File.dirname(__FILE__)}/test/spec/**/*_spec.rb"]
+ t.spec_files = FileList["#{SPRAYPAINT_ROOT}/test/spec/**/*_spec.rb"]
end
else
task :spec do
puts "To run specs for spraypaint you must install rspec"
end
end
task 'about.yml' do
gemspec = Rake.application.jeweler_tasks.jeweler.gemspec
- File.open(File.join(File.dirname(__FILE__), "about.yml"), 'w+') do |f|
+ File.open(File.join(SPRAYPAINT_ROOT, "about.yml"), 'w+') do |f|
YAML.dump({
:name => gemspec.name,
:summary => gemspec.summary,
:email => 'tom@popdog.net',
:homepage => gemspec.homepage,
@@ -47,8 +49,15 @@
:rails_version => '2.3+',
:version => gemspec.version.to_s
}, f)
end
end
+
+ task 'tag' do
+ gemspec = Rake.application.jeweler_tasks.jeweler.gemspec
+ `cd #{SPRAYPAINT_ROOT}; git tag -a "v#{gemspec.version.to_s}" -m "Releasing spraypaint version #{gemspec.version.to_s}"`
+ end
+
+ task 'release' => ['spraypaint:spec', 'spraypaint:about.yml', 'spraypaint:tag', 'spraypaint:gemcutter:release']
end
task 'default' => ['spraypaint:spec', 'spraypaint:features']