class Voxpupuli::Acceptance::Facts
Constants
- ENV_VAR_PREFIX
- FACT_FILE
Public Class Methods
beaker_facts_from_env()
click to toggle source
# File lib/voxpupuli/acceptance/facts.rb, line 8 def beaker_facts_from_env facts = {} ENV.each do |var, value| next unless var.start_with?(ENV_VAR_PREFIX) fact = var.sub(ENV_VAR_PREFIX, '').downcase facts[fact] = value end facts end
write_beaker_facts_on(hosts)
click to toggle source
# File lib/voxpupuli/acceptance/facts.rb, line 21 def write_beaker_facts_on(hosts) beaker_facts = beaker_facts_from_env if beaker_facts.any? require 'json' on(hosts, "mkdir -p #{File.dirname(FACT_FILE)} && cat <<VOXPUPULI_BEAKER_ENV_VARS > #{FACT_FILE}\n#{beaker_facts.to_json}\nVOXPUPULI_BEAKER_ENV_VARS") else on(hosts, "rm -f #{FACT_FILE}") end end