manifests-vmc-plugin 0.4.11 → 0.4.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ require "pathname"
2
+
1
3
  require "vmc/plugin"
2
4
  require "manifests-vmc-plugin"
3
5
 
@@ -5,6 +7,8 @@ require "manifests-vmc-plugin"
5
7
  class Manifests < VMC::CLI
6
8
  include VMCManifests
7
9
 
10
+ @@showed_manifest_usage = false
11
+
8
12
  option :manifest, :aliases => "-m", :value => :file,
9
13
  :desc => "Path to manifest file to use"
10
14
 
@@ -13,6 +17,15 @@ class Manifests < VMC::CLI
13
17
  fail "No applications or manifest to operate on."
14
18
  end
15
19
 
20
+ def show_manifest_usage
21
+ return if @@showed_manifest_usage
22
+
23
+ path = Pathname.new(manifest_file).relative_path_from(Pathname.pwd)
24
+ line "Using manifest file #{c(path, :name)}"
25
+ line
26
+
27
+ @@showed_manifest_usage = true
28
+ end
16
29
 
17
30
  # basic commands that, when given no name, act on the
18
31
  # app(s) described by the manifest, in dependency-order
@@ -32,6 +45,8 @@ class Manifests < VMC::CLI
32
45
  end
33
46
  end
34
47
 
48
+ show_manifest_usage
49
+
35
50
  num = 0
36
51
  rest =
37
52
  specific_apps_or_all(input) do |info|
@@ -58,6 +73,8 @@ class Manifests < VMC::CLI
58
73
  around(wrap) do |cmd, input|
59
74
  next cmd.call if input[:all] || !manifest
60
75
 
76
+ show_manifest_usage
77
+
61
78
  reversed = []
62
79
  rest =
63
80
  specific_apps_or_all(input) do |info|
@@ -108,6 +125,8 @@ class Manifests < VMC::CLI
108
125
  push.call
109
126
  end
110
127
  else
128
+ show_manifest_usage
129
+
111
130
  apps.each do |app|
112
131
  with_filters(
113
132
  :push => {
@@ -1,3 +1,3 @@
1
1
  module VMCManifests
2
- VERSION = "0.4.11"
2
+ VERSION = "0.4.12"
3
3
  end
@@ -22,23 +22,26 @@ module VMCManifests
22
22
 
23
23
  # find the manifest file to work with
24
24
  def manifest_file
25
- return input[:manifest] if input[:manifest]
26
25
  return @manifest_file if @manifest_file
27
26
 
28
- where = Dir.pwd
29
- while true
30
- if File.exists?(File.join(where, MANIFEST_FILE))
31
- @manifest_file = File.join(where, MANIFEST_FILE)
32
- break
33
- elsif File.basename(where) == "/"
34
- @manifest_file = nil
35
- break
36
- else
37
- where = File.expand_path("../", where)
27
+ unless path = input[:manifest]
28
+ where = Dir.pwd
29
+ while true
30
+ if File.exists?(File.join(where, MANIFEST_FILE))
31
+ path = File.join(where, MANIFEST_FILE)
32
+ break
33
+ elsif File.basename(where) == "/"
34
+ path = nil
35
+ break
36
+ else
37
+ where = File.expand_path("../", where)
38
+ end
38
39
  end
39
40
  end
40
41
 
41
- @manifest_file
42
+ return unless path
43
+
44
+ @manifest_file = File.expand_path(path)
42
45
  end
43
46
 
44
47
  # convert any deprecated structuring to the modern format
@@ -234,7 +237,7 @@ module VMCManifests
234
237
  path, info = app_by_name(path_or_name) || app_by_path(path_or_name)
235
238
  return unless info
236
239
 
237
- data = { :path => from_manifest(path) }
240
+ data = { :path => path }
238
241
 
239
242
  toplevel_attributes.merge(info).each do |k, v|
240
243
  name = k.to_sym
@@ -246,6 +249,8 @@ module VMCManifests
246
249
  data[name] = input && input.given(name) || v
247
250
  end
248
251
 
252
+ data[:path] = from_manifest(data[:path])
253
+
249
254
  data
250
255
  end
251
256
 
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: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 11
10
- version: 0.4.11
9
+ - 12
10
+ version: 0.4.12
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-11-02 00:00:00 Z
18
+ date: 2012-11-07 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: cfoundry