cloudfoundry-client 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. data/.gitignore +12 -0
  2. data/.rspec +2 -0
  3. data/.travis.yml +12 -0
  4. data/.yardopts +9 -0
  5. data/CHANGELOG.md +6 -0
  6. data/Gemfile +3 -0
  7. data/LICENSE +20 -0
  8. data/README.md +122 -0
  9. data/Rakefile +28 -0
  10. data/cloudfoundry.gemspec +29 -0
  11. data/lib/cloudfoundry.rb +34 -0
  12. data/lib/cloudfoundry/client.rb +93 -0
  13. data/lib/cloudfoundry/client/apps.rb +192 -0
  14. data/lib/cloudfoundry/client/info.rb +29 -0
  15. data/lib/cloudfoundry/client/request.rb +89 -0
  16. data/lib/cloudfoundry/client/resources.rb +16 -0
  17. data/lib/cloudfoundry/client/response.rb +68 -0
  18. data/lib/cloudfoundry/client/services.rb +122 -0
  19. data/lib/cloudfoundry/client/users.rb +121 -0
  20. data/lib/cloudfoundry/constants.rb +30 -0
  21. data/lib/cloudfoundry/exception.rb +24 -0
  22. data/lib/cloudfoundry/version.rb +27 -0
  23. data/spec/client/apps_spec.rb +423 -0
  24. data/spec/client/info_spec.rb +92 -0
  25. data/spec/client/resources_spec.rb +52 -0
  26. data/spec/client/services_spec.rb +230 -0
  27. data/spec/client/users_spec.rb +367 -0
  28. data/spec/client_spec.rb +110 -0
  29. data/spec/cloudfoundry_spec.rb +62 -0
  30. data/spec/fixtures/admin_logged/client.yml +85 -0
  31. data/spec/fixtures/admin_logged/users.yml +363 -0
  32. data/spec/fixtures/admin_logged/users_create_action.yml +36 -0
  33. data/spec/fixtures/admin_logged/users_proxy_action.yml +46 -0
  34. data/spec/fixtures/admin_logged/users_proxy_nouser_action.yml +44 -0
  35. data/spec/fixtures/admin_logged/users_unproxy_action.yml +44 -0
  36. data/spec/fixtures/app.js +16 -0
  37. data/spec/fixtures/app.zip +0 -0
  38. data/spec/fixtures/client.yml +151 -0
  39. data/spec/fixtures/client_invalid.yml +85 -0
  40. data/spec/fixtures/cloudfoundry.yml +124 -0
  41. data/spec/fixtures/cloudfoundry_vs_client.yml +159 -0
  42. data/spec/fixtures/no_logged/apps.yml +42 -0
  43. data/spec/fixtures/no_logged/client.yml +42 -0
  44. data/spec/fixtures/no_logged/info.yml +81 -0
  45. data/spec/fixtures/no_logged/resources.yml +42 -0
  46. data/spec/fixtures/no_logged/services.yml +42 -0
  47. data/spec/fixtures/no_logged/users.yml +108 -0
  48. data/spec/fixtures/no_logged/users_login_action.yml +81 -0
  49. data/spec/fixtures/no_logged/users_proxy_action.yml +42 -0
  50. data/spec/fixtures/no_logged/users_unproxy_action.yml +42 -0
  51. data/spec/fixtures/user_logged/apps.yml +828 -0
  52. data/spec/fixtures/user_logged/apps_create_action.yml +42 -0
  53. data/spec/fixtures/user_logged/apps_directory_action.yml +48 -0
  54. data/spec/fixtures/user_logged/apps_download_action.yml +55 -0
  55. data/spec/fixtures/user_logged/apps_file_action.yml +54 -0
  56. data/spec/fixtures/user_logged/apps_start_action.yml +81 -0
  57. data/spec/fixtures/user_logged/apps_stats_action.yml +44 -0
  58. data/spec/fixtures/user_logged/apps_update_info_action.yml +44 -0
  59. data/spec/fixtures/user_logged/apps_upload_filename_action.yml +62 -0
  60. data/spec/fixtures/user_logged/apps_upload_zipfile_action.yml +62 -0
  61. data/spec/fixtures/user_logged/client.yml +85 -0
  62. data/spec/fixtures/user_logged/info.yml +126 -0
  63. data/spec/fixtures/user_logged/resources.yml +44 -0
  64. data/spec/fixtures/user_logged/resources_check_action.yml +42 -0
  65. data/spec/fixtures/user_logged/services.yml +354 -0
  66. data/spec/fixtures/user_logged/services_bind_action.yml +161 -0
  67. data/spec/fixtures/user_logged/services_create_action.yml +83 -0
  68. data/spec/fixtures/user_logged/services_unbind_action.yml +122 -0
  69. data/spec/fixtures/user_logged/services_unbind_fail_action.yml +122 -0
  70. data/spec/fixtures/user_logged/users.yml +299 -0
  71. data/spec/fixtures/user_logged/users_proxy_action.yml +44 -0
  72. data/spec/fixtures/user_logged/users_unproxy_action.yml +44 -0
  73. data/spec/spec_helper.rb +29 -0
  74. data/spec/support/cf_connection_helper.rb +26 -0
  75. data/spec/support/vcr.rb +8 -0
  76. metadata +235 -0
