Sha256: 9dbf0a5f2bd7a7e117509c72746cd1964a52375c4ce50e8a8ed15fa43033bd2e

Contents?: true

Size: 530 Bytes

Versions: 13

Compression:

Stored size: 530 Bytes

Contents

# -*- coding: utf-8 -*-


require 'rake'


module Rake
  class Application

    alias invoke_task_org invoke_task

    def invoke_task(*args, &block)
      invoke_task_org(*args, &block)
    rescue RuntimeError => e
      if e.message =~ /don't\s+know\s+.*\s+task\s+/i
        escalate_tasks
      else
        raise
      end
    end

    def escalate_tasks()
      Dir.chdir '..' do
        cmd = "rake #{ARGV.join ' '}"
        $stderr.puts "(in #{Dir.pwd}) #{cmd}"
        system cmd
      end
      exit 0
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
xot-0.1.34 lib/xot/rake/escalation.rb
xot-0.1.33 lib/xot/rake/escalation.rb
xot-0.1.32 lib/xot/rake/escalation.rb
xot-0.1.31 lib/xot/rake/escalation.rb
xot-0.1.30 lib/xot/rake/escalation.rb
xot-0.1.29 lib/xot/rake/escalation.rb
xot-0.1.28 lib/xot/rake/escalation.rb
xot-0.1.27 lib/xot/rake/escalation.rb
xot-0.1.26 lib/xot/rake/escalation.rb
xot-0.1.25 lib/xot/rake/escalation.rb
xot-0.1.24 lib/xot/rake/escalation.rb
xot-0.1.23 lib/xot/rake/escalation.rb
xot-0.1.22 lib/xot/rake/escalation.rb