Top Level Namespace

Defined Under Namespace

Modules: Hosties Classes: AttributeConstraint, EnvironmentBuilder, EnvironmentRequirement, HasAttributes, HostBuilder, HostRequirement, UsesAttributes

Instance Method Summary collapse

Instance Method Details

#environment_for(type, &block) ⇒ Object



118
119
120
121
122
123
124
125
126
127
# File 'lib/hosties/Reification.rb', line 118

def environment_for(type, &block)
  begin
    builder = EnvironmentBuilder.new(type)
    builder.instance_eval(&block)
    data = builder.finish
  rescue ArgumentError => ex
    puts "Problem declaring environment: #{ex}"
    raise ex
  end
end

#environment_type(symbol, &block) ⇒ Object

Builder method



128
129
130
131
132
133
134
135
136
137
# File 'lib/hosties/Definitions.rb', line 128

def environment_type(symbol, &block)
  builder = EnvironmentRequirement.new(symbol)
  begin
    builder.instance_eval(&block)
    builder.finished
  rescue ArgumentError => ex
    # TODO: Same as above, find a better way to get this information out
    #puts "Problem describing environment \"#{builder.type}\": #{ex}"
  end
end

#host_type(symbol, &block) ⇒ Object

Builder method



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/hosties/Definitions.rb', line 81

def host_type(symbol, &block)
  builder = HostRequirement.new(symbol)
  begin
    builder.instance_eval(&block)
    builder.finished
  rescue ArgumentError => ex
    # TODO: There must be a better way!
    # I'd like to provide some feedback in this case, but I don't 
    # like having this show up in test output. 
    #puts "Problem defining host \"#{symbol}\": #{ex}"
  end
end