Sha256: 85a06b437c9ba50ed2962722d3d83f23e8c3967829222ba332acca8d1ea13e6c

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

require 'rake'
require 'rake/testtask'
require 'rubygems/package_task'
require 'bundler'
Bundler::GemHelper.install_tasks

require './lib/zenbox/version'

namespace :changeling do
  desc "Bumps the version by a minor or patch version, depending on what was passed in."
  task :bump, :part do |t, args|
    # Thanks, Jeweler!
    if Zenbox::VERSION  =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
      major = $1.to_i
      minor = $2.to_i
      patch = $3.to_i
      build = $4
    else
      abort
    end

    case args[:part]
    when /minor/
      minor += 1
      patch = 0
    when /patch/
      patch += 1
    else
      abort
    end

    version = [major, minor, patch, build].compact.join('.')

    File.open(File.join("lib", "zenbox", "version.rb"), "w") do |f|
      f.write <<EOF
module Zenbox
  VERSION = "#{version}".freeze
end
EOF
    end
  end

  desc "Bump by a minor version (1.2.3 => 1.3.0)"
  task :minor do |t|
    Rake::Task['changeling:bump'].invoke(t.name)
  end

  desc "Bump by a patch version, (1.2.3 => 1.2.4)"
  task :patch do |t|
    Rake::Task['changeling:bump'].invoke(t.name)
  end
end

begin
  require 'yard'
  YARD::Rake::YardocTask.new do |t|
    t.files   = ['lib/**/*.rb', 'TESTING.rdoc']
  end
rescue LoadError
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zenbox-0.0.8 Rakefile
zenbox-0.0.7 Rakefile
zenbox-0.0.6 Rakefile
zenbox-0.0.5 Rakefile
zenbox-0.0.4 Rakefile