af 0.5.0.beta.10 → 0.5.0.beta.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDk1NDE1ZjhjNWU3YThiMDlmMDEzYzRlYTlmZmI5MTE3ZWE1OWZhYg==
4
+ M2FkZjBkNWU3NWI2YTcyOGUxZTgzYjlmOTgyZDBjOGQ1NmI4MTVlMw==
5
5
  data.tar.gz: !binary |-
6
- YzE5NmZmMzhkYTVlNjkyNTZjYTIzZjY3ODg5YzAyZTdjNTZhOTg5Zg==
6
+ NDIwNzJjZGUxY2RiZTMyOTU5OGQ5Mjc3MTM3Nzg3N2FmYzUxNmY5Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjgyODYwNjQyZGEyZDkxYmQwZDFlM2YzNjk3MTE5MzE0NjAwNWI4ODgzNTUy
10
- ZmJkODBmMWI4YTEzNGE4MGNjZDI3OTM1ZWYwYjEzNmNiM2Y5NDEyOTZhNWM1
11
- Njg5ODdiZDFlZTJhMWRlZDgzYWFkNTA3ZTNkNDVkZWE1ODEwZmI=
9
+ NGYxNmY3ZDM2NTBmOTQxZTVhYzhmYTE5YzY3Y2Y2MGFiNzZjMjAzYTk4NzUw
10
+ ZGViMTZjOThlNzNlNzRjZDM1MTE2YTlhYTM0NmY4NGIzOWRkMjc2ZmM3MTZm
11
+ Y2M3NmRiYTY1MDRkZjk2MmQ3MGMzZWQwYmVhMzhjZDVkY2FmMDc=
12
12
  data.tar.gz: !binary |-
13
- YmI3ZmYwZWE3NDhjMGE2YWU1N2RiMDg0OWVhYmUzYTIyNjdiYmNlYWU0NTdj
14
- YWU1MWUwYWI0OGFkODNmNmQ3YWU4ZjBkY2MxMzcwYWViZmZlMzhiZjU5MDUx
15
- MDM1NGI0MDQyMTVkNWVhMjdmNjM4MjEwNTFiYWVlNzA5MjNiYTM=
13
+ MDc2YzlkYmMyMTEyMjg3N2MyNGU5MTJkZmY4YmNiNjRkODQwMzRiMmY2ZmJm
14
+ YjJmNmFlY2E2NjhhYmZiNmFlNTRkMDNmZjE2YzRlYjdlMTdhMzEwNTAwZmMx
15
+ YTcxMTZkZGZiMWI3YjU5ZTczY2U1Nzc2YTdjNTEwYmE0NDNmYzg=
@@ -1,3 +1,3 @@
1
1
  module AF
2
- VERSION = "0.5.0.beta.10".freeze
2
+ VERSION = "0.5.0.beta.11".freeze
3
3
  end
@@ -56,6 +56,8 @@ module VMC
56
56
  option :trace, :desc => "Show API traffic", :alias => "-t",
57
57
  :default => false
58
58
 
59
+ option :infras, :desc => "Query infras",
60
+ :type => :boolean, :default => proc { true }
59
61
 
60
62
  def default_action
61
63
  if input[:version]
@@ -234,6 +236,10 @@ module VMC
234
236
  input[:color]
235
237
  end
236
238
 
239
+ def infras_enabled?
240
+ input[:infras]
241
+ end
242
+
237
243
  def verbose?
238
244
  input[:verbose]
239
245
  end
@@ -405,14 +411,14 @@ module VMC
405
411
  token = info[:token] && CFoundry::AuthToken.from_hash(info)
406
412
 
407
413
  @@client =
408
- case info[:version]
409
- when 2
410
- CFoundry::V2::Client.new(target, token)
411
- when 1
412
- CFoundry::V1::Client.new(target, token)
413
- else
414
+ # case info[:version]
415
+ # when 2
416
+ # CFoundry::V2::Client.new(target, token)
417
+ # when 1
418
+ # CFoundry::V1::Client.new(target, token)
419
+ # else
414
420
  CFoundry::Client.new(target, token)
415
- end
421
+ # end
416
422
 
417
423
  @@client.proxy = input[:proxy]
418
424
  @@client.trace = input[:trace]
@@ -59,10 +59,10 @@ module VMC::App
59
59
 
60
60
  def display_apps_table(apps)
