Sha256: a3c375168825c8fb9b1e1d966202edbd7b6c31e1d2cd82c413cdecf909f2d99a

Contents?: true

Size: 1.51 KB

Versions: 9

Compression:

Stored size: 1.51 KB

Contents

require 'bundler'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'; 
RSpec::Core::RakeTask.new(:spec)
# 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.

task :verify do
  changed_files = `git diff --cached --name-only`.split("\n") + `git diff --name-only`.split("\n")
  if !(changed_files == ['Rakefile.rb'] or changed_files.empty?)
    raise "Repository contains uncommitted changes; either commit or stash."
  end
end

desc 'Tag the repository in git with gem version number'
task :tag => :verify do
  v = SemVer.find
  Rake::Task["build"].invoke
  
  if `git tag`.split("\n").include?("#{v.to_s}")
    raise "Version #{v.to_s} has already been released! You cannot release it twice."
  end
  puts 'adding'
  `git add Rakefile.rb`
  puts 'committing'
  `git commit -m "Released version #{v.to_s}"`
  puts 'tagging'
  `git tag #{v.to_s}`
  puts 'locally installing'
  Rake::Task["install"].invoke
end

desc "push data and tags"
task :push => :verify do
  puts 'pushing tags'
  `git push --tags`
  puts 'pushing'
  `git push`
end

desc "run specs, tag, push and release (to rubygems)"
task :all => [:verify] do
  Rake::Task["spec"].invoke
  Rake::Task["release"].invoke
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logirel-0.1.6 Rakefile.rb
logirel-0.1.5 Rakefile.rb
logirel-0.1.4 Rakefile.rb
logirel-0.1.3 Rakefile.rb
logirel-0.1.2 Rakefile.rb
logirel-0.1.1 Rakefile.rb
logirel-0.1.0 Rakefile.rb
logirel-0.0.18 Rakefile.rb
logirel-0.0.17 Rakefile.rb