Sha256: bec7b7c38a0181542350b886570caef3bcf74c3952e0bf5cf39b06a3d618c61b

Contents?: true

Size: 878 Bytes

Versions: 21

Compression:

Stored size: 878 Bytes

Contents

# encoding: utf-8

require 'rake/common/classes'
require 'rake/delphi/liblist'

module Rake
  module Delphi
    class LibsTask < Rake::Task
        attr_reader :libs

        def initialize(name, app)
            super
            @original_dir = ENV['RAKE_DIR'] || Rake.original_dir
        end

        def self.define(name, app)
            app.tasks.each do |t|
                # if there is a task with a name like a searched one
                return t if t.name.index(name)
            end
            # else - define a new task
            app.define_task(LibsTask, name)
        end

        def libs_relative(level)
            @libs.map { |d| d.gsub(@original_dir, '.' + '/..' * level)}
        end

        def execute(args = nil)
            super
            mask = @original_dir + '/lib/**/**'
            @libs = LibList.new(mask)
        end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rake-delphi-0.0.29 lib/rake/common/libstask.rb
rake-delphi-0.0.28 lib/rake/common/libstask.rb
rake-delphi-0.0.27 lib/rake/common/libstask.rb
rake-delphi-0.0.26 lib/rake/common/libstask.rb
rake-delphi-0.0.25 lib/rake/common/libstask.rb
rake-delphi-0.0.24 lib/rake/common/libstask.rb
rake-delphi-0.0.23 lib/rake/common/libstask.rb
rake-delphi-0.0.22 lib/rake/common/libstask.rb
rake-delphi-0.0.21 lib/rake/common/libstask.rb
rake-delphi-0.0.20 lib/rake/common/libstask.rb
rake-delphi-0.0.19 lib/rake/common/libstask.rb
rake-delphi-0.0.18 lib/rake/common/libstask.rb
rake-delphi-0.0.17 lib/rake/common/libstask.rb
rake-delphi-0.0.16 lib/rake/common/libstask.rb
rake-delphi-0.0.15 lib/rake/common/libstask.rb
rake-delphi-0.0.14 lib/rake/common/libstask.rb
rake-delphi-0.0.13 lib/rake/common/libstask.rb
rake-delphi-0.0.12 lib/rake/common/libstask.rb
rake-delphi-0.0.11 lib/rake/common/libstask.rb
rake-delphi-0.0.9 lib/rake/common/libstask.rb