Sha256: 43581d5d3eb1bd7085c67c2c0f444e54708f23fcfac6a6d2763f8fac098ad7f8

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

require "bundler"
Bundler::GemHelper.install_tasks

task :default do
  sh "rspec spec/"
end

desc "start the test-server"
task :server do
  sh "cd spec/site && ../../bin/rhr server"
end

rule /^version:bump:.*/ do |t|
  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
  index = ['major', 'minor','patch'].index(t.name.split(':').last)
  file = 'lib/rhr/version.rb'

  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 "git add #{file} && git commit -m 'bump version to #{new_version}'"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhr-0.1.0 Rakefile