module Nonnative

Constants

VERSION

Attributes

pool[R]

Public Class Methods

clear() click to toggle source
# File lib/nonnative.rb, line 96
def clear
  @configuration = nil
  @pool = nil
end
configuration() click to toggle source
# File lib/nonnative.rb, line 63
def configuration
  @configuration ||= Nonnative::Configuration.new
end
configure() { |configuration| ... } click to toggle source
# File lib/nonnative.rb, line 67
def configure
  yield configuration

  require "nonnative/#{configuration.strategy}"
end
go_executable(output, exec, cmd, *params) click to toggle source
# File lib/nonnative.rb, line 59
def go_executable(output, exec, cmd, *params)
  Nonnative::GoCommand.new(exec, output).executable(cmd, params)
end
log_lines(path, predicate) click to toggle source
# File lib/nonnative.rb, line 55
def log_lines(path, predicate)
  File.readlines(path).select { |l| predicate.call(l) }
end
start() click to toggle source
# File lib/nonnative.rb, line 73
def start
  @pool ||= Nonnative::Pool.new(configuration)
  errors = []

  @pool.start do |name, id, result|
    errors << "Started #{name} with id #{id}, though did respond in time" unless result
  end

  raise Nonnative::StartError, errors.join("\n") unless errors.empty?
end
stop() click to toggle source
# File lib/nonnative.rb, line 84
def stop
  return if @pool.nil?

  errors = []

  @pool.stop do |name, id, result|
    errors << "Stopped #{name} with id #{id}, though did respond in time" unless result
  end

  raise Nonnative::StopError, errors.join("\n") unless errors.empty?
end