Sha256: eebe6413b28f4f07420817b19e6b3952810a79126e1309269e9e1d7d66c9a8ba

Contents?: true

Size: 1.65 KB

Versions: 6

Compression:

Stored size: 1.65 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

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

begin
  require "yard"
  require "bluecloth" # for Markdown support
  require "yard/sinatra" # for Sinatra support
  YARD::Rake::YardocTask.new(:yard) do |t|
    t.options += ["--title", "Mango #{Mango::VERSION} Documentation"]
  end
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
    system "gem build mango.gemspec"
  end

  desc "Removes the gem file for the current project"
  task :clean do
    jeweler { |gem_file| rm gem_file }
  end

  desc "Pushes the current gem to RubyGems.org"
  task :push do
    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 "No gem file found - #{file}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mango-0.5.3 Rakefile
mango-0.5.2 Rakefile
mango-0.5.1 Rakefile
mango-0.5.0 Rakefile
mango-0.5.0.beta5 Rakefile
mango-0.5.0.beta4 Rakefile