cf 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -102,10 +102,31 @@ module CF
102
102
  end
103
103
 
104
104
  desc "delete [APP]", "Delete an application"
105
- flag(:really) { |name|
106
- force? || ask("Really delete #{c(name, :blue)}?", :default => false)
105
+ flag(:really) { |name, color = :blue|
106
+ force? || ask("Really delete #{c(name, color)}?", :default => false)
107
107
  }
108
- def delete(name)
108
+ flag(:name) { |names|
109
+ ask("Delete which application?", :choices => names)
110
+ }
111
+ flag(:all, :default => false)
112
+ def delete(name = nil)
113
+ if input(:all)
114
+ return unless input(:really, "ALL APPS", :red)
115
+
116
+ with_progress("Deleting all applications") do
117
+ client.apps.collect(&:delete!)
118
+ end
119
+
120
+ return
121
+ end
122
+
123
+ unless name
124
+ apps = client.apps
125
+ return err "No applications." if apps.empty?
126
+
127
+ name = input(:name, apps.collect(&:name))
128
+ end
129
+
109
130
  return unless input(:really, name)
110
131
 
111
132
  with_progress("Deleting #{c(name, :blue)}") do
@@ -3,11 +3,32 @@ require "cf/cli/command"
3
3
  module CF
4
4
  class Service < Command
5
5
  desc "delete", "Delete a service"
6
+ flag(:really) { |name, color = :blue|
7
+ force? || ask("Really delete #{c(name, color)}?", :default => false)
8
+ }
6
9
  flag(:name) { |choices|
7
10
  ask "Delete which service?", :choices => choices
8
11
  }
12
+ flag(:all, :default => false)
9
13
  def delete(name = nil)
10
- name ||= input(:name, client.services.collect(&:name))
14
+ if input(:all)
15
+ return unless input(:really, "ALL SERVICES", :red)
16
+
17
+ with_progress("Deleting all services") do
18
+ client.services.collect(&:delete!)
19
+ end
20
+
21
+ return
22
+ end
23
+
24
+ unless name
25
+ services = client.services
26
+ return err "No services." if services.empty?
27
+
28
+ name = input(:name, services.collect(&:name))
29
+ end
30
+
31
+ return unless input(:really, name)
11
32
 
12
33
  with_progress("Deleting #{c(name, :blue)}") do
13
34
  client.service(name).delete!
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,112 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cf
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Alex Suraci
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-05-02 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-05-10 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: json_pure
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70246690204160 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 1
31
- - 6
32
- - 5
20
+ - !ruby/object:Gem::Version
33
21
  version: 1.6.5
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: interact
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70246690204160
25
+ - !ruby/object:Gem::Dependency
26
+ name: interact
27
+ requirement: &70246690197700 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
29
+ requirements:
42
30
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 13
45
- segments:
46
- - 0
47
- - 4
48
- - 1
31
+ - !ruby/object:Gem::Version
49
32
  version: 0.4.1
50
33
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: cfoundry
54
34
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70246690197700
36
+ - !ruby/object:Gem::Dependency
37
+ name: cfoundry
38
+ requirement: &70246690196980 !ruby/object:Gem::Requirement
56
39
  none: false
57
- requirements:
40
+ requirements:
58
41
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 27
61
- segments:
62
- - 0
63
- - 1
64
- - 0
42
+ - !ruby/object:Gem::Version
65
43
  version: 0.1.0
66
44
  type: :runtime
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: thor
70
45
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70246690196980
47
+ - !ruby/object:Gem::Dependency
48
+ name: thor
49
+ requirement: &70246690195320 !ruby/object:Gem::Requirement
72
50
  none: false
73
- requirements:
51
+ requirements:
74
52
  - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 43
77
- segments:
78
- - 0
79
- - 14
80
- - 6
53
+ - !ruby/object:Gem::Version
81
54
  version: 0.14.6
82
55
  type: :runtime
83
- version_requirements: *id004
84
- - !ruby/object:Gem::Dependency
85
- name: manifests-vmc-plugin
86
56
  prerelease: false
87
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70246690195320
58
+ - !ruby/object:Gem::Dependency
59
+ name: manifests-vmc-plugin
60
+ requirement: &70246690194340 !ruby/object:Gem::Requirement
88
61
  none: false
89
- requirements:
62
+ requirements:
90
63
  - - ~>
91
- - !ruby/object:Gem::Version
92
- hash: 27
93
- segments:
94
- - 0
95
- - 1
96
- - 0
64
+ - !ruby/object:Gem::Version
97
65
  version: 0.1.0
98
66
  type: :runtime
99
- version_requirements: *id005
67
+ prerelease: false
68
+ version_requirements: *70246690194340
100
69
  description:
101
- email:
70
+ email:
102
71
  - asuraci@vmware.com
103
- executables:
72
+ executables:
104
73
  - cf
105
74
  extensions: []
106
-
107
75
  extra_rdoc_files: []
108
-
109
- files:
76
+ files:
110
77
  - LICENSE
111
78
  - Rakefile
112
79
  - lib/cf/cli/app.rb
@@ -123,36 +90,26 @@ files:
123
90
  - bin/cf
124
91
  homepage: http://cloudfoundry.com/
125
92
  licenses: []
126
-
127
93
  post_install_message:
128
94
  rdoc_options: []
129
-
130
- require_paths:
95
+ require_paths:
131
96
  - lib
132
- required_ruby_version: !ruby/object:Gem::Requirement
97
+ required_ruby_version: !ruby/object:Gem::Requirement
133
98
  none: false
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- hash: 3
138
- segments:
139
- - 0
140
- version: "0"
141
- required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
104
  none: false
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- hash: 3
147
- segments:
148
- - 0
149
- version: "0"
105
+ requirements:
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
150
109
  requirements: []
151
-
152
110
  rubyforge_project: cf
153
- rubygems_version: 1.8.23
111
+ rubygems_version: 1.8.10
154
112
  signing_key:
155
113
  specification_version: 3
156
114
  summary: Friendly command-line interface for Cloud Foundry.
157
115
  test_files: []
158
-