Sha256: aea9c835ac4d3d77815ab36aed40caa995799e184effc7310eab57b7f9cc1ec7

Contents?: true

Size: 1.57 KB

Versions: 2

Compression:

Stored size: 1.57 KB

Contents

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

###################################################################################################

begin
  require "rspec/core/rake_task"
  require "rack/test" # for Rack support
  RSpec::Core::RakeTask.new(:spec)
  task :default => :spec
rescue LoadError => e
  Mango::Dependencies.create_warning_for(e)
end

###################################################################################################

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.1 Rakefile
mango-0.6.0 Rakefile