Sha256: 8a49c3dc25bc3aab37ab3ca5fb36869c861eb3899526a95479ca74aed68995a5

Contents?: true

Size: 1.46 KB

Versions: 15

Compression:

Stored size: 1.46 KB

Contents

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec

desc "Bump gem version patch number"
task :bump do
  path = File.expand_path('../lib/activefacts/compositions/version.rb', __FILE__)
  lines = File.open(path) do |fp| fp.readlines; end
  File.open(path, "w") do |fp|
    fp.write(
      lines.map do |line|
	line.gsub(/(VERSION *= *"[0-9.]*\.)([0-9]+)"\n/) do
	  version = "#{$1}#{$2.to_i+1}"
	  puts "Version bumped to #{version}\""
	  version+"\"\n"
	end
      end*''
    )
  end
end

desc "Display differences between expected and actual from the last test run"
task :actual do
  system <<-END
    for actual in `find spec -type d -name actual`
    do
      base=`dirname "$actual"`
      files="`ls $base/actual/* 2>/dev/null`"
      if [ x"$files" != x"" ]
      then
	echo "=================================== $base ==================================="
	diff -rub $base/expected/ $base/actual |grep -v '^Only in .*expected'
      fi
    done
  END
end

desc "Accept the last actual test output, making it expected for the next test run"
task :accept do
  system <<-END
    for actual_dir in `find spec -type d -name actual`
    do
      base=`dirname "$actual_dir"`
      expected=`cd "$base/expected"; git ls-files`
      actual=`cd "$base/actual"; ls $expected 2>/dev/null`
      if [ x"$actual" != x"" ]
      then
	echo "Accepting $actual"
	(cd "$base/actual"; mv $actual ../expected)
      fi
    done
  END
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
activefacts-compositions-1.9.23 Rakefile
activefacts-compositions-1.9.22 Rakefile
activefacts-compositions-1.9.21 Rakefile
activefacts-compositions-1.9.20 Rakefile
activefacts-compositions-1.9.19 Rakefile
activefacts-compositions-1.9.18 Rakefile
activefacts-compositions-1.9.17 Rakefile
activefacts-compositions-1.9.16 Rakefile
activefacts-compositions-1.9.15 Rakefile
activefacts-compositions-1.9.14 Rakefile
activefacts-compositions-1.9.13 Rakefile
activefacts-compositions-1.9.12 Rakefile
activefacts-compositions-1.9.10 Rakefile
activefacts-compositions-1.9.9 Rakefile
activefacts-compositions-1.9.8 Rakefile