61
61
  table(
62
- ["name", "infra", "status", "usage", v2? && "plan", "runtime", "url"],
62
+ ["name", infras_enabled? && "infra", "status", "usage", v2? && "plan", "runtime", "url"],
63
63
  apps.collect { |a|
64
64
  [ c(a.name, :name),
65
- c(a.infra.name, :infra),
65
+ infras_enabled? && c(a.infra.name, :infra),
66
66
  app_status(a),
67
67
  "#{a.total_instances} x #{human_mb(a.memory)}",
68
68
  v2? && (a.production ? "prod" : "dev"),
@@ -32,7 +32,7 @@ module VMC::App
32
32
  input :plan, :desc => "Application plan", :default => "D100"
33
33
  input :start, :desc => "Start app after pushing?", :default => true
34
34
  input :restart, :desc => "Restart app after updating?", :default => true
35
- input :buildpack, :desc => "Custom buildpack URL", :default => nil
35
+ # input :buildpack, :desc => "Custom buildpack URL", :default => nil
36
36
  input :create_services, :desc => "Interactively create services?",
37
37
  :type => :boolean, :default => proc { force? ? false : interact }
38
38
  input :bind_services, :desc => "Interactively bind services?",
@@ -8,7 +8,7 @@ module VMC::App
8
8
  def get_inputs
9
9
  inputs = {}
10
10
  inputs[:name] = name = input[:name]
11
- inputs[:infra] = infra = determine_infra
11
+ inputs[:infra] = infra = determine_infra if infras_enabled?
12
12
  inputs[:url] = input[:url, name, infra]
13
13
  inputs[:uris] = [inputs[:url]]
14
14
  inputs[:total_instances] = input[:instances]
@@ -26,12 +26,12 @@ module VMC::App
26
26
  end
27
27
 
28
28
  def ask_url(name, infra)
29
- ask("Enter URL?", :default => "#{name}.#{infra.base}")
29
+ urlbase = !infra.nil? ? "#{infra.base}" : "no-infra.af.cm"
30
+ ask("Enter URL?", :default => "#{name}.#{urlbase}")
30
31
  end
31
32
 
32
33
  def determine_infra
33
34
  return input[:infra] if input.has?(:infra)
34
-
35
35
  input[:infra, detector.all_infras, nil, nil]
36
36
  end
37
37
 
@@ -40,7 +40,11 @@ module VMC::App
40
40
  end
41
41
 
42
42
  def ask_infra(choices, default, other)
43
- ask_with_other("Infrastructure", client.infras, choices, default, other)
43
+ ask("Infrastructure?", :choices => client.infras,
44
+ :display => proc { |s|
45
+ str = "#{c(s.name, :name)} - #{s.description}"
46
+ },
47
+ :complete => proc { |s| "#{s.name} #{s.description}" })
44
48
  end
45
49
 
46
50
  def ask_runtime(choices, default, other)
@@ -25,7 +25,7 @@ module VMC::Service
25
25
  def create_service
26
26
  offerings = client.services
27
27
 
28
- if input[:infra]
28
+ if infras_enabled? && input[:infra]
29
29
  offerings.reject! { |s| s.infra.to_s != input[:infra].name }
30
30
  end
31
31
 
@@ -66,7 +66,7 @@ module VMC::Service
66
66
 
67
67
  service = client.service_instance
68
68
 
69
- service.infra_name = input[:infra].name
69
+ service.infra_name = input[:infra].name if infras_enabled?
70
70
  service.name = input[:name, offering]
71
71
 
72
72
  if v2?
@@ -45,7 +45,7 @@ module VMC::Service
45
45
  end
46
46
  else
47
47
  table(
48
- ["name", "infra", "service", "version", v2? && "plan", v2? && "bound apps"],
48
+ ["name", infras_enabled? && "infra", "service", "version", v2? && "plan", v2? && "bound apps"],
49
49
  services.collect { |i|
50
50
  if v2?
51
51
  plan = i.service_plan
@@ -60,7 +60,7 @@ module VMC::Service
60
60
  end
61
61
 
62
62
  [ c(i.name, :name),
63
- c(i.infra.name, :infra),
63
+ infras_enabled? && c(i.infra.name, :infra),
64
64
  label,
65
65
  version,
66
66
  v2? && plan.name,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: af
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.beta.10
4
+ version: 0.5.0.beta.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloud Foundry Team
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-17 00:00:00.000000000 Z
12
+ date: 2013-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure