cf 4.1.0rc1 → 4.1.0rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,59 +15,89 @@ module CF::Service
15
15
  input :app, :desc => "Limit to application's service bindings",
16
16
  :from_given => by_name(:app)
17
17
  input :full, :desc => "Verbose output format", :default => false
18
+ input :marketplace, :desc => "List supported services", :default => false, :alias => "-m"
18
19
 
19
20
  def services
20
- msg =
21
- if space = input[:space]
22
- "Getting services in #{c(space.name, :name)}"
23
- else
24
- "Getting services"
25
- end
21
+ return show_marketplace if input[:marketplace]
22
+
23
+ set_services
24
+ return show_full if input[:full]
25
+ return show_services_table
26
+ end
27
+
28
+ private
26
29
 
27
- services =
28
- with_progress(msg) do
30
+ def set_services
31
+ @services =
32
+ with_progress(services_msg) do
29
33
  client.service_instances(:depth => 2)
30
34
  end
31
35
 
32
36
  line unless quiet?
33
37
 
34
- if services.empty? and !quiet?
38
+ if @services.empty? and !quiet?
35
39
  line "No services."
36
40
  return
37
41
  end
38
42
 
39
- services.reject! do |i|
43
+ @services.reject! do |i|
40
44
  !service_matches(i, input)
41
45
  end
46
+ end
42
47
 
43
- if input[:full]
44
- spaced(services) do |s|
45
- invoke :service, :service => s
46
- end
47
- else
48
- table(
49
- ["name", "service", "provider", "version", "plan", "bound apps"],
50
- services.collect { |i|
51
- plan = i.service_plan
52
- service = plan.service
53
-
54
- label = service.label
55
- version = service.version
56
- apps = name_list(i.service_bindings.collect(&:app))
57
- provider = service.provider
58
-
59
- [ c(i.name, :name),
60
- label,
61
- provider,
62
- version,
63
- plan.name,
64
- apps
65
- ]
66
- })
48
+ def show_marketplace
49
+ services = with_progress("Getting services") { client.services }
50
+
51
+ line unless quiet?
52
+
53
+ table(
54
+ ["service", "version", "provider", "plans", "description"],
55
+ services.sort_by(&:label).collect { |s|
56
+ [c(s.label, :name),
57
+ s.version,
58
+ s.provider,
59
+ s.service_plans.collect(&:name).join(", "),
60
+ s.description
61
+ ]
62
+ })
63
+ end
64
+
65
+ def show_full
66
+ spaced(@services) do |s|
67
+ invoke :service, :service => s
67
68
  end
68
69
  end
69
70
 
70
- private
71
+ def show_services_table
72
+ table(
73
+ ["name", "service", "provider", "version", "plan", "bound apps"],
74
+ @services.collect { |i|
75
+ plan = i.service_plan
76
+ service = plan.service
77
+
78
+ label = service.label
79
+ version = service.version
80
+ apps = name_list(i.service_bindings.collect(&:app))
81
+ provider = service.provider
82
+
83
+ [ c(i.name, :name),
84
+ label,
85
+ provider,
86
+ version,
87
+ plan.name,
88
+ apps
89
+ ]
90
+ })
91
+
92
+ end
93
+
94
+ def services_msg
95
+ if space = input[:space]
96
+ "Getting services in #{c(space.name, :name)}"
97
+ else
98
+ "Getting services"
99
+ end
100
+ end
71
101
 
72
102
  def service_matches(i, options)
73
103
  if app = options[:app]
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "4.1.0rc1".freeze
2
+ VERSION = "4.1.0rc2".freeze
3
3
  end
