Socket
Book a DemoInstallSign in
Socket

rake-version

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rake-version

1.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

rake-version

Simple rake tasks for version management.

Gem Version Dependency Status Build Status Coverage Status

rake-version helps you manage your VERSION file according to the rules of semantic versioning. It does nothing more. It does not create tags; it does not commit; it does not push; it does not release.

Installation

Add to your Gemfile and bundle install:

gem "rake-version", "~> 1.0"

Add the tasks to your Rakefile:

require 'rake-version'
RakeVersion::Tasks.new

Usage

# show current version
rake version              #=> 1.0.0

# bump version
rake version:bump:patch   #=> 1.0.1
rake version:bump:minor   #=> 1.1.0
rake version:bump:major   #=> 2.0.0

# set version
rake "version:set[1.2.3]" #=> 1.2.3

Auto-update other files

When you add the rake version tasks in your Rakefile, you may specify additional files to update with the new version.

require 'rake-version'
RakeVersion::Tasks.new do |v|
  v.copy 'lib/my-gem.rb'          # update single file
  v.copy 'lib/a.rb', 'lib/b.rb'   # update multiple files
  v.copy 'lib/*.rb'               # update all files matching a glob pattern
  v.copy /lib/                    # update all files whose path matches a regexp
end

By default, rake-version will replace the first occurrence of a semantic version pattern (number.number.number(-prerelease)(+build)) with the new version. It will not modify the prerelease version or build metadata. For example, when bumping the minor version from 1.0.0, it will change the contents of this file:

class Thing
  VERSION = '1.0.0'
end

To this:

class Thing
  VERSION = '1.1.0'
end

You can customize this behavior as follows:

RakeVersion::Tasks.new do |v|
  v.copy 'lib/my-gem.rb', all: true   # replace all occurrences
end

Semantic versioning

rake-version partially supports semantic versioning v2.0.0. You can add prerelease (e.g. -beta) and build (e.g. +20131313) information to your versions, but there are currently no tasks to update them other than version:set.

Meta

  • Author: Simon Oulevay (Alpha Hydrae)
  • License: MIT (see LICENSE.txt)

FAQs

Package last updated on 05 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.