@@ -0,0 +1,299 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.vcap.me:80/users
6
+ body: "{\"email\":\"fakeuser2@vcap.me\",\"password\":\"foobar\"}"
7
+ headers:
8
+ User-Agent:
9
+ - cloudfoundry-client-0.1.0
10
+ Authorization:
11
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
12
+ Accept:
13
+ - application/json
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 204
19
+ message: No Content
20
+ headers:
21
+ Server:
22
+ - nginx/0.7.65
23
+ Date:
24
+ - Fri, 02 Dec 2011 01:09:50 GMT
25
+ Connection:
26
+ - keep-alive
27
+ Keep-Alive:
28
+ - timeout=20
29
+ Cache-Control:
30
+ - no-cache
31
+ X-Ua-Compatible:
32
+ - IE=Edge
33
+ body: ""
34
+ http_version:
35
+ recorded_at: Fri, 02 Dec 2011 01:09:49 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://api.vcap.me:80/users
39
+ body: ""
40
+ headers:
41
+ User-Agent:
42
+ - cloudfoundry-client-0.1.0
43
+ Authorization:
44
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
45
+ Accept:
46
+ - application/json
47
+ Content-Type:
48
+ - application/json
49
+ Accept-Encoding:
50
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
51
+ response:
52
+ status:
53
+ code: 403
54
+ message: Forbidden
55
+ headers:
56
+ Server:
57
+ - nginx/0.7.65
58
+ Date:
59
+ - Fri, 02 Dec 2011 01:09:50 GMT
60
+ Content-Type:
61
+ - application/json; charset=utf-8
62
+ Transfer-Encoding:
63
+ - chunked
64
+ Connection:
65
+ - keep-alive
66
+ Keep-Alive:
67
+ - timeout=20
68
+ Cache-Control:
69
+ - no-cache
70
+ X-Ua-Compatible:
71
+ - IE=Edge
72
+ body: "{\"code\":200,\"description\":\"Operation not permitted\"}"
73
+ http_version:
74
+ recorded_at: Fri, 02 Dec 2011 01:09:49 GMT
75
+ - request:
76
+ method: get
77
+ uri: http://api.vcap.me:80/users/fakeuser1@vcap.me
78
+ body: ""
79
+ headers:
80
+ User-Agent:
81
+ - cloudfoundry-client-0.1.0
82
+ Authorization:
83
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
84
+ Accept:
85
+ - application/json
86
+ Content-Type:
87
+ - application/json
88
+ Accept-Encoding:
89
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
90
+ response:
91
+ status:
92
+ code: 403
93
+ message: Forbidden
94
+ headers:
95
+ Server:
96
+ - nginx/0.7.65
97
+ Date:
98
+ - Fri, 02 Dec 2011 01:09:50 GMT
99
+ Content-Type:
100
+ - application/json; charset=utf-8
101
+ Transfer-Encoding:
102
+ - chunked
103
+ Connection:
104
+ - keep-alive
105
+ Keep-Alive:
106
+ - timeout=20
107
+ Cache-Control:
108
+ - no-cache
109
+ X-Ua-Compatible:
110
+ - IE=Edge
111
+ body: "{\"code\":200,\"description\":\"Operation not permitted\"}"
112
+ http_version:
113
+ recorded_at: Fri, 02 Dec 2011 01:09:49 GMT
114
+ - request:
115
+ method: get
116
+ uri: http://api.vcap.me:80/users/user@vcap.me
117
+ body: ""
118
+ headers:
119
+ User-Agent:
120
+ - cloudfoundry-client-0.1.0
121
+ Authorization:
122
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
123
+ Accept:
124
+ - application/json
125
+ Content-Type:
126
+ - application/json
127
+ Accept-Encoding:
128
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
129
+ response:
130
+ status:
131
+ code: 200
132
+ message: OK
133
+ headers:
134
+ Server:
135
+ - nginx/0.7.65
136
+ Date:
137
+ - Fri, 02 Dec 2011 01:09:50 GMT
138
+ Content-Type:
139
+ - application/json; charset=utf-8
140
+ Transfer-Encoding:
141
+ - chunked
142
+ Connection:
143
+ - keep-alive
144
+ Keep-Alive:
145
+ - timeout=20
146
+ Etag:
147
+ - "\"44fcb5134ebc72bf6edcfd4d2fca9f93\""
148
+ Cache-Control:
149
+ - max-age=0, private, must-revalidate
150
+ X-Ua-Compatible:
151
+ - IE=Edge
152
+ body: "{\"email\":\"user@vcap.me\"}"
153
+ http_version:
154
+ recorded_at: Fri, 02 Dec 2011 01:09:49 GMT
155
+ - request:
156
+ method: put
157
+ uri: http://api.vcap.me:80/users/user@vcap.me
158
+ body: "{\"email\":\"user@vcap.me\",\"password\":\"foobar\"}"
159
+ headers:
160
+ User-Agent:
161
+ - cloudfoundry-client-0.1.0
162
+ Authorization:
163
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
164
+ Accept:
165
+ - application/json
166
+ Content-Type:
167
+ - application/json
168
+ response:
169
+ status:
170
+ code: 204
171
+ message: No Content
172
+ headers:
173
+ Server:
174
+ - nginx/0.7.65
175
+ Date:
176
+ - Fri, 02 Dec 2011 01:09:51 GMT
177
+ Connection:
178
+ - keep-alive
179
+ Keep-Alive:
180
+ - timeout=20
181
+ Cache-Control:
182
+ - no-cache
183
+ X-Ua-Compatible:
184
+ - IE=Edge
185
+ body: ""
186
+ http_version:
187
+ recorded_at: Fri, 02 Dec 2011 01:09:49 GMT
188
+ - request:
189
+ method: delete
190
+ uri: http://api.vcap.me:80/users/fakeuser1@vcap.me
191
+ body: ""
192
+ headers:
193
+ User-Agent:
194
+ - cloudfoundry-client-0.1.0
195
+ Authorization:
196
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
197
+ Accept:
198
+ - "*/*"
199
+ response:
200
+ status:
201
+ code: 403
202
+ message: Forbidden
203
+ headers:
204
+ Server:
205
+ - nginx/0.7.65
206
+ Date:
207
+ - Fri, 02 Dec 2011 01:09:51 GMT
208
+ Content-Type:
209
+ - application/json; charset=utf-8
210
+ Transfer-Encoding:
211
+ - chunked
212
+ Connection:
213
+ - keep-alive
214
+ Keep-Alive:
215
+ - timeout=20
216
+ Cache-Control:
217
+ - no-cache
218
+ X-Ua-Compatible:
219
+ - IE=Edge
220
+ body: "{\"code\":200,\"description\":\"Operation not permitted\"}"
221
+ http_version:
222
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
223
+ - request:
224
+ method: delete
225
+ uri: http://api.vcap.me:80/users/user@vcap.me
226
+ body: ""
227
+ headers:
228
+ User-Agent:
229
+ - cloudfoundry-client-0.1.0
230
+ Authorization:
231
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
232
+ Accept:
233
+ - "*/*"
234
+ response:
235
+ status:
236
+ code: 403
237
+ message: Forbidden
238
+ headers:
239
+ Server:
240
+ - nginx/0.7.65
241
+ Date:
242
+ - Fri, 02 Dec 2011 01:09:51 GMT
243
+ Content-Type:
244
+ - application/json; charset=utf-8
245
+ Transfer-Encoding:
246
+ - chunked
247
+ Connection:
248
+ - keep-alive
249
+ Keep-Alive:
250
+ - timeout=20
251
+ Cache-Control:
252
+ - no-cache
253
+ X-Ua-Compatible:
254
+ - IE=Edge
255
+ body: "{\"code\":200,\"description\":\"Operation not permitted\"}"
256
+ http_version:
257
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
258
+ - request:
259
+ method: get
260
+ uri: http://api.vcap.me:80/info
261
+ body: ""
262
+ headers:
263
+ User-Agent:
264
+ - cloudfoundry-client-0.1.0
265
+ Authorization:
266
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
267
+ Accept:
268
+ - application/json
269
+ Content-Type:
270
+ - application/json
271
+ Accept-Encoding:
272
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
273
+ response:
274
+ status:
275
+ code: 200
276
+ message: OK
277
+ headers:
278
+ Server:
279
+ - nginx/0.7.65
280
+ Date:
281
+ - Fri, 02 Dec 2011 01:09:51 GMT
282
+ Content-Type:
283
+ - application/json; charset=utf-8
284
+ Transfer-Encoding:
285
+ - chunked
286
+ Connection:
287
+ - keep-alive
288
+ Keep-Alive:
289
+ - timeout=20
290
+ Etag:
291
+ - "\"adea3e8a7bd68a058b88fbec459e2022\""
292
+ Cache-Control:
293
+ - max-age=0, private, must-revalidate
294
+ X-Ua-Compatible:
295
+ - IE=Edge
296
+ body: "{\"name\":\"vcap\",\"build\":2222,\"support\":\"http://support.cloudfoundry.com\",\"version\":\"0.999\",\"description\":\"VMware's Cloud Application Platform\",\"allow_debug\":true,\"user\":\"user@vcap.me\",\"limits\":{\"memory\":2048,\"app_uris\":4,\"services\":16,\"apps\":20},\"usage\":{\"memory\":0,\"apps\":0,\"services\":0},\"frameworks\":{\"grails\":{\"name\":\"grails\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"spring\":{\"name\":\"spring\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"sinatra\":{\"name\":\"sinatra\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"*.rb\":\"require 'sinatra'|require \\\"sinatra\\\"\"},{\"config/environment.rb\":false}]},\"java_web\":{\"name\":\"java_web\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"php\":{\"name\":\"php\",\"runtimes\":[{\"name\":\"php\",\"version\":\"5.3\",\"description\":\"PHP 5\"}],\"appservers\":[{\"name\":\"apache\",\"description\":\"Apache\"}],\"detection\":[{\"*.php\":true}]},\"otp_rebar\":{\"name\":\"otp_rebar\",\"runtimes\":[{\"name\":\"erlangR14B02\",\"version\":\"R14B02\",\"description\":\"Erlang R14B02\"}],\"appservers\":[],\"detection\":[{\"releases/*/*.rel\":\".\"}]},\"lift\":{\"name\":\"lift\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"rails3\":{\"name\":\"rails3\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"config/application.rb\":true},{\"config/environment.rb\":true}]},\"django\":{\"name\":\"django\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]},\"node\":{\"name\":\"node\",\"runtimes\":[{\"name\":\"node\",\"version\":\"0.4.5\",\"description\":\"Node.js\"}],\"appservers\":[],\"detection\":[{\"*.js\":\".\"}]},\"wsgi\":{\"name\":\"wsgi\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]}}}"
297
+ http_version:
298
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
299
+ recorded_with: VCR 2.0.0.beta2
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.vcap.me:80/info
6
+ body: ""
7
+ headers:
8
+ User-Agent:
9
+ - cloudfoundry-client-0.1.0
10
+ Authorization:
11
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
12
+ Proxy-User:
13
+ - fakeuser1@vcap.me
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 403
23
+ message: Forbidden
24
+ headers:
25
+ Server:
26
+ - nginx/0.7.65
27
+ Date:
28
+ - Fri, 02 Dec 2011 01:09:51 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Keep-Alive:
36
+ - timeout=20
37
+ Cache-Control:
38
+ - no-cache
39
+ X-Ua-Compatible:
40
+ - IE=Edge
41
+ body: "{\"code\":200,\"description\":\"Operation not permitted\"}"
42
+ http_version:
43
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
44
+ recorded_with: VCR 2.0.0.beta2
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.vcap.me:80/info
6
+ body: ""
7
+ headers:
8
+ User-Agent:
9
+ - cloudfoundry-client-0.1.0
10
+ Authorization:
11
+ - 04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f
12
+ Accept:
13
+ - application/json
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx/0.7.65
25
+ Date:
26
+ - Fri, 02 Dec 2011 01:09:51 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Keep-Alive:
34
+ - timeout=20
35
+ Etag:
36
+ - "\"adea3e8a7bd68a058b88fbec459e2022\""
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Ua-Compatible:
40
+ - IE=Edge
41
+ body: "{\"name\":\"vcap\",\"build\":2222,\"support\":\"http://support.cloudfoundry.com\",\"version\":\"0.999\",\"description\":\"VMware's Cloud Application Platform\",\"allow_debug\":true,\"user\":\"user@vcap.me\",\"limits\":{\"memory\":2048,\"app_uris\":4,\"services\":16,\"apps\":20},\"usage\":{\"memory\":0,\"apps\":0,\"services\":0},\"frameworks\":{\"grails\":{\"name\":\"grails\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"spring\":{\"name\":\"spring\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"sinatra\":{\"name\":\"sinatra\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"*.rb\":\"require 'sinatra'|require \\\"sinatra\\\"\"},{\"config/environment.rb\":false}]},\"java_web\":{\"name\":\"java_web\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"php\":{\"name\":\"php\",\"runtimes\":[{\"name\":\"php\",\"version\":\"5.3\",\"description\":\"PHP 5\"}],\"appservers\":[{\"name\":\"apache\",\"description\":\"Apache\"}],\"detection\":[{\"*.php\":true}]},\"otp_rebar\":{\"name\":\"otp_rebar\",\"runtimes\":[{\"name\":\"erlangR14B02\",\"version\":\"R14B02\",\"description\":\"Erlang R14B02\"}],\"appservers\":[],\"detection\":[{\"releases/*/*.rel\":\".\"}]},\"lift\":{\"name\":\"lift\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"rails3\":{\"name\":\"rails3\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"config/application.rb\":true},{\"config/environment.rb\":true}]},\"django\":{\"name\":\"django\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]},\"node\":{\"name\":\"node\",\"runtimes\":[{\"name\":\"node\",\"version\":\"0.4.5\",\"description\":\"Node.js\"}],\"appservers\":[],\"detection\":[{\"*.js\":\".\"}]},\"wsgi\":{\"name\":\"wsgi\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]}}}"
42
+ http_version:
43
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
44
+ recorded_with: VCR 2.0.0.beta2
@@ -0,0 +1,29 @@
1
+ begin
2
+ require 'simplecov'
3
+ rescue LoadError
4
+ # ignore
5
+ else
6
+ SimpleCov.start do
7
+ coverage_dir "doc/coverage"
8
+ add_group "CloudFoundry Client", "lib/cloudfoundry"
9
+ add_group "Specs", "spec"
10
+ end
11
+ end
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'rspec'
16
+ require 'rspec/autorun'
17
+ require 'webmock/rspec'
18
+ require 'cloudfoundry'
19
+
20
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
21
+
22
+ RSpec.configure do |config|
23
+ # Make use_vcr_cassette available as a macro
24
+ config.extend VCR::RSpec::Macros
25
+ end
26
+
27
+ def spec_fixture(filename)
28
+ File.expand_path(File.join(File.dirname(__FILE__), "fixtures", filename))
29
+ end
@@ -0,0 +1,26 @@
1
+ module CfConnectionHelper
2
+ def client_data()
3
+ @target = CloudFoundry::Client::DEFAULT_TARGET
4
+ @user = "user@vcap.me"
5
+ @password = "foobar"
6
+ @auth_token = "04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f"
7
+ end
8
+
9
+ def client_no_logged()
10
+ @user = nil
11
+ @auth_token = nil
12
+ cf_client = CloudFoundry::Client.new()
13
+ end
14
+
15
+ def client_user_logged()
16
+ @user = "user@vcap.me"
17
+ @auth_token = "04085b084922117573657240766361702e6d65063a0645546c2b073101dc4e2219f848b1aea2d82a2a6981750fa1aac61104aed60f"
18
+ cf_client = CloudFoundry::Client.new({:auth_token => @auth_token})
19
+ end
20
+
21
+ def client_admin_logged()
22
+ @user = "admin@vcap.me"
23
+ @auth_token = "04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049"
24
+ cf_client = CloudFoundry::Client.new({:auth_token => @auth_token})
25
+ end
26
+ end
@@ -0,0 +1,8 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = "spec/fixtures"
5
+ c.hook_into :webmock
6
+ c.default_cassette_options = {:record => :none}
7
+ c.allow_http_connections_when_no_cassette = false
8
+ end