Sha256: 40c08f5f2834671d7dcb556235df9fdc08c2bf29b82f2fe7ecaf2e6a4413185c

Contents?: true

Size: 903 Bytes

Versions: 7

Compression:

Stored size: 903 Bytes

Contents

$:.push File.expand_path('../lib', __FILE__)
require 'thor'
require 'thor-scmversion'

class ThorSCMVersion < Thor
  namespace 'scmver'

  desc "build", "Build the gem"
  def build
    system("gem build -V 'thor-scmversion.gemspec'")
    FileUtils.mkdir_p(File.join(File.dirname(__FILE__), 'pkg'))
    FileUtils.mv("thor-scmversion-#{current_version}.gem", 'pkg')
  end

  desc "install", "Build and install latest to system gems"
  def install
    invoke "build", []
    system("gem install pkg/thor-scmversion-#{current_version}.gem")
  end

  desc "release TYPE", "Bump version, make a build, and push to Rubygems"
  def release(type)
    @current_version = nil
    invoke "version:bump", [type]
    invoke "build", []
    system("gem push pkg/thor-scmversion-#{current_version}.gem")
  end
    
  private
  def current_version
    @current_version ||= ::ThorSCMVersion.versioner.from_path
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thor-scmversion-0.2.4 Thorfile
thor-scmversion-0.2.3 Thorfile
thor-scmversion-0.2.2 Thorfile
thor-scmversion-0.2.1 Thorfile
thor-scmversion-0.2.0 Thorfile
thor-scmversion-0.0.5 Thorfile
thor-scmversion-0.0.4 Thorfile