Module: VMC::App::PushInteractions

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

Instance Method Summary collapse

Instance Method Details

#ask_bind_servicesObject



59
60
61
62
63
# File 'lib/vmc/cli/app/push/interactions.rb', line 59

def ask_bind_services
  return if all_instances.empty?

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

#ask_commandObject



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

def ask_command
  command = ask("Custom startup command", :default => "none")

  if command != "none"
    command
  end
end

#ask_create_servicesObject



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

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

#ask_domain(app) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vmc/cli/app/push/interactions.rb', line 13

def ask_domain(app)
  choices = v2? ? app.space.domains : ["#{app.name}.#{target_base}"]

  options = {
    :choices => choices + ["none"],
    :display => proc { |d| d.is_a?(String) ? d : d.name },
    :allow_other => true
  }

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

  ask "Domain", options
end

#ask_framework(choices, default, other) ⇒ Object



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

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

#ask_host(name) ⇒ Object



7
8
9
10
11
# File 'lib/vmc/cli/app/push/interactions.rb', line 7

def ask_host(name)
  ask "Subdomain", :choices => [name, "none"],
    :default => name,
    :allow_other => true
end

#ask_instancesObject



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

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

#ask_memory(default) ⇒ Object



27
28
29
30
31
32
# File 'lib/vmc/cli/app/push/interactions.rb', line 27

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



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

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