Sha256: cb922d8c41a6abb828467057597067b73bfe71c9a80de5eff583809f486d655a

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

$:.push File.join(File.dirname(__FILE__), 'lib')
require 'acquia/cloud/version'

def current_gems
  Dir["pkg/acquia-cloud-#{Acquia::Cloud::VERSION}.gem"]
end

namespace :gem do
  desc 'Build gem'
  task :build => [:clean] do
    mkdir 'pkg' unless File.exist? 'pkg'
    sh *%w{gem build acquia-cloud.gemspec}
    Dir['*.gem'].each do |gem|
      mv gem, "pkg/#{gem}"
    end
  end

  desc 'Install gem'
  task :install => ['gem:build'] do
    sh *%W{gem install pkg/acquia-cloud-#{Acquia::Cloud::VERSION}.gem}
  end

  desc 'Deploy gems to rubygems'
  task :deploy => ['gem:build'] do
    current_gems.each do |gem|
      sh *%W{gem push #{gem}}
    end
    if File.exist? '.git'
      sh *%W{git tag #{Acquia::Cloud::VERSION}}
      sh *%W{git push origin tag #{Acquia::Cloud::VERSION}}
    end
  end
end

task :clean

desc 'Run CI tasks.'
task :ci => [:rspec]

desc 'Run all RSpec tests.'
task :rspec do
  sh 'bundle', 'exec', 'rspec'
end

desc 'Run mutation tests'
task :mutant, [:target] do |t,args|
  sh 'bundle', 'exec', 'mutant',
     '--include', 'lib',
     '--require', 'acquia/cloud',
     '--use', 'rspec',
     # Interfaces and documentation classes
     # '--ignore-subject', 'Usmu::Deployment::RemoteFileInterface*',
     args[:target] || 'Acquia::Cloud*'
end

desc 'Run a console with our gems available'
task :console do
  sh 'bundle', 'exec', 'irb', '-r', 'acquia/cloud'
end

namespace :git do
  desc 'Cleanup (delete) all local branches that have already been merged into master (locally)'
  task :cleanup do
    `git branch --merged master`.lines.map(&:chomp).select {|i| i != '  master' && i[0,2] != '* ' }.each {|b| sh "git branch -d #{b.strip}" }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acquia-cloud-0.1.1 Rakefile