Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 42 lines (32 sloc) 0.811 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 39 40 41
#!/usr/bin/env ruby

require 'rubygems'
require 'fileutils'

begin
  require 'cucumber/rake/task'
   
  Cucumber::Rake::Task.new do |t|
    t.cucumber_opts = "--require features/"
  end
rescue LoadError
end


desc "build gem"
task :build do
  system("gem build cucumber-nagios.gemspec")

  FileUtils.mkdir_p('pkg')
  puts
  Dir.glob("cucumber-nagios-*.gem").each do |gem|
    dest = File.join('pkg', gem)
    FileUtils.mv(gem, dest)
    puts "New gem in #{dest}"
  end
end

desc "push gem"
task :push do
  filenames = Dir.glob("pkg/*.gem")
  filenames_with_times = filenames.map do |filename|
    [filename, File.mtime(filename)]
  end
  
  oldest = filenames_with_times.sort_by { |tuple| tuple.last }.last
  oldest_filename = oldest.first

  command = "gem push #{oldest_filename}"
  system(command)
end
Something went wrong with that request. Please try again.