Sha256: 1fb65ab0f2d5cd73c4b8236931832366269de3dcf0081c2cc3f2ba7fff6d30c4

Contents?: true

Size: 766 Bytes

Versions: 15

Compression:

Stored size: 766 Bytes

Contents

require_relative '../feature/node/merge_exec'

module IronWorkerNG
  module Code
    class Node < IronWorkerNG::Code::Base
      include IronWorkerNG::Feature::Node::MergeExec::InstanceMethods

      def create_runner(zip)
        zip.get_output_stream(runner) do |runner|
          runner.write <<RUNNER
#!/bin/sh
# iron_worker_ng-#{IronWorkerNG.version}

root() {
  while [ $# -gt 0 ]; do
    if [ "$1" = "-d" ]; then
      printf "%s\n" "$2"
      break
    fi
  done
}

cd "$(root "$@")"

node #{File.basename(@exec.path)} "$@"
RUNNER
        end
      end

      def runtime
        'sh'
      end

      def runner
        '__runner__.sh'
      end
    end
  end
end

IronWorkerNG::Code::Base.register_type(:name => 'node', :klass => IronWorkerNG::Code::Node)

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
iron_worker_ng-0.4.1 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.4.0 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.9 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.8 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.7 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.6 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.5 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.4 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.3 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.2 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.1 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.3.0 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.2.7 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.2.6 lib/iron_worker_ng/code/node.rb
iron_worker_ng-0.2.5 lib/iron_worker_ng/code/node.rb