Sha256: 73b7d9ed8ef8670c33def153f57fd70b7181d4306bc5b825ce8738fa83827562

Contents?: true

Size: 1.25 KB

Versions: 24

Compression:

Stored size: 1.25 KB

Contents

# encoding: utf-8
require 'rake'
require 'rake/helpers/logger'

# extend Rake task with a logger
module Rake
    class Task
        alias_method :initialize_base, :initialize
        alias_method :execute_base, :execute
        attr_reader :logger

        def initialize(name, app)
            @logger = Logger.new(STDOUT)
            @enabled = true
            initialize_base(name, app)
        end

        def needed?
            @enabled
        end

        def needed=(value)
            @enabled = value
        end

        # replace execute to indicate what method is executed
        def execute(args=nil)
            puts "Executing #{name}"
            execute_base(args)
        end

        def out(msg)
            logger.info(msg)
        end

        def trace?
            application.options.trace || $DEBUG || false
        end

        def shortname
            scope = @scope.dup.pop.to_s
            n = name.dup
            n.gsub!(scope + ':', '') unless scope.empty?
            return n
        end

        def reenable_chain
            reenable
            prerequisites.each do |ptask|
                ptask.reenable_chain if ptask.class < Rake::Task
            end
        end
    end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rake-delphi-0.0.34 lib/rake/helpers/raketask.rb
rake-delphi-0.0.33 lib/rake/helpers/raketask.rb
rake-delphi-0.0.32 lib/rake/helpers/raketask.rb
rake-delphi-0.0.31 lib/rake/helpers/raketask.rb
rake-delphi-0.0.29 lib/rake/helpers/raketask.rb
rake-delphi-0.0.30 lib/rake/helpers/raketask.rb
rake-delphi-0.0.28 lib/rake/helpers/raketask.rb
rake-delphi-0.0.27 lib/rake/helpers/raketask.rb
rake-delphi-0.0.26 lib/rake/helpers/raketask.rb
rake-delphi-0.0.25 lib/rake/helpers/raketask.rb
rake-delphi-0.0.24 lib/rake/helpers/raketask.rb
rake-delphi-0.0.23 lib/rake/helpers/raketask.rb
rake-delphi-0.0.22 lib/rake/helpers/raketask.rb
rake-delphi-0.0.21 lib/rake/helpers/raketask.rb
rake-delphi-0.0.20 lib/rake/helpers/raketask.rb
rake-delphi-0.0.19 lib/rake/helpers/raketask.rb
rake-delphi-0.0.18 lib/rake/helpers/raketask.rb
rake-delphi-0.0.17 lib/rake/helpers/raketask.rb
rake-delphi-0.0.16 lib/rake/helpers/raketask.rb
rake-delphi-0.0.15 lib/rake/helpers/raketask.rb