Sha256: 96bcfef133b1cc7c14d3fd0e1481a960bea4f9f1a1179b2f59a638d593701fac

Contents?: true

Size: 995 Bytes

Versions: 9

Compression:

Stored size: 995 Bytes

Contents

require 'fileutils'

module IronWorkerNG
  module Feature
    class Base
      def initialize(code)
        @code = code
      end

      def rebase(path)
        @code.base_dir + path
      end

      def container_add(container, dest, src)
        new_src, clean = IronWorkerNG::Fetcher.fetch(src, true)

        new_src = File.expand_path(new_src) unless new_src.nil?

        if new_src.nil? || (not File.exists?(new_src))
          IronCore::Logger.error 'IronWorkerNG', "Can't find src with path='#{src}'", IronCore::Error
        end

        src = new_src

        if File.directory?(src)
          Dir.glob(src + '/**/**') do |path|
            container.add(@code.dest_dir + dest + path[src.length .. -1], path)
          end
        else
          container.add(@code.dest_dir + dest, src)
        end

        unless clean.nil?
          FileUtils.rm_f(clean)
        end
      end

      def hash_string
        ''
      end

      def bundle(container)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iron_worker_ng-0.10.2 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.10.1 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.10.0 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.9.6 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.9.5 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.9.4 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.9.2 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.9.1 lib/iron_worker_ng/feature/base.rb
iron_worker_ng-0.9.0 lib/iron_worker_ng/feature/base.rb