Sha256: 4b832996b6f277d33c8633c90ada5a4ac60f5ee71f21b396bab966c119d0c852

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

# encoding: UTF-8
require File.expand_path("lib/mango", File.dirname(__FILE__))

namespace :gem do
  desc "Builds a gem from the current project's Gem::Specification"
  task :build do
    puts "==> Building RubyGem"

    if `git status` !~ /working directory clean/
      abort "  Cannot build RubyGem because the working directory is not clean."
    end

    system "gem build mango.gemspec"
  end

  desc "Removes the gem file for the current project"
  task :clean do
    puts "==> Cleaning up RubyGem build"
    jeweler do |gem_file|
      rm gem_file, :verbose => false
      puts "  Removed #{gem_file}"
    end
  end

  desc "Pushes the current gem to RubyGems.org"
  task :push do
    puts "==> Pushing RubyGem"
    jeweler { |gem_file| system "gem push #{gem_file}"}
  end

  desc "Builds, pushes, and cleans a gem for the current project"
  task :release do
    Rake::Task["gem:build"].invoke
    Rake::Task["gem:push"].invoke
    Rake::Task["gem:clean"].invoke
  end

  def jeweler(&block)
    file = "mango-#{Mango::VERSION}.gem"
    if File.exists?(file)
      yield file
    else
      puts "  RubyGem #{file.inspect} does not exist"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mango-0.6.3 Rakefile
mango-0.6.2 Rakefile