Sha256: 696a0e621b9dc337b564988f2b3cc9157713bc650bf2186a043898662e748ea2
Contents?: true
Size: 754 Bytes
Versions: 6
Compression:
Stored size: 754 Bytes
Contents
# frozen_string_literal: true require_relative '../runner' # Case class -> DSL module: # * goto # * run module DSL # Run command from the host identify as pHostname # goto :host1, :execute => "command" def goto(host = :localhost, args = {}) @result.reset @action[:command] = args[:execute] if args[:execute] @action[:command] = args[:exec] if args[:exec] tempfile(args[:tempfile]) if args[:tempfile] @action[:encoding] = args[:encoding] || 'UTF-8' start_time = Time.now run_cmd_on(host) @action[:duration] = (Time.now - start_time).round(3) end alias on goto ## # DLS run: It's the same as goto :localhost def run(command, args = {}) args[:exec] = command.to_s goto(:localhost, args) end end
Version data entries
6 entries across 6 versions & 1 rubygems