Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 42 lines (34 sloc) 0.991 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
require 'rubygems'
require 'rake'

def version(file, constant)
 line = File.read(file)[/^\s*#{constant}\s*=\s*.*/]
 line.match(/.*#{constant}\s*=\s*['"](.*)['"]/)[1]
end

def build(gemspec_file, gem_file)
  mkdir_p 'pkg'
  sh "gem build #{gemspec_file}"
  mv gem_file, 'pkg'
end

def release(name, gem_file, version)
  unless `git branch` =~ /^\* master$/
    puts "You must be on the master branch to release!"
    exit!
  end
  sh "git commit --allow-empty -a -m 'Release #{name} #{version}'"
  sh "git tag #{name}-#{version}"
  sh "git push origin master --tags"
  sh "gem push pkg/#{gem_file}"
end

{
  :build => 'Build all Trinidad gems',
  :install => 'Install all Trinidad gems',
  :release => 'Release all Trinidad gems'
}.each do |task, desc|
  desc desc
  task task => ["trinidad_jars:#{task}", "trinidad:#{task}"]
end

require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec) do |spec|
  spec.rspec_opts = ['--color', "--format documentation"]
end

task :default => :spec
Something went wrong with that request. Please try again.