Module: Blimpy

Defined in:
lib/blimpy.rb,
lib/blimpy/box.rb,
lib/blimpy/cli.rb,
lib/blimpy/keys.rb,
lib/blimpy/boxes.rb,
lib/blimpy/fleet.rb,
lib/blimpy/livery.rb,
lib/blimpy/version.rb,
lib/blimpy/livery/cwd.rb,
lib/blimpy/livery/base.rb,
lib/blimpy/helpers/state.rb,
lib/blimpy/livery/puppet.rb,
lib/blimpy/securitygroups.rb

Defined Under Namespace

Modules: Boxes, Helpers, Keys, Livery, SecurityGroups Classes: Box, BoxValidationError, CLI, Fleet, InvalidBlimpFileError, InvalidLiveryException, InvalidRegionError, InvalidShipException, SSHKeyNotFoundError, UnknownError, UnsupportedFeatureException

Constant Summary collapse

VERSION =
"0.6.7"

Class Method Summary collapse

Class Method Details

.fleet(&block) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/blimpy.rb', line 10

def self.fleet(&block)
  if block.nil?
    return false
  end
  fleet = Blimpy::Fleet.new
  block.call fleet
  fleet
end

.load_file(file_content) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/blimpy.rb', line 19

def self.load_file(file_content)
  if file_content.nil? || file_content.empty?
    raise InvalidBlimpFileError, 'File appears empty'
  end

  begin
    fleet = eval(file_content)
    if fleet and !(fleet.instance_of? Blimpy::Fleet)
      raise Exception, 'File does not create a Fleet'
    end
  rescue Exception => e
    raise InvalidBlimpFileError, e.to_s
  end
  fleet
end