vmc 0.4.0.beta.24 → 0.4.0.beta.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,13 @@ module VMC
9
9
  }
10
10
  end
11
11
 
12
+ def self.find_by_name_insensitive(what)
13
+ proc { |name, choices|
14
+ choices.find { |c| c.name.upcase == name.upcase } ||
15
+ fail("Unknown #{what} '#{name}'")
16
+ }
17
+ end
18
+
12
19
  def self.by_name(what, obj = what)
13
20
  proc { |name, *_|
14
21
  client.send(:"#{obj}_by_name", name) ||
@@ -77,7 +84,7 @@ module VMC
77
84
  ask "Name?", :default => "#{service.label}-#{random}"
78
85
  }
79
86
  input(:plan, :desc => "Service plan",
80
- :from_given => find_by_name("plan")) { |plans|
87
+ :from_given => find_by_name_insensitive("plan")) { |plans|
81
88
  if d100 = plans.find { |p| p.name == "D100" }
82
89
  d100
83
90
  else
@@ -102,13 +109,13 @@ module VMC
102
109
  end
103
110
 
104
111
  if plan = input.given(:plan)
105
- services.reject! { |s|
112
+ services.reject! do |s|
106
113
  if plan.is_a?(String)
107
114
  s.service_plans.none? { |p| p.name == plan.upcase }
108
115
  else
109
116
  s.service_plans.include? plan
110
117
  end
111
- }
118
+ end
112
119
  end
113
120
 
114
121
  until services.size < 2
@@ -172,10 +172,13 @@ module VMC
172
172
  select_org_and_space(input, info)
173
173
 
174
174
  save_target_info(info)
175
- elsif !quiet?
176
- line
177
- display_org_and_space
178
175
  end
176
+
177
+ return if quiet?
178
+
179
+ line
180
+ display_target
181
+ display_org_and_space
179
182
  end
180
183
 
181
184
 
@@ -386,6 +389,15 @@ module VMC
386
389
  line "description: #{s.description}"
387
390
  line "version: #{s.version}"
388
391
  line "provider: #{s.provider}"
392
+
393
+ if v2?
394
+ line "plans:"
395
+ indented do
396
+ s.service_plans.sort_by(&:name).each do |p|
397
+ line "#{c(p.name, :name)}: #{p.description}"
398
+ end
399
+ end
400
+ end
389
401
  end
390
402
  end
391
403
  end
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.4.0.beta.24"
2
+ VERSION = "0.4.0.beta.25"
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: 62196435
4
+ hash: 62196433
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 0
10
10
  - beta
11
- - 24
12
- version: 0.4.0.beta.24
11
+ - 25
12
+ version: 0.4.0.beta.25
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-24 00:00:00 Z
20
+ date: 2012-07-25 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: json_pure
@@ -249,12 +249,12 @@ dependencies:
249
249
  requirements:
250
250
  - - ~>
251
251
  - !ruby/object:Gem::Version
252
- hash: 5
252
+ hash: 11
253
253
  segments:
254
254
  - 0
255
255
  - 3
256
- - 11
257
- version: 0.3.11
256
+ - 12
257
+ version: 0.3.12
258
258
  type: :runtime
259
259
  version_requirements: *id014
260
260
  - !ruby/object:Gem::Dependency