@@ -0,0 +1,72 @@
1
+ require "spec_helper"
2
+
3
+ module CF
4
+ module App
5
+ describe Events do
6
+ let(:global) { {} }
7
+ let(:given) { {} }
8
+ let(:inputs) { {:app => apps[0]} }
9
+ let(:apps) { [build(:app)] }
10
+
11
+ before do
12
+ inputs[:app].stub(:events) do
13
+ [double("AppEvent", {
14
+ :instance_guid => "some_guid",
15
+ :instance_index => 1,
16
+ :exit_status => -1,
17
+ :exit_description => "Something very interesting",
18
+ :timestamp => "2013-05-15 18:52:17 +0000" }),
19
+ double("AppEvent", {
20
+ :instance_guid => "some_other_guid",
21
+ :instance_index => 0,
22
+ :exit_status => 0,
23
+ :exit_description => "Something less interesting",
24
+ :timestamp => "2013-05-15 18:52:15 +0000" })]
25
+ end
26
+ end
27
+
28
+ subject do
29
+ capture_output { Mothership.new.invoke(:events, inputs, given, global) }
30
+ end
31
+
32
+ describe "metadata" do
33
+ let(:command) { Mothership.commands[:events] }
34
+
35
+ describe "command" do
36
+ subject { command }
37
+ its(:description) { should eq "Display application events" }
38
+ it { expect(Mothership::Help.group(:apps, :info)).to include(subject) }
39
+ end
40
+
41
+ include_examples "inputs must have descriptions"
42
+
43
+ describe "arguments" do
44
+ subject { command.arguments }
45
+ it "has arguments that are not needed with a manifest" do
46
+ should eq([:name => :app, :type => :optional, :value => nil])
47
+ end
48
+ end
49
+ end
50
+
51
+ it "prints out progress" do
52
+ subject
53
+ stdout.rewind
54
+ expect(stdout.readlines.first).to match /Getting events for #{apps.first.name}/
55
+ end
56
+
57
+ it "prints out headers" do
58
+ subject
59
+ stdout.rewind
60
+ expect(stdout.readlines[2]).to match /time\s+instance\s+index\s+description\s+exit\s+status/
61
+ end
62
+
63
+ it "prints out the events in order" do
64
+ subject
65
+ stdout.rewind
66
+ expect(stdout.readlines[3]).to match /.*2013-05-15 18:52:15 \+0000\s+0\s+Something less interesting\s+Success \(0\).*/
67
+ stdout.rewind
68
+ expect(stdout.readlines[4]).to match /.*2013-05-15 18:52:17 \+0000\s+1\s+Something very interesting\s+Failure \(-1\).*/
69
+ end
70
+ end
71
+ end
72
+ end
@@ -24,7 +24,7 @@ module CF
24
24
  describe "inputs" do
25
25
  subject { command.inputs }
26
26
  it "has the expected inputs" do
27
- subject.keys.should =~ [:name, :service, :plan, :provider, :version, :app, :full, :space]
27
+ subject.keys.should =~ [:name, :service, :marketplace, :plan, :provider, :version, :app, :full, :space]
28
28
  end
29
29
  end
30
30
  end
@@ -73,6 +73,15 @@ module CF
73
73
  /x
74
74
 
75
75
  end
76
+
77
+ context 'when given --marketplace argument' do
78
+ it 'lists services on the target' do
79
+ client.stub(:services => Array.new(3) { build(:service) })
80
+ cf %W[services --marketplace]
81
+ expect(output).to say("Getting services... OK")
82
+ expect(output).to say(/service\s+version\s+provider\s+plans\s+description/)
83
+ end
84
+ end
76
85
  end
77
86
  end
78
87
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0rc1
4
+ version: 4.1.0rc2
5
+ prerelease: 5
5
6
  platform: ruby
6
7
  authors:
7
8
  - Cloud Foundry Team
@@ -9,11 +10,12 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-07-01 00:00:00.000000000 Z
13
+ date: 2013-07-02 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: addressable
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ~>
19
21
  - !ruby/object:Gem::Version
@@ -21,6 +23,7 @@ dependencies:
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ~>
26
29
  - !ruby/object:Gem::Version
@@ -28,6 +31,7 @@ dependencies:
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: caldecott-client
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
36
  - - ~>
33
37
  - !ruby/object:Gem::Version
@@ -35,6 +39,7 @@ dependencies:
35
39
  type: :runtime
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
44
  - - ~>
40
45
  - !ruby/object:Gem::Version
@@ -42,6 +47,7 @@ dependencies:
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: cfoundry
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
52
  - - ! '>='
47
53
  - !ruby/object:Gem::Version
@@ -52,6 +58,7 @@ dependencies:
52
58
  type: :runtime
53
59
  prerelease: false
54
60
  version_requirements: !ruby/object:Gem::Requirement
61
+ none: false
55
62
  requirements:
56
63
  - - ! '>='
57
64
  - !ruby/object:Gem::Version
