Sha256: 1dd3af87b5a324436ab07a98cb6aa5ab4582c1fd08be7464270bb743d456af57

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

SUPPORTED_RUBIES = %w[ree 1.9.2 jruby rbx]
PLATFORMS = %w[ree rbx]
GEMSPEC = Bundler::GemHelper.new(Dir.pwd).gemspec

def with_ruby(ruby, command)
  rvm     = "#{ruby}@#{GEMSPEC.name}"
  command = %{rvm #{rvm} exec bash -c '#{command}'}

  puts "\n" * 3
  puts "CMD: #{command}"
  puts "=" * 40

  system command
end

namespace :rubies do
  desc "Run tests for following supported platforms #{SUPPORTED_RUBIES.join ", "}"
  task :test do
    command = "bundle check || bundle install && rake"
    SUPPORTED_RUBIES.each { |ruby| with_ruby(ruby, command) }
  end

  desc "Build gems for following supported platforms #{PLATFORMS.join ", "}"
  task :build do
    command = "rm -f Gemfile.lock && rake build"
    PLATFORMS.each { |ruby| with_ruby(ruby, command) }
  end

  versions = Dir[File.join("pkg", "#{GEMSPEC.name}-#{GEMSPEC.version}-*.gem")].to_a

  desc "Pushes gems for following supported platforms #{versions.join ", "}"
  task :push => :build do
    versions.each do |gem|
      command = "gem push #{gem}"
      puts command
      system command
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libnotify-0.5.5-universal-rubinius-1.2 lib/libnotify/tasks/rubies.rake
libnotify-0.5.5 lib/libnotify/tasks/rubies.rake