Class: RSpecSystem::NodeSet

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-system/node_set.rb

Overview

Factory class for NodeSet.

Defined Under Namespace

Classes: Base, VagrantBase, VagrantVirtualbox, VagrantVmwareFusion, Vsphere

Class Method Summary collapse

Class Method Details

.createRSpecSystem::NodeSet::Base

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a NodeSet object.

Returns:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rspec-system/node_set.rb', line 9

def self.create
  provider = RSpec.configuration.rs_provider
  custom_prefabs = RSpec.configuration.rs_custom_prefabs
  setname = RSpec.configuration.rs_set || RSpec.configuration.rs_config['default_set']
  options = {:destroy => RSpec.configuration.rs_destroy}
  config = RSpec.configuration.rs_config['sets'][setname]

  begin
    require "rspec-system/node_set/#{provider.downcase}"
  rescue LoadError => e
    raise "Unsupported provider #{provider}: #{e}"
  end
  class_name = provider.split("_").map {|v| v.capitalize }.join
  const_get(class_name).new(setname, config, custom_prefabs, options)
end