Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b96f4e3f80
Fetching contributors…

Cannot retrieve contributors at this time

file 38 lines (32 sloc) 1.01 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
require 'rake'
load File.expand_path("../tasks/remove_task.rake", __FILE__)

# This rakefile depends on the main one and uses RVM to implement
# tasks that require multiple platforms at once.

def package_variants
  %w(1.8.7 jruby)
end

begin
  require 'bundler'

  module Ladle
    class MultiplatformGemHelper < Bundler::GemHelper
      def build_gem
        FileUtils.rm_rf 'pkg'
        package_variants.each do |var|
          sh("rvm #{var}@ladle rake build")
        end
        results = Dir["pkg/*.gem"]
        Bundler.ui.confirm "#{name} #{version} built to #{results.inspect}"
      end

      def rubygems_push(paths)
        paths.each do |path|
          Bundler.ui.confirm sh("gem push #{path}")
          Bundler.ui.confirm "Pushed #{File.basename path} to rubygems.org"
        end
      end
    end
  end

  Ladle::MultiplatformGemHelper.new(File.dirname(__FILE__)).install
  remove_task(:install)
rescue LoadError
  $stderr.puts "Bundler's not installed; some tasks won't be available"
end
Something went wrong with that request. Please try again.