Sha256: 616fe4450f849c0fd9dfc08c897b449e65b65b981ab1cd64754e16344fba967d

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

# coding: utf-8
require "bundler/gem_tasks"
require 'rspec/core/rake_task'

require 'rake/extensiontask'
require 'rake/packagetask'
begin
  require 'bundler/gem_tasks'
rescue LoadError
  puts 'If you want to create gem, You must install Bundler'
end

require './lib/itamae-spec/version.rb'
def version
  ItamaeSpec::VERSION
end

Rake::ExtensionTask.new do |ext|
  ext.name = 'itamae-spec'
  ext.ext_dir = 'ext/'
  ext.lib_dir = 'lib/'
end

Rake::PackageTask.new('itamae-spec', "#{version}") do |t|
  t.need_tar_gz = true
  t.package_files.include `git ls-files`.split("\n")
end

namespace :release do
  desc "Bump up version and commit"
  task :version_up do
    version_file = File.expand_path("lib/itamae-spec/version.txt")
    current_version = File.read(version_file).strip

    if /\A(.+?)(\d+)\z/ =~ current_version
      next_version = "#{$1}#{$2.to_i + 1}"
    else
      raise "Invalid version"
    end

    open(version_file, "w") do |f|
      f.write next_version
    end
    system "git add #{version_file}"
    system "git commit -m 'Bump up version'"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
itamae-spec-0.0.6 Rakefile
itamae-spec-0.0.5 Rakefile
itamae-spec-0.0.4 Rakefile
itamae-spec-0.0.3 Rakefile
itamae-spec-0.0.2 Rakefile