Sha256: cdaeda19141161f44feef21d8324b71324b1340446f09305a4da1fd0544e52d8

Contents?: true

Size: 1.43 KB

Versions: 52

Compression:

Stored size: 1.43 KB

Contents

# GEM TASK
require 'find'
require 'rubygems'
require 'rubygems/package'

# Unfortunately Rake::GemPackageTest cannot deal with files that are generated
# by Rake targets. So we have to write our own packaging task.
desc 'Build the gem package'
task :gem => [:clobber] do
  Rake::Task[:changelog].invoke
  Rake::Task[:permissions].invoke

  # Build the gem file according to the loaded spec.
  if RUBY_VERSION >= "2.0.0"
    Gem::Package.build(GEM_SPEC)
  else
    Gem::Builder.new(GEM_SPEC).build
  end
  pkgBase = "#{GEM_SPEC.name}-#{GEM_SPEC.version}"
  # Create a pkg directory if it doesn't exist already.
  FileUtils.mkdir_p('pkg')
  # Move the gem file into the pkg directory.
  verbose(true) { FileUtils.mv("#{pkgBase}.gem", "pkg/#{pkgBase}.gem")}
end

desc 'Make sure all files and directories are readable'
task :permissions do
  # Find the bin and test directories relative to this file.
  baseDir = File.expand_path('..', File.dirname(__FILE__))

  execs = Dir.glob("#{baseDir}/bin/*")

  Find.find(baseDir) do |f|
    # Ignore the whoke pkg directory as it may contain links to the other
    # directories.
    next if Regexp.new("#{baseDir}/pkg/*").match(f)

    FileUtils.chmod_R((FileTest.directory?(f) ||
                       execs.include?(f) ? 0755 : 0644), f)
  end
end

desc 'Run all tests and build scripts and create the gem package'
task :release do
  Rake::Task[:test].invoke
  Rake::Task[:yard].invoke
  Rake::Task[:gem].invoke
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
fit4ruby-3.13.0 tasks/gem.rake
fit4ruby-3.12.0 tasks/gem.rake
postrunner-1.2.0 tasks/gem.rake
fit4ruby-3.11.0 tasks/gem.rake
postrunner-1.1.1 tasks/gem.rake
postrunner-1.1.0 tasks/gem.rake
fit4ruby-3.10.0 tasks/gem.rake
postrunner-1.0.5 tasks/gem.rake
fit4ruby-3.9.0 tasks/gem.rake
postrunner-1.0.4 tasks/gem.rake
fit4ruby-3.8.0 tasks/gem.rake
fit4ruby-3.7.0 tasks/gem.rake
postrunner-1.0.2 tasks/gem.rake
postrunner-1.0.1 tasks/gem.rake
postrunner-1.0.0 tasks/gem.rake
fit4ruby-3.6.0 tasks/gem.rake
fit4ruby-3.5.0 tasks/gem.rake
fit4ruby-3.4.0 tasks/gem.rake
postrunner-0.12.0 tasks/gem.rake
fit4ruby-3.3.0 tasks/gem.rake