Sha256: f04edabe530cbed50c9963aad506bcf0fb2908b4c458d50a137939ddd02aef84

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

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

      def rebase(path)
        if not path.start_with?('/')
          path = @code.base_dir + path
        end

        path
      end

      def zip_add(zip, dest, src)
        src = File.expand_path(src)

        unless File.exists?(src)
          IronCore::Logger.error 'IronWorkerNG', "Can't find src with path='#{src}'"
          raise IronCore::IronError.new("Can't find src with path='#{src}'")
        end

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

      def hash_string
        ''
      end

      def bundle(zip)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iron_worker_ng-0.6.2 lib/iron_worker_ng/feature/base.rb