Sha256: 0fd21178e41eb2539cb6af879e1db712018a9dccf7147c2049738407fea0bc1e

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

require 'bundler'
Bundler::GemHelper.install_tasks
# Requires Bundler and adds the 
#build, install and release 
#Rake tasks by way of calling Bundler::GemHelper.install_tasks. 
#The build task will build the current version of the gem and 
#store it under the pkg folder, the install task will build 
#and install the gem to our system (just like it would do if we 
#gem install'd it) and release will push the gem to Rubygems for 
#consumption by the public.

desc 'Tag the repository in git with gem version number'
task :tag do
  changed_files = `git diff --cached --name-only`.split("\n") + `git diff --name-only`.split("\n")
  v = SemVer.find
  if changed_files == ['Rakefile.rb'] or changed_files.empty?
    Rake::Task["build"].invoke
  
    if `git tag`.split("\n").include?("#{v.to_s}")
      raise "Version #{v.to_s} has already been released"
    end
	puts 'adding'
    `git add #{File.expand_path("logirel.gemspec", __FILE__)}`
    puts 'committing'
	`git commit -m "Released version #{v.to_s}"`
	puts 'tagging'
	`git tag #{v.to_s}`
	puts 'pushing tags'
    `git push --tags`
	puts 'pushing'
    `git push`
  else
    raise "Repository contains uncommitted changes; either commit or stash."
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logirel-0.0.6 Rakefile.rb