manifests-vmc-plugin 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -291,14 +291,6 @@ module VMCManifests
291
291
  []
292
292
  end
293
293
 
294
- unless manifest
295
- if names_or_paths.empty?
296
- return false
297
- else
298
- return names_or_paths
299
- end
300
- end
301
-
302
294
  if names_or_paths.empty?
303
295
  each_app(input, &blk)
304
296
  return []
@@ -309,10 +301,16 @@ module VMCManifests
309
301
  in_manifest = []
310
302
  external = []
311
303
  names_or_paths.each do |x|
312
- path = File.expand_path(x)
313
-
314
- if app = app_info(File.exists?(path) ? path : x, input)
315
- in_manifest << app
304
+ if x.is_a?(String)
305
+ path = File.expand_path(x)
306
+
307
+ if app = app_info(File.exists?(path) ? path : x, input)
308
+ in_manifest << app
309
+ elsif app = client.app_by_name(x)
310
+ external << app
311
+ else
312
+ fail("Unknown app '#{x}'")
313
+ end
316
314
  else
317
315
  external << x
318
316
  end
@@ -16,12 +16,20 @@ class Manifests < VMC::CLI
16
16
 
17
17
  # basic commands that, when given no name, act on the
18
18
  # app(s) described by the manifest, in dependency-order
19
- [ :start, :instances, :logs, :file, :files, :env,
20
- :health, :stats, :scale
19
+ [ :start, :restart, :instances, :logs, :file, :files, :env,
20
+ :health, :stats, :scale, :app
21
21
  ].each do |wrap|
22
22
  optional_name = change_argument(wrap, :app, :optional)
23
23
 
24
24
  around(wrap) do |cmd, input|
25
+ unless manifest
26
+ if optional_name && !input.given?(:app)
27
+ no_apps
28
+ else
29
+ next cmd.call
30
+ end
31
+ end
32
+
25
33
  num = 0
26
34
  rest =
27
35
  specific_apps_or_all(input) do |info|
@@ -32,7 +40,7 @@ class Manifests < VMC::CLI
32
40
 
33
41
  if rest
34
42
  rest.each do |name|
35
- cmd.call(input.without(:apps).merge_given(:app => name))
43
+ cmd.call(input.without(:apps).merge(:app => name))
36
44
  end
37
45
 
38
46
  # fail manually for commands whose name we made optional
@@ -46,7 +54,7 @@ class Manifests < VMC::CLI
46
54
  # same as above but in reverse dependency-order
47
55
  [:stop, :delete].each do |wrap|
48
56
  around(wrap) do |cmd, input|
49
- next cmd.call if input[:all]
57
+ next cmd.call if input[:all] || !manifest
50
58
 
51
59
  reversed = []
52
60
  rest =
@@ -58,12 +66,8 @@ class Manifests < VMC::CLI
58
66
  cmd.call(input.without(:apps).merge_given(:apps => reversed))
59
67
  end
60
68
 
61
- if rest
62
- unless rest.empty?
63
- cmd.call(input.without(:apps).merge_given(:apps => rest))
64
- end
65
- else
66
- cmd.call(input.without(:apps))
69
+ unless rest.empty?
70
+ cmd.call(input.without(:apps).merge(:apps => rest))
67
71
  end
68
72
  end
69
73
  end
@@ -1,3 +1,3 @@
1
1
  module VMCManifests
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manifests-vmc-plugin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Suraci
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-07-23 00:00:00 Z
18
+ date: 2012-07-24 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: cfoundry