Class: VMC::App::Mem

Inherits:
Base
  • Object
show all
Defined in:
lib/appfog-vmc-plugin/deprecated/mem.rb

Constant Summary collapse

IS_UTF8 =
!!(ENV["LC_ALL"] || ENV["LC_CTYPE"] || ENV["LANG"] || "")["UTF-8"].freeze

Instance Method Summary collapse

Instance Method Details

#memObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/appfog-vmc-plugin/deprecated/mem.rb', line 11

def mem
  app = input[:app]

  if input.has?(:mem)
    mem = input[:mem]
  else
    mem = input[:mem, app.memory]
  end

  app.memory = megabytes(mem) if input.has?(:mem)
  fail "No changes!" unless app.changed?

  with_progress("Scaling #{c(app.name, :name)}") do
    app.update!
  end

  if app.started?
    invoke :restart, :app => app
  end

end