Sha256: de8f051d1aa5c08ba734256e38ac000510f19b33311b4c3a488f03e5d5fda460

Contents?: true

Size: 928 Bytes

Versions: 5

Compression:

Stored size: 928 Bytes

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)
            initialize_base(name, app)
        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
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rake-delphi-0.0.9 lib/rake/helpers/raketask.rb
rake-delphi-0.0.8 lib/rake/helpers/raketask.rb
rake-delphi-0.0.7 lib/rake/helpers/raketask.rb
rake-delphi-0.0.6 lib/rake/helpers/raketask.rb
rake-delphi-0.0.5 lib/rake/helpers/raketask.rb