Sha256: 9905aadc032136706782a16b2590480abde8690930477ee477bb3b719938690f

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

require 'rake/clean'
require 'rubygems'

def version
  contents = File.read File.expand_path('../lib/pinpress/constants.rb', __FILE__)
  contents[/\sVERSION = '([^']+)'/, 1]
end

spec = eval(File.read('pinpress.gemspec'))

require 'rake/testtask'
desc 'Run unit tests'
Rake::TestTask.new do |t|
  t.libs << "test"
  t.test_files = FileList['test/*_test.rb']
end

require 'cucumber'
require 'cucumber/rake/task'
CUKE_RESULTS = 'results.html'
CLEAN << CUKE_RESULTS
desc 'Run Cucumber features'
Cucumber::Rake::Task.new(:features) do |t|
  opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
  opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
  t.cucumber_opts =  opts
  t.fork = false
end

desc "Release PinPress version #{ version }"
task :release => :build do
  unless `git branch` =~ /^\* master$/
    puts "You must be on the master branch to release!"
    exit!
  end
  
  sh "git commit --allow-empty -a -m 'Release #{ version }'"
  sh "git tag v#{ version }"
  sh "git push origin master"
  sh "git push origin v#{ version }"
  sh "gem push pkg/pinpress-#{ version }.gem"
end

desc "Build the gem"
task :build do
  FileUtils.mkdir_p "pkg"
  sh "gem build pinpress.gemspec"
  FileUtils.mv("./pinpress-#{ version }.gem", "pkg")
end

task :default => [:test, :features]

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pinpress-1.1.1 Rakefile
pinpress-1.1.0 Rakefile
pinpress-1.0.2 Rakefile
pinpress-1.0.1 Rakefile
pinpress-1.0.0 Rakefile