Module: Vagabond

Defined in:
lib/vagabond/knife.rb,
lib/vagabond/server.rb,
lib/vagabond/helpers.rb,
lib/vagabond/kitchen.rb,
lib/vagabond/version.rb,
lib/vagabond/vagabond.rb,
lib/vagabond/constants.rb,
lib/vagabond/actions/up.rb,
lib/vagabond/actions/ssh.rb,
lib/vagabond/actions/thaw.rb,
lib/vagabond/vagabondfile.rb,
lib/vagabond/actions/start.rb,
lib/vagabond/actions/create.rb,
lib/vagabond/actions/freeze.rb,
lib/vagabond/actions/status.rb,
lib/vagabond/actions/destroy.rb,
lib/vagabond/actions/rebuild.rb,
lib/vagabond/actions/provision.rb,
lib/vagabond/internal_configuration.rb,
lib/vagabond/helpers/cheffile_loader.rb,
lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb

Defined Under Namespace

Modules: Actions, Helpers Classes: CheffileLoader, InternalConfiguration, Kitchen, Knife, Server, Vagabond, Vagabondfile, Version

Constant Summary collapse

VERSION =
Version.new('0.2.0', 'frank the tank')
BASE_TEMPLATES =
File.readlines(
  File.join(File.dirname(__FILE__), 'cookbooks/vagabond/attributes/default.rb')
).map do |l|
  l.scan(%r{bases\]\[:([^\]]+)\]}).flatten.first
end.compact.uniq
COLORS =
Mash.new(
  :success => :green,
  :create => :green,
  :setup => :blue,
  :error => :red,
  :failed => :red,
  :verified => :yellow,
  :converged => :magenta,
  :destroyed => :red,
  :kitchen => [:cyan, :bold]
)
EXIT_CODES =
Mash.new(
  :success => 0,
  :reserved_name => 1,
  :invalid_name => 2,
  :invalid_base_template => 3,
  :invalid_action => 4,
  :invalid_template => 5,
  :kitchen_missing_yml => 6,
  :kitchen_no_cookbook_arg => 7,
  :kitchen_too_many_args => 8,
  :kitchen_invalid_platform => 9,
  :missing_node_name => 10,
  :cluster_invalid => 11
)

Class Method Summary collapse

Class Method Details

.get_bytes(s) ⇒ Object



3
4
5
6
7
8
# File 'lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb', line 3

def get_bytes(s)
  s = s.to_s
  indx = [nil, 'k', 'm', 'g']
  power = indx.index(s.slice(-1, s.length).to_s.downcase).to_i * 10
  (2**power) * s.to_i
end