Module: CF::App::PushInteractions

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

Instance Method Summary collapse

Instance Method Details

#ask_bind_servicesObject



55
56
57
58
59
# File 'lib/cf/cli/app/push/interactions.rb', line 55

def ask_bind_services
  return if all_instances.empty?

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

#ask_commandObject



42
43
44
45
46
47
48
# File 'lib/cf/cli/app/push/interactions.rb', line 42

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

  if command != "none"
    command
  end
end

#ask_create_servicesObject



50
51
52
53
# File 'lib/cf/cli/app/push/interactions.rb', line 50

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

#ask_domain(app) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cf/cli/app/push/interactions.rb', line 17

def ask_domain(app)
  choices = app.space.domains

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

  options[:default] = choices.first

  ask "Domain", options
end

#ask_host(name) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/cf/cli/app/push/interactions.rb', line 7

def ask_host(name)
  # Use .dup here because when we pass app.name deep into interactive,
  # it needs an unfrozen String because the cli allows people to change
  # this value.
  host = name.dup
  ask "Subdomain", :choices => [host, "none"],
    :default => host,
    :allow_other => true
end

#ask_instancesObject



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

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

#ask_memory(default) ⇒ Object



31
32
33
34
35
36
# File 'lib/cf/cli/app/push/interactions.rb', line 31

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

#ask_nameObject



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

def ask_name
  ask("Name")
end