Sha256: d9ba5b92109c0d75c0127002e1267d57c5a6d16a85b3185c570b4c310f59cd8d

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

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

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

task :default => :spec

desc "Bump gem version patch number"
task :bump do
  path = File.expand_path('../lib/activefacts/metamodel/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 "Generate new CQL from the ORM file"
task :cql do
  system "afgen --cql orm/Metamodel.orm > Metamodel.cql"
  system "afgen --cql cql/Metamodel.cql 2>/dev/null | diff -ub - Metamodel.cql | tee Metamodel.cql.diffs"
end

desc "Generate new Ruby from the ORM file"
task :ruby do
  system %q{
    afgen --ruby cql/Metamodel.cql 2>/dev/null |
      sed '2a\
module ActiveFacts
	
	3s/:://
	3,$s/^/  /
	$a\
end
      ' > metamodel.rb
  }
  system "diff -ub lib/activefacts/metamodel/metamodel.rb metamodel.rb"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activefacts-metamodel-1.9.0 Rakefile
activefacts-metamodel-1.8.3 Rakefile