Class: Amigrind::Blueprints::Evaluator
- Inherits:
-
Object
- Object
- Amigrind::Blueprints::Evaluator
- Includes:
- Provisioners, Core::Logging::Mixin
- Defined in:
- lib/amigrind/blueprints/evaluator.rb
Defined Under Namespace
Classes: AWSConfigEvaluator, BaseAMIEvaluator, ParentBlueprintEvaluator
Instance Attribute Summary collapse
-
#blueprint ⇒ Object
readonly
Returns the value of attribute blueprint.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename, environment = nil) ⇒ Evaluator
constructor
A new instance of Evaluator.
- #properties ⇒ Object
Constructor Details
#initialize(filename, environment = nil) ⇒ Evaluator
Returns a new instance of Evaluator.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/amigrind/blueprints/evaluator.rb', line 9 def initialize(filename, environment = nil) @blueprint = Blueprint.new @blueprint.name = File.basename(filename, ".rb") regex = Amigrind::Core::BLUEPRINT_NAME_REGEX raise "blueprint name (#{@blueprint.name}) must match #{regex.source}" \ unless regex.match(@blueprint.name) @properties = if environment.nil? debug_log "no environment found to use with blueprint" {} else debug_log "using environment '#{environment.name}' with blueprint" environment.properties.merge(environment_name: environment.name) end unless environment.nil? @blueprint.aws.vpc_id = environment.aws.vpc @blueprint.aws.subnet_ids = environment.aws.subnets @blueprint.aws.region = environment.aws.region @blueprint.aws.copy_regions = environment.aws.copy_regions @blueprint.aws.ssh_keypair_name = environment.aws.ssh_keypair_name end instance_eval(IO.read(filename), File.(filename), 0) end |
Instance Attribute Details
#blueprint ⇒ Object (readonly)
Returns the value of attribute blueprint.
7 8 9 |
# File 'lib/amigrind/blueprints/evaluator.rb', line 7 def blueprint @blueprint end |
Class Method Details
Instance Method Details
#properties ⇒ Object
42 43 44 |
# File 'lib/amigrind/blueprints/evaluator.rb', line 42 def properties @properties end |