@@ -62,6 +69,7 @@ dependencies:
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: interact
64
71
  requirement: !ruby/object:Gem::Requirement
72
+ none: false
65
73
  requirements:
66
74
  - - ~>
67
75
  - !ruby/object:Gem::Version
@@ -69,6 +77,7 @@ dependencies:
69
77
  type: :runtime
70
78
  prerelease: false
71
79
  version_requirements: !ruby/object:Gem::Requirement
80
+ none: false
72
81
  requirements:
73
82
  - - ~>
74
83
  - !ruby/object:Gem::Version
@@ -76,6 +85,7 @@ dependencies:
76
85
  - !ruby/object:Gem::Dependency
77
86
  name: json_pure
78
87
  requirement: !ruby/object:Gem::Requirement
88
+ none: false
79
89
  requirements:
80
90
  - - ~>
81
91
  - !ruby/object:Gem::Version
@@ -83,6 +93,7 @@ dependencies:
83
93
  type: :runtime
84
94
  prerelease: false
85
95
  version_requirements: !ruby/object:Gem::Requirement
96
+ none: false
86
97
  requirements:
87
98
  - - ~>
88
99
  - !ruby/object:Gem::Version
@@ -90,6 +101,7 @@ dependencies:
90
101
  - !ruby/object:Gem::Dependency
91
102
  name: mothership
92
103
  requirement: !ruby/object:Gem::Requirement
104
+ none: false
93
105
  requirements:
94
106
  - - ! '>='
95
107
  - !ruby/object:Gem::Version
@@ -100,6 +112,7 @@ dependencies:
100
112
  type: :runtime
101
113
  prerelease: false
102
114
  version_requirements: !ruby/object:Gem::Requirement
115
+ none: false
103
116
  requirements:
104
117
  - - ! '>='
105
118
  - !ruby/object:Gem::Version
@@ -110,6 +123,7 @@ dependencies:
110
123
  - !ruby/object:Gem::Dependency
111
124
  name: multi_json
112
125
  requirement: !ruby/object:Gem::Requirement
126
+ none: false
113
127
  requirements:
114
128
  - - ~>
115
129
  - !ruby/object:Gem::Version
@@ -117,6 +131,7 @@ dependencies:
117
131
  type: :runtime
118
132
  prerelease: false
119
133
  version_requirements: !ruby/object:Gem::Requirement
134
+ none: false
120
135
  requirements:
121
136
  - - ~>
122
137
  - !ruby/object:Gem::Version
@@ -124,6 +139,7 @@ dependencies:
124
139
  - !ruby/object:Gem::Dependency
125
140
  name: rest-client
126
141
  requirement: !ruby/object:Gem::Requirement
142
+ none: false
127
143
  requirements:
128
144
  - - ~>
129
145
  - !ruby/object:Gem::Version
@@ -131,6 +147,7 @@ dependencies:
131
147
  type: :runtime
132
148
  prerelease: false
133
149
  version_requirements: !ruby/object:Gem::Requirement
150
+ none: false
134
151
  requirements:
135
152
  - - ~>
136
153
  - !ruby/object:Gem::Version
@@ -138,6 +155,7 @@ dependencies:
138
155
  - !ruby/object:Gem::Dependency
139
156
  name: uuidtools
140
157
  requirement: !ruby/object:Gem::Requirement
158
+ none: false
141
159
  requirements:
142
160
  - - ~>
143
161
  - !ruby/object:Gem::Version
@@ -145,6 +163,7 @@ dependencies:
145
163
  type: :runtime
146
164
  prerelease: false
147
165
  version_requirements: !ruby/object:Gem::Requirement
166
+ none: false
148
167
  requirements:
149
168
  - - ~>
150
169
  - !ruby/object:Gem::Version
@@ -152,6 +171,7 @@ dependencies:
152
171
  - !ruby/object:Gem::Dependency
153
172
  name: anchorman
154
173
  requirement: !ruby/object:Gem::Requirement
174
+ none: false
155
175
  requirements:
156
176
  - - ! '>='
157
177
  - !ruby/object:Gem::Version
@@ -159,6 +179,7 @@ dependencies:
159
179
  type: :development
160
180
  prerelease: false
161
181
  version_requirements: !ruby/object:Gem::Requirement
182
+ none: false
162
183
  requirements:
163
184
  - - ! '>='
