vmc 0.4.0.beta.58 → 0.4.0.beta.59

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,8 +7,10 @@ module VMC
7
7
  class App < CLI
8
8
  desc "List your applications"
9
9
  group :apps
10
- input :space, :desc => "Show apps in given space",
11
- :from_given => by_name("space")
10
+ input(:space, :desc => "Show apps in given space",
11
+ :from_given => by_name("space")) {
12
+ client.current_space
13
+ }
12
14
  input :name, :desc => "Filter by name regexp"
13
15
  input :runtime, :desc => "Filter by runtime regexp"
14
16
  input :framework, :desc => "Filter by framework regexp"
@@ -16,18 +18,17 @@ module VMC
16
18
  input :one_line, :alias => "-l", :type => :boolean, :default => false,
17
19
  :desc => "Single-line tabular format"
18
20
  def apps
19
- if space = input[:space] || client.current_space
20
- apps =
21
- with_progress("Getting applications in #{c(space.name, :name)}") do
22
- # depth of 2 for service binding instance names
23
- space.apps(2)
24
- end
25
- else
26
- apps =
27
- with_progress("Getting applications") do
28
- client.apps
29
- end
30
- end
21
+ msg =
22
+ if space = input[:space]
23
+ "Getting applications in #{c(space.name, :name)}"
24
+ else
25
+ "Getting applications"
26
+ end
27
+
28
+ apps =
29
+ with_progress(msg) do
30
+ client.apps(2)
31
+ end
31
32
 
32
33
  if apps.empty? and !quiet?
33
34
  line
@@ -53,7 +54,13 @@ module VMC
53
54
  "#{a.total_instances} x #{human_mb(a.memory)}",
54
55
  v2? && (a.production ? "prod" : "dev"),
55
56
  a.runtime.name,
56
- a.urls.size == 1 ? a.url : "#{a.url}, ..."
57
+ if a.urls.empty?
58
+ d("none")
59
+ elsif a.urls.size == 1
60
+ a.url
61
+ else
62
+ "#{a.url}, ..."
63
+ end
57
64
  ]
58
65
  })
59
66
  else
@@ -93,12 +100,12 @@ module VMC
93
100
  ask("Instances", :default => 1)
94
101
  }
95
102
  input(:framework, :from_given => find_by_name("framework"),
96
- :desc => "Framework to use") { |choices, default, all, other|
97
- ask_with_other("Framework", choices, default, all, other)
103
+ :desc => "Framework to use") { |all, choices, default, other|
104
+ ask_with_other("Framework", all, choices, default, other)
98
105
  }
99
106
  input(:runtime, :from_given => find_by_name("runtime"),
100
- :desc => "Runtime to use") { |choices, default, all, other|
101
- ask_with_other("Runtime", choices, default, all, other)
107
+ :desc => "Runtime to use") { |all, choices, default, other|
108
+ ask_with_other("Runtime", all, choices, default, other)
102
109
  }
103
110
  input(:command, :desc => "Startup command for standalone app") {
104
111
  ask("Startup command")
@@ -850,9 +857,9 @@ module VMC
850
857
  if detected_framework = detector.detect_framework
851
858
  framework = input[
852
859
  :framework,
860
+ all_frameworks,
853
861
  [detected_framework],
854
862
  detected_framework,
855
- all_frameworks,
856
863
  :other
857
864
  ]
858
865
  else
@@ -875,9 +882,9 @@ module VMC
875
882
  else
876
883
  runtime = input[
877
884
  :runtime,
885
+ all_runtimes,
878
886
  detected_runtimes,
879
887
  default_runtime,
880
- all_runtimes,
881
888
  :other
882
889
  ]
883
890
  end
@@ -1080,7 +1087,7 @@ module VMC
1080
1087
  end
1081
1088
  end
1082
1089
 
1083
- def ask_with_other(message, choices, default, all, other)
1090
+ def ask_with_other(message, all, choices, default, other)
1084
1091
  choices = choices.sort_by(&:name)
1085
1092
  choices << other if other
1086
1093
 
@@ -4,6 +4,10 @@ module VMC
4
4
  class Service < CLI
5
5
  desc "List your service instances"
6
6
  group :services
7
+ input(:space, :desc => "Show services in given space",
8
+ :from_given => by_name("space")) {
9
+ client.current_space
10
+ }
7
11
  input :name, :desc => "Filter by name"
8
12
  input :service, :desc => "Filter by service type"
9
13
  input :plan, :desc => "Filter by service plan"
@@ -14,8 +18,15 @@ module VMC
14
18
  input :one_line, :alias => "-l", :type => :boolean, :default => false,
15
19
  :desc => "Single-line tabular format"
16
20
  def services
21
+ msg =
22
+ if space = input[:space]
23
+ "Getting services in #{c(space.name, :name)}"
24
+ else
25
+ "Getting services"
26
+ end
27
+
17
28
  instances =
18
- with_progress("Getting service instances") do
29
+ with_progress(msg) do
19
30
  client.service_instances(2)
20
31
  end
21
32
 
@@ -106,7 +106,7 @@ module VMC
106
106
  ]
107
107
  })
108
108
  else
109
- spaces.each do |s|
109
+ spaced(spaces) do |s|
110
110
  invoke :space, :space => s, :full => input[:full]
111
111
  end
112
112
  end
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.4.0.beta.58"
2
+ VERSION = "0.4.0.beta.59"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1605859511
4
+ hash: 1905859163
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 0
10
10
  - beta
11
- - 58
12
- version: 0.4.0.beta.58
11
+ - 59
12
+ version: 0.4.0.beta.59
13
13
  platform: ruby
14
14
  authors:
15
15
  - VMware
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-09-27 00:00:00 Z
20
+ date: 2012-10-02 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: json_pure
@@ -265,12 +265,12 @@ dependencies:
265
265
  requirements:
266
266
  - - ~>
267
267
  - !ruby/object:Gem::Version
268
- hash: 91
268
+ hash: 89
269
269
  segments:
270
270
  - 0
271
271
  - 3
272
- - 36
273
- version: 0.3.36
272
+ - 37
273
+ version: 0.3.37
274
274
  type: :runtime
275
275
  version_requirements: *id015
276
276
  - !ruby/object:Gem::Dependency