Sha256: 3570a95bec39272d897c192c8e53e2659efdc84f627f9590fe15d4e4e06fe832

Contents?: true

Size: 681 Bytes

Versions: 13

Compression:

Stored size: 681 Bytes

Contents

require "bundler"
Bundler::GemHelper.install_tasks

task :default do
  sh "rspec spec/"
end

rule /^version:bump:.*/ do |t|
  file = 'lib/vendorer/version.rb'
  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
  index = ['major', 'minor','patch'].index(t.name.split(':').last)
  version_file = File.read(file)
  old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
  version_parts[index] = version_parts[index].to_i + 1
  new_version = version_parts * '.'
  File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }

  sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vendorer-0.1.12 Rakefile
vendorer-0.1.11 Rakefile
vendorer-0.1.10 Rakefile
vendorer-0.1.9 Rakefile
vendorer-0.1.8 Rakefile
vendorer-0.1.7 Rakefile
vendorer-0.1.6 Rakefile
vendorer-0.1.5 Rakefile
vendorer-0.1.4 Rakefile
vendorer-0.1.3 Rakefile
vendorer-0.1.2 Rakefile
vendorer-0.1.1 Rakefile
vendorer-0.1.0 Rakefile