Module: VMC::App::PushInteractions

Defined in:
lib/vmc/cli/app/push/interactions.rb

Instance Method Summary collapse

Instance Method Details

#ask_bind_servicesObject



52
53
54
55
56
# File 'lib/vmc/cli/app/push/interactions.rb', line 52

def ask_bind_services
  return if all_instances.empty?

  ask "Bind other services to application?", :default => false
end

#ask_commandObject



43
44
45
# File 'lib/vmc/cli/app/push/interactions.rb', line 43

def ask_command
  ask("Startup command")
end

#ask_create_servicesObject



47
48
49
50
# File 'lib/vmc/cli/app/push/interactions.rb', line 47

def ask_create_services
  line unless quiet?
  ask "Create services for application?", :default => false
end

#ask_framework(choices, default, other) ⇒ Object



35
36
37
# File 'lib/vmc/cli/app/push/interactions.rb', line 35

def ask_framework(choices, default, other)
  ask_with_other("Framework", client.frameworks, choices, default, other)
end

#ask_instancesObject



31
32
33
# File 'lib/vmc/cli/app/push/interactions.rb', line 31

def ask_instances
  ask("Instances", :default => 1)
end

#ask_memory(default) ⇒ Object



24
25
26
27
28
29
# File 'lib/vmc/cli/app/push/interactions.rb', line 24

def ask_memory(default)
  ask("Memory Limit",
      :choices => memory_choices,
      :allow_other => true,
      :default => default || "64M")
end

#ask_nameObject



3
4
5
# File 'lib/vmc/cli/app/push/interactions.rb', line 3

def ask_name
  ask("Name")
end

#ask_runtime(choices, default, other) ⇒ Object



39
40
41
# File 'lib/vmc/cli/app/push/interactions.rb', line 39

def ask_runtime(choices, default, other)
  ask_with_other("Runtime", client.runtimes, choices, default, other)
end

#ask_url(name) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vmc/cli/app/push/interactions.rb', line 7

def ask_url(name)
  choices = url_choices(name)

  options = {
    :choices => choices + ["none"],
    :allow_other => true
  }

  options[:default] = choices.first if choices.size == 1

  url = ask "URL", options

  unless url == "none"
    url
  end
end