Sha256: e0429e8d7e620dd9f833d87292d64124db1427892462f4c8a2fecb3fb25adf4d

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

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

require './lib/contextify/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 Contextify::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", "contextify", "version.rb"), "w") do |f|
      f.write <<EOF
module Contextify
  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

2 entries across 2 versions & 1 rubygems

Version Path
zenbox-0.0.3 Rakefile
zenbox-0.0.2 Rakefile