164
185
  - !ruby/object:Gem::Version
@@ -166,6 +187,7 @@ dependencies:
166
187
  - !ruby/object:Gem::Dependency
167
188
  name: blue-shell
168
189
  requirement: !ruby/object:Gem::Requirement
190
+ none: false
169
191
  requirements:
170
192
  - - ! '>='
171
193
  - !ruby/object:Gem::Version
@@ -173,6 +195,7 @@ dependencies:
173
195
  type: :development
174
196
  prerelease: false
175
197
  version_requirements: !ruby/object:Gem::Requirement
198
+ none: false
176
199
  requirements:
177
200
  - - ! '>='
178
201
  - !ruby/object:Gem::Version
@@ -180,6 +203,7 @@ dependencies:
180
203
  - !ruby/object:Gem::Dependency
181
204
  name: factory_girl
182
205
  requirement: !ruby/object:Gem::Requirement
206
+ none: false
183
207
  requirements:
184
208
  - - ! '>='
185
209
  - !ruby/object:Gem::Version
@@ -187,6 +211,7 @@ dependencies:
187
211
  type: :development
188
212
  prerelease: false
189
213
  version_requirements: !ruby/object:Gem::Requirement
214
+ none: false
190
215
  requirements:
191
216
  - - ! '>='
192
217
  - !ruby/object:Gem::Version
@@ -194,6 +219,7 @@ dependencies:
194
219
  - !ruby/object:Gem::Dependency
195
220
  name: fakefs
196
221
  requirement: !ruby/object:Gem::Requirement
222
+ none: false
197
223
  requirements:
198
224
  - - ~>
199
225
  - !ruby/object:Gem::Version
@@ -201,6 +227,7 @@ dependencies:
201
227
  type: :development
202
228
  prerelease: false
203
229
  version_requirements: !ruby/object:Gem::Requirement
230
+ none: false
204
231
  requirements:
205
232
  - - ~>
206
233
  - !ruby/object:Gem::Version
@@ -208,6 +235,7 @@ dependencies:
208
235
  - !ruby/object:Gem::Dependency
209
236
  name: ffaker
210
237
  requirement: !ruby/object:Gem::Requirement
238
+ none: false
211
239
  requirements:
212
240
  - - '='
213
241
  - !ruby/object:Gem::Version
@@ -215,6 +243,7 @@ dependencies:
215
243
  type: :development
216
244
  prerelease: false
217
245
  version_requirements: !ruby/object:Gem::Requirement
246
+ none: false
218
247
  requirements:
219
248
  - - '='
220
249
  - !ruby/object:Gem::Version
@@ -222,6 +251,7 @@ dependencies:
222
251
  - !ruby/object:Gem::Dependency
223
252
  name: gem-release
224
253
  requirement: !ruby/object:Gem::Requirement
254
+ none: false
225
255
  requirements:
226
256
  - - ! '>='
227
257
  - !ruby/object:Gem::Version
@@ -229,6 +259,7 @@ dependencies:
229
259
  type: :development
230
260
  prerelease: false
231
261
  version_requirements: !ruby/object:Gem::Requirement
262
+ none: false
232
263
  requirements:
233
264
  - - ! '>='
234
265
  - !ruby/object:Gem::Version
@@ -236,6 +267,7 @@ dependencies:
236
267
  - !ruby/object:Gem::Dependency
237
268
  name: rake
238
269
  requirement: !ruby/object:Gem::Requirement
270
+ none: false
239
271
  requirements:
240
272
  - - ~>
241
273
  - !ruby/object:Gem::Version
@@ -243,6 +275,7 @@ dependencies:
243
275
  type: :development
244
276
  prerelease: false
245
277
  version_requirements: !ruby/object:Gem::Requirement
278
+ none: false
246
279
  requirements:
247
280
  - - ~>
248
281
  - !ruby/object:Gem::Version
@@ -250,6 +283,7 @@ dependencies:
250
283
  - !ruby/object:Gem::Dependency
251
284
  name: rspec
252
285
  requirement: !ruby/object:Gem::Requirement
286
+ none: false
253
287
  requirements:
254
288
  - - ~>
255
289
  - !ruby/object:Gem::Version
@@ -257,6 +291,7 @@ dependencies:
257
291
  type: :development
258
292
  prerelease: false
