vmc 0.4.0.beta.25 → 0.4.0.beta.26
Sign up to get free protection for your applications and to get access to all the features.
- data/vmc-ng/lib/vmc.rb +1 -0
- data/vmc-ng/lib/vmc/cli/app.rb +1 -1
- data/vmc-ng/lib/vmc/cli/help.rb +1 -0
- data/vmc-ng/lib/vmc/cli/interactive.rb +1 -1
- data/vmc-ng/lib/vmc/cli/organization.rb +63 -0
- data/vmc-ng/lib/vmc/cli/space.rb +28 -20
- data/vmc-ng/lib/vmc/cli/start.rb +5 -5
- data/vmc-ng/lib/vmc/version.rb +1 -1
- metadata +11 -10
data/vmc-ng/lib/vmc.rb
CHANGED
data/vmc-ng/lib/vmc/cli/app.rb
CHANGED
@@ -789,7 +789,7 @@ module VMC
|
|
789
789
|
line "platform: #{b(a.framework.name)} on #{b(a.runtime.name)}"
|
790
790
|
|
791
791
|
start_line "usage: #{b(human_size(a.memory * 1024 * 1024, 0))}"
|
792
|
-
print " #{
|
792
|
+
print " #{d(IS_UTF8 ? "\xc3\x97" : "x")} #{b(a.total_instances)}"
|
793
793
|
print " instance#{a.total_instances == 1 ? "" : "s"}"
|
794
794
|
|
795
795
|
line
|
data/vmc-ng/lib/vmc/cli/help.rb
CHANGED
@@ -0,0 +1,63 @@
|
|
1
|
+
require "vmc/cli"
|
2
|
+
|
3
|
+
module VMC
|
4
|
+
class Organization < CLI
|
5
|
+
def precondition
|
6
|
+
super
|
7
|
+
fail "This command is v2-only." unless v2?
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.by_name(what, obj = what)
|
11
|
+
proc { |name, *_|
|
12
|
+
client.send(:"#{obj}_by_name", name) ||
|
13
|
+
fail("Unknown #{what} '#{name}'")
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Show organization information"
|
18
|
+
group :organizations
|
19
|
+
input(:organization, :aliases => ["--org", "-o"],
|
20
|
+
:argument => :optional, :from_given => by_name("organization"),
|
21
|
+
:desc => "Organization to show") {
|
22
|
+
client.current_organization
|
23
|
+
}
|
24
|
+
input :full, :type => :boolean,
|
25
|
+
:desc => "Show full information for appspaces"
|
26
|
+
def org(input)
|
27
|
+
org = input[:organization]
|
28
|
+
|
29
|
+
if quiet?
|
30
|
+
puts org.name
|
31
|
+
return
|
32
|
+
end
|
33
|
+
|
34
|
+
line "#{c(org.name, :name)}:"
|
35
|
+
|
36
|
+
indented do
|
37
|
+
line "domains: #{name_list(org.domains)}"
|
38
|
+
|
39
|
+
if input[:full]
|
40
|
+
line "spaces:"
|
41
|
+
|
42
|
+
spaced(org.spaces(2)) do |s|
|
43
|
+
indented do
|
44
|
+
invoke :space, :space => s
|
45
|
+
end
|
46
|
+
end
|
47
|
+
else
|
48
|
+
line "spaces: #{name_list(org.spaces)}"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def name_list(xs)
|
56
|
+
if xs.empty?
|
57
|
+
d("none")
|
58
|
+
else
|
59
|
+
xs.collect { |x| c(x.name, :name) }.join(", ")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/vmc-ng/lib/vmc/cli/space.rb
CHANGED
@@ -25,32 +25,40 @@ module VMC
|
|
25
25
|
def space(input)
|
26
26
|
space = input[:space]
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
if quiet?
|
29
|
+
puts space.name
|
30
|
+
return
|
31
|
+
end
|
32
|
+
|
33
|
+
line "#{c(space.name, :name)}:"
|
34
|
+
|
35
|
+
indented do
|
36
|
+
line "organization: #{c(space.organization.name, :name)}"
|
30
37
|
|
31
|
-
|
32
|
-
|
33
|
-
|
38
|
+
if input[:full]
|
39
|
+
line
|
40
|
+
line "apps:"
|
34
41
|
|
35
|
-
|
36
|
-
|
37
|
-
|
42
|
+
spaced(space.apps(2)) do |a|
|
43
|
+
indented do
|
44
|
+
invoke :app, :app => a
|
45
|
+
end
|
38
46
|
end
|
47
|
+
else
|
48
|
+
line "apps: #{name_list(space.apps)}"
|
39
49
|
end
|
40
|
-
else
|
41
|
-
line "apps: #{name_list(space.apps)}"
|
42
|
-
end
|
43
50
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
51
|
+
if input[:full]
|
52
|
+
line
|
53
|
+
line "services:"
|
54
|
+
spaced(space.service_instances(2)) do |i|
|
55
|
+
indented do
|
56
|
+
invoke :service, :instance => i
|
57
|
+
end
|
50
58
|
end
|
59
|
+
else
|
60
|
+
line "services: #{name_list(space.service_instances)}"
|
51
61
|
end
|
52
|
-
else
|
53
|
-
line "services: #{name_list(space.service_instances)}"
|
54
62
|
end
|
55
63
|
end
|
56
64
|
|
@@ -58,7 +66,7 @@ module VMC
|
|
58
66
|
|
59
67
|
def name_list(xs)
|
60
68
|
if xs.empty?
|
61
|
-
|
69
|
+
d("none")
|
62
70
|
else
|
63
71
|
xs.collect { |x| c(x.name, :name) }.join(", ")
|
64
72
|
end
|
data/vmc-ng/lib/vmc/cli/start.rb
CHANGED
@@ -87,7 +87,7 @@ module VMC
|
|
87
87
|
|
88
88
|
indented do
|
89
89
|
if runtimes.empty? && !quiet?
|
90
|
-
line "#{
|
90
|
+
line "#{d("none")}"
|
91
91
|
else
|
92
92
|
spaced(runtimes) do |r|
|
93
93
|
display_runtime(r)
|
@@ -104,7 +104,7 @@ module VMC
|
|
104
104
|
|
105
105
|
indented do
|
106
106
|
if frameworks.empty? && !quiet?
|
107
|
-
line "#{
|
107
|
+
line "#{d("none")}"
|
108
108
|
else
|
109
109
|
spaced(frameworks) do |f|
|
110
110
|
display_framework(f)
|
@@ -121,7 +121,7 @@ module VMC
|
|
121
121
|
|
122
122
|
indented do
|
123
123
|
if services.empty? && !quiet?
|
124
|
-
line "#{
|
124
|
+
line "#{d("none")}"
|
125
125
|
else
|
126
126
|
spaced(services) do |s|
|
127
127
|
display_service(s)
|
@@ -373,7 +373,7 @@ module VMC
|
|
373
373
|
|
374
374
|
# TODO: probably won't have this in final version
|
375
375
|
apps = r.apps.collect { |a| c(a.name, :name) }
|
376
|
-
app_list = apps.empty? ?
|
376
|
+
app_list = apps.empty? ? d("none") : apps.join(", ")
|
377
377
|
line "apps: #{app_list}"
|
378
378
|
end
|
379
379
|
end
|
@@ -413,7 +413,7 @@ module VMC
|
|
413
413
|
|
414
414
|
# TODO: probably won't show this in final version; just for show
|
415
415
|
apps = f.apps.collect { |a| c(a.name, :name) }
|
416
|
-
line "apps: #{apps.empty? ?
|
416
|
+
line "apps: #{apps.empty? ? d("none") : apps.join(", ")}"
|
417
417
|
end
|
418
418
|
end
|
419
419
|
end
|
data/vmc-ng/lib/vmc/version.rb
CHANGED
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:
|
4
|
+
hash: 62196439
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 0.4.0.beta.
|
11
|
+
- 26
|
12
|
+
version: 0.4.0.beta.26
|
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-07-
|
20
|
+
date: 2012-07-26 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: json_pure
|
@@ -233,12 +233,12 @@ dependencies:
|
|
233
233
|
requirements:
|
234
234
|
- - ~>
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
hash:
|
236
|
+
hash: 3
|
237
237
|
segments:
|
238
238
|
- 0
|
239
239
|
- 4
|
240
|
-
-
|
241
|
-
version: 0.4.
|
240
|
+
- 6
|
241
|
+
version: 0.4.6
|
242
242
|
type: :runtime
|
243
243
|
version_requirements: *id013
|
244
244
|
- !ruby/object:Gem::Dependency
|
@@ -265,12 +265,12 @@ dependencies:
|
|
265
265
|
requirements:
|
266
266
|
- - ~>
|
267
267
|
- !ruby/object:Gem::Version
|
268
|
-
hash:
|
268
|
+
hash: 7
|
269
269
|
segments:
|
270
270
|
- 0
|
271
271
|
- 0
|
272
|
-
-
|
273
|
-
version: 0.0.
|
272
|
+
- 12
|
273
|
+
version: 0.0.12
|
274
274
|
type: :runtime
|
275
275
|
version_requirements: *id015
|
276
276
|
- !ruby/object:Gem::Dependency
|
@@ -373,6 +373,7 @@ files:
|
|
373
373
|
- vmc-ng/lib/vmc/cli/app.rb
|
374
374
|
- vmc-ng/lib/vmc/cli/help.rb
|
375
375
|
- vmc-ng/lib/vmc/cli/interactive.rb
|
376
|
+
- vmc-ng/lib/vmc/cli/organization.rb
|
376
377
|
- vmc-ng/lib/vmc/cli/service.rb
|
377
378
|
- vmc-ng/lib/vmc/cli/space.rb
|
378
379
|
- vmc-ng/lib/vmc/cli/start.rb
|