Sha256: b8db92aa62589981a7a8b0bc2c44aede5d1d56e60ebfabce18b29532cb148288
Contents?: true
Size: 1.1 KB
Versions: 16
Compression:
Stored size: 1.1 KB
Contents
module VagrantPlugins module CORL class BaseAction #----------------------------------------------------------------------------- # Constructor / Destructor def initialize(app, env) @app = app @env = env[:machine].env @network = nil @node = nil @vm = nil if @corl_config_loaded = ::CORL.vagrant_config_loaded? # Hackish solution to ensure our code has access to Vagrant machines. # This serves as a Vagrant VM manager. ::CORL::Vagrant.command = Command::Launcher.new([], @env) if @network = ::CORL::Vagrant::Config.load_network(env[:root_path]) @vm = env[:machine] @node = network.node(:vagrant, @vm.name) if @vm end end end #----------------------------------------------------------------------------- # Property accessor / modifiers attr_reader :network, :node, :vm #----------------------------------------------------------------------------- # Action execution def call(env) yield if block_given? && @corl_config_loaded && @network && @node end end end end
Version data entries
16 entries across 16 versions & 1 rubygems