vmc 0.4.0.beta.25 → 0.4.0.beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/vmc-ng/lib/vmc.rb CHANGED
@@ -6,3 +6,4 @@ require "vmc/cli/app"
6
6
  require "vmc/cli/service"
7
7
  require "vmc/cli/user"
8
8
  require "vmc/cli/space"
9
+ require "vmc/cli/organization"
@@ -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 " #{c(IS_UTF8 ? "\xc3\x97" : "x", :dim)} #{b(a.total_instances)}"
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
@@ -7,6 +7,7 @@ Mothership::Help.groups(
7
7
  [:info, "Information"]],
8
8
  [:services, "Services",
9
9
  [:manage, "Management"]],
10
+ [:organizations, "Organizations"],
10
11
  [:spaces, "Spaces"],
11
12
  [:admin, "Administration",
12
13
  [:user, "User Management"]])
@@ -46,7 +46,7 @@ module VMC
46
46
  print c("> ", :prompt)
47
47
 
48
48
  unless value.empty?
49
- print "#{c(value, :default) + "\b" * value.size}"
49
+ print "#{d(value) + "\b" * value.size}"
50
50
  end
51
51
  end
52
52
 
@@ -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
@@ -25,32 +25,40 @@ module VMC
25
25
  def space(input)
26
26
  space = input[:space]
27
27
 
28
- line "name: #{c(space.name, :name)}"
29
- line "organization: #{c(space.organization.name, :name)}"
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
- if input[:full]
32
- line
33
- line "apps:"
38
+ if input[:full]
39
+ line
40
+ line "apps:"
34
41
 
35
- spaced(space.apps(2)) do |a|
36
- indented do
37
- invoke :app, :app => a
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
- if input[:full]
45
- line
46
- line "services:"
47
- spaced(space.service_instances(2)) do |i|
48
- indented do
49
- invoke :service, :instance => i
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
- c("none", :dim)
69
+ d("none")
62
70
  else
63
71
  xs.collect { |x| c(x.name, :name) }.join(", ")
64
72
  end
@@ -87,7 +87,7 @@ module VMC
87
87
 
88
88
  indented do
89
89
  if runtimes.empty? && !quiet?
90
- line "#{c("none", :dim)}"
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 "#{c("none", :dim)}"
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 "#{c("none", :dim)}"
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? ? c("none", :dim) : apps.join(", ")
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? ? c("none", :dim) : apps.join(", ")}"
416
+ line "apps: #{apps.empty? ? d("none") : apps.join(", ")}"
417
417
  end
418
418
  end
419
419
  end
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.4.0.beta.25"
2
+ VERSION = "0.4.0.beta.26"
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: 62196433
4
+ hash: 62196439
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 0
10
10
  - beta
11
- - 25
12
- version: 0.4.0.beta.25
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-25 00:00:00 Z
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: 5
236
+ hash: 3
237
237
  segments:
238
238
  - 0
239
239
  - 4
240
- - 5
241
- version: 0.4.5
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: 9
268
+ hash: 7
269
269
  segments:
270
270
  - 0
271
271
  - 0
272
- - 11
273
- version: 0.0.11
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