Sha256: 792eda133ba4aa395bf9043e34b1ac1fd5542b588a093e282fce8b86bb932a54

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

# -*- ruby -*-

require "rubygems"
require 'rake/clean'
require 'find'

@package='simp-rake-helpers'
@rakefile_dir=File.dirname(__FILE__)

CLEAN.include "#{@package}-*.gem"
CLEAN.include 'pkg'
CLEAN.include 'dist'
Find.find( @rakefile_dir ) do |path|
  if File.directory? path
    CLEAN.include path if File.basename(path) == 'tmp'
  else
    Find.prune
  end
end

desc 'Ensure gemspec-safe permissions on all files'
task :chmod do
  gemspec = File.expand_path( "#{@package}.gemspec", @rakefile_dir ).strip
  spec = Gem::Specification::load( gemspec )
  spec.files.each do |file|
    FileUtils.chmod 'go=r', file
  end
end

desc 'run all RSpec tests'
task :spec do
  Dir.chdir @rakefile_dir
  sh 'bundle exec rspec spec'
end

namespace :pkg do
  desc "build rubygem package for #{@package}"
  task :gem => :chmod do
    Dir.chdir @rakefile_dir
    Dir['*.gemspec'].each do |spec_file|
      cmd = %Q{SIMP_RPM_BUILD=1 bundle exec gem build "#{spec_file}"}
      sh cmd
      FileUtils.mkdir_p 'dist'
      FileUtils.mv Dir.glob("#{@package}*.gem"), 'dist/'
    end
  end

  desc "build and install rubygem package for #{@package}"
  task :install_gem => [:clean, :gem] do
    Dir.chdir @rakefile_dir
    Dir.glob("dist/#{@package}*.gem") do |pkg|
      sh %Q{bundle exec gem install #{pkg}}
    end
  end
end
# vim: syntax=ruby

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simp-rake-helpers-1.0.12 Rakefile
simp-rake-helpers-1.0.11 Rakefile
simp-rake-helpers-1.0.10 Rakefile
simp-rake-helpers-1.0.9 Rakefile
simp-rake-helpers-1.0.8 Rakefile
simp-rake-helpers-1.0.7 Rakefile
simp-rake-helpers-1.0.6 Rakefile