259
293
  version_requirements: !ruby/object:Gem::Requirement
294
+ none: false
260
295
  requirements:
261
296
  - - ~>
262
297
  - !ruby/object:Gem::Version
@@ -264,6 +299,7 @@ dependencies:
264
299
  - !ruby/object:Gem::Dependency
265
300
  name: rspec-instafail
266
301
  requirement: !ruby/object:Gem::Requirement
302
+ none: false
267
303
  requirements:
268
304
  - - ~>
269
305
  - !ruby/object:Gem::Version
@@ -271,6 +307,7 @@ dependencies:
271
307
  type: :development
272
308
  prerelease: false
273
309
  version_requirements: !ruby/object:Gem::Requirement
310
+ none: false
274
311
  requirements:
275
312
  - - ~>
276
313
  - !ruby/object:Gem::Version
@@ -278,6 +315,7 @@ dependencies:
278
315
  - !ruby/object:Gem::Dependency
279
316
  name: webmock
280
317
  requirement: !ruby/object:Gem::Requirement
318
+ none: false
281
319
  requirements:
282
320
  - - ~>
283
321
  - !ruby/object:Gem::Version
@@ -285,6 +323,7 @@ dependencies:
285
323
  type: :development
286
324
  prerelease: false
287
325
  version_requirements: !ruby/object:Gem::Requirement
326
+ none: false
288
327
  requirements:
289
328
  - - ~>
290
329
  - !ruby/object:Gem::Version
@@ -474,6 +513,7 @@ files:
474
513
  - spec/cf/cli/app/delete_spec.rb
475
514
  - spec/cf/cli/app/events_spec.rb
476
515
  - spec/cf/cli/app/help_spec.rb
516
+ - spec/cf/cli/app/help_spec.rb~
477
517
  - spec/cf/cli/app/instances_spec.rb
478
518
  - spec/cf/cli/app/push/create_spec.rb
479
519
  - spec/cf/cli/app/push/interactions_spec.rb
@@ -567,26 +607,27 @@ files:
567
607
  - bin/cf
568
608
  homepage: http://github.com/cloudfoundry/cf
569
609
  licenses: []
570
- metadata: {}
571
610
  post_install_message:
572
611
  rdoc_options: []
573
612
  require_paths:
574
613
  - lib
575
614
  required_ruby_version: !ruby/object:Gem::Requirement
615
+ none: false
576
616
  requirements:
577
617
  - - ! '>='
578
618
  - !ruby/object:Gem::Version
579
619
  version: '0'
580
620
  required_rubygems_version: !ruby/object:Gem::Requirement
621
+ none: false
581
622
  requirements:
582
623
  - - ! '>'
583
624
  - !ruby/object:Gem::Version
584
625
  version: 1.3.1
585
626
  requirements: []
586
627
  rubyforge_project: cf
587
- rubygems_version: 2.0.3
628
+ rubygems_version: 1.8.24
588
629
  signing_key:
589
- specification_version: 4
630
+ specification_version: 3
590
631
  summary: Friendly command-line interface for Cloud Foundry.
591
632
  test_files:
592
633
  - spec/admin/curl_spec.rb
@@ -649,6 +690,7 @@ test_files:
649
690
  - spec/cf/cli/app/delete_spec.rb
650
691
  - spec/cf/cli/app/events_spec.rb
651
692
  - spec/cf/cli/app/help_spec.rb
693
+ - spec/cf/cli/app/help_spec.rb~
652
694
  - spec/cf/cli/app/instances_spec.rb
653
695
  - spec/cf/cli/app/push/create_spec.rb
654
696
  - spec/cf/cli/app/push/interactions_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 3f7db873a3433f6a41a5b6b2373560e6638651e2
4
- data.tar.gz: ee5511a3f2188b76047fe98e7d5b40de804e36da
5
- SHA512:
6
- metadata.gz: e587cae8a1feef4fc85c5ab0f691449d692376c5c16ebe587a75afa3cdd4deed45227cdda180947d7103d431dd35eb068ac8e3ceaa4891d3e5222be6cac61a56
7
- data.tar.gz: 1f6e73117e955a892551126c3c52069a9856e8d5aa2ce2e122fc061d6cc66d6f2bd65d253956671f6780cb898c347e2ca1a90289021df2453b59805130ccd60f