vmc 0.4.0.beta.28 → 0.4.0.beta.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,15 +25,13 @@ module VMC
25
25
 
26
26
  desc "List your service instances"
27
27
  group :services
28
- input :name, :desc => "Filter by name regexp"
29
- input :app, :desc => "Filter by bound application regexp"
30
- input :service, :desc => "Filter by service regexp"
28
+ input :name, :desc => "Filter by name"
29
+ input :service, :desc => "Filter by service type"
31
30
  input :plan, :desc => "Filter by service plan"
32
31
  input :provider, :desc => "Filter by service provider"
33
32
  input :version, :desc => "Filter by service version"
34
- # TODO: not in v2
35
- input :type, :desc => "Filter by service type regexp"
36
- input :tier, :desc => "Filter by service tier regexp"
33
+ input :app, :desc => "Limit to application's service bindings",
34
+ :from_given => by_name("app")
37
35
  def services(input)
38
36
  instances =
39
37
  with_progress("Getting service instances") do
@@ -271,37 +269,39 @@ module VMC
271
269
 
272
270
  def instance_matches(i, options)
273
271
  if app = options[:app]
274
- return false if i.service_bindings.none? { |b|
275
- b.app.name == app
276
- }
272
+ return false unless app.services.include? i
277
273
  end
278
274
 
279
275
  if name = options[:name]
280
- return false if i.name !~ /#{name}/
276
+ return false unless File.fnmatch(name, i.name)
281
277
  end
282
278
 
283
- if service = options[:service]
284
- return false if i.service_plan.service.label !~ /#{service}/
285
- end
279
+ plan = i.service_plan if v2?
286
280
 
287
- if !v2? && type = options[:type]
288
- return false if i.type !~ /#{type}/
289
- end
290
-
291
- if !v2? && tier = options[:tier]
292
- return false if i.tier !~ /#{tier}/
281
+ if service = options[:service]
282
+ if v2?
283
+ return false unless File.fnmatch(service, plan.service.label)
284
+ else
285
+ return false unless File.fnmatch(service, i.vendor)
286
+ end
293
287
  end
294
288
 
295
- if v2? && plan = options[:plan]
296
- return false if i.service_plan.name !~ /#{plan}/i
289
+ if plan = options[:plan]
290
+ fail "--plan is not supported on this target" unless v2?
291
+ return false unless File.fnmatch(plan.upcase, plan.name.upcase)
297
292
  end
298
293
 
299
- if v2? && provider = options[:provider]
300
- return false if i.service_plan.service.provider !~ /#{provider}/
294
+ if provider = options[:provider]
295
+ fail "--provider is not supported on this target" unless v2?
296
+ return false unless File.fnmatch(provider, plan.service.provider)
301
297
  end
302
298
 
303
- if v2? && version = options[:version]
304
- return false if i.service_plan.service.version !~ /#{version}/
299
+ if version = options[:version]
300
+ if v2?
301
+ return false unless File.fnmatch(version, plan.service.version)
302
+ else
303
+ return false unless File.fnmatch(version, i.version)
304
+ end
305
305
  end
306
306
 
307
307
  true
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.4.0.beta.28"
2
+ VERSION = "0.4.0.beta.29"
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: 62196443
4
+ hash: 62196441
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 0
10
10
  - beta
11
- - 28
12
- version: 0.4.0.beta.28
11
+ - 29
12
+ version: 0.4.0.beta.29
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-29 00:00:00 Z
20
+ date: 2012-07-30 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: 13
252
+ hash: 49
253
253
  segments:
254
254
  - 0
255
255
  - 3
256
- - 15
257
- version: 0.3.15
256
+ - 17
257
+ version: 0.3.17
258
258
  type: :runtime
259
259
  version_requirements: *id014
260
260
  - !ruby/object:Gem::Dependency