ocp_registry 0.0.1.alpha

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 (88) hide show
  1. data/.gitignore +25 -0
  2. data/Gemfile +17 -0
  3. data/Gemfile.lock +65 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/bin/ocp_registry +28 -0
  7. data/config/example-mysql.yml +40 -0
  8. data/config/example-sqlite.yml +33 -0
  9. data/lib/ocp_registry.rb +29 -0
  10. data/lib/ocp_registry/api_controller.rb +146 -0
  11. data/lib/ocp_registry/application_manager.rb +213 -0
  12. data/lib/ocp_registry/cloud_manager/mock.rb +5 -0
  13. data/lib/ocp_registry/cloud_manager/mock/mock.rb +191 -0
  14. data/lib/ocp_registry/cloud_manager/mock/model.rb +22 -0
  15. data/lib/ocp_registry/cloud_manager/openstack.rb +4 -0
  16. data/lib/ocp_registry/cloud_manager/openstack/cinder_helper.rb +27 -0
  17. data/lib/ocp_registry/cloud_manager/openstack/keystone_helper.rb +57 -0
  18. data/lib/ocp_registry/cloud_manager/openstack/nova_helper.rb +37 -0
  19. data/lib/ocp_registry/cloud_manager/openstack/openstack.rb +126 -0
  20. data/lib/ocp_registry/common.rb +54 -0
  21. data/lib/ocp_registry/config.rb +96 -0
  22. data/lib/ocp_registry/db/001_db_initialize.rb +16 -0
  23. data/lib/ocp_registry/error.rb +16 -0
  24. data/lib/ocp_registry/mail_client.rb +141 -0
  25. data/lib/ocp_registry/models.rb +7 -0
  26. data/lib/ocp_registry/models/registry_application.rb +10 -0
  27. data/lib/ocp_registry/runner.rb +47 -0
  28. data/lib/ocp_registry/version.rb +3 -0
  29. data/lib/ocp_registry/yaml_helper.rb +23 -0
  30. data/mail_template/approve_admin.erb +14 -0
  31. data/mail_template/approve_user.erb +22 -0
  32. data/mail_template/refuse_admin.erb +16 -0
  33. data/mail_template/refuse_user.erb +17 -0
  34. data/mail_template/request_admin.erb +15 -0
  35. data/mail_template/request_user.erb +16 -0
  36. data/ocp_registry.gemspec +34 -0
  37. data/public/bootstrap/css/bootstrap-responsive.css +1109 -0
  38. data/public/bootstrap/css/bootstrap-responsive.min.css +9 -0
  39. data/public/bootstrap/css/bootstrap.css +6167 -0
  40. data/public/bootstrap/css/bootstrap.min.css +9 -0
  41. data/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
  42. data/public/bootstrap/img/glyphicons-halflings.png +0 -0
  43. data/public/bootstrap/js/bootstrap.js +2280 -0
  44. data/public/bootstrap/js/bootstrap.min.js +6 -0
  45. data/public/common.css +104 -0
  46. data/public/favicon.ico +0 -0
  47. data/public/images/loading.gif +0 -0
  48. data/public/jquery-1.10.2.min.js +6 -0
  49. data/public/jquery-1.10.2.min.map +1 -0
  50. data/public/jquery.json-2.4.min.js +23 -0
  51. data/public/noty/.gitignore +8 -0
  52. data/public/noty/LICENSE.txt +20 -0
  53. data/public/noty/README.markdown +22 -0
  54. data/public/noty/demo/allLayouts.html +91 -0
  55. data/public/noty/demo/allTypes.html +86 -0
  56. data/public/noty/demo/api.html +103 -0
  57. data/public/noty/demo/buttons.css +320 -0
  58. data/public/noty/demo/consumingAlert.html +78 -0
  59. data/public/noty/demo/customContainer.html +90 -0
  60. data/public/noty/demo/index.html +66 -0
  61. data/public/noty/demo/jquery-1.7.2.min.js +4 -0
  62. data/public/noty/demo/usingMaxVisible.html +104 -0
  63. data/public/noty/demo/usingWithButtons.html +104 -0
  64. data/public/noty/demo/usingWithButtons2.html +98 -0
  65. data/public/noty/demo/usingWithModal.html +87 -0
  66. data/public/noty/demo/usingWithOldOptions.html +110 -0
  67. data/public/noty/js/jquery.noty.js +547 -0
  68. data/public/noty/js/layouts/bottom.js +34 -0
  69. data/public/noty/js/layouts/bottomCenter.js +41 -0
  70. data/public/noty/js/layouts/bottomLeft.js +43 -0
  71. data/public/noty/js/layouts/bottomRight.js +43 -0
  72. data/public/noty/js/layouts/center.js +56 -0
  73. data/public/noty/js/layouts/centerLeft.js +61 -0
  74. data/public/noty/js/layouts/centerRight.js +61 -0
  75. data/public/noty/js/layouts/inline.js +31 -0
  76. data/public/noty/js/layouts/top.js +34 -0
  77. data/public/noty/js/layouts/topCenter.js +41 -0
  78. data/public/noty/js/layouts/topLeft.js +43 -0
  79. data/public/noty/js/layouts/topRight.js +43 -0
  80. data/public/noty/js/promise.js +432 -0
  81. data/public/noty/js/themes/default.js +156 -0
  82. data/views/apply.erb +134 -0
  83. data/views/base.erb +25 -0
  84. data/views/list.erb +41 -0
  85. data/views/review.erb +141 -0
  86. data/views/show.erb +96 -0
  87. data/views/view.erb +7 -0
  88. metadata +294 -0
@@ -0,0 +1,43 @@
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.topLeft = {
4
+ name: 'topLeft',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_topLeft_layout_container" />',
10
+ selector: 'ul#noty_topLeft_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ top: 20,
14
+ left: 20,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ if (window.innerWidth < 600) {
25
+ $(this).css({
26
+ left: 5
27
+ });
28
+ }
29
+ }
30
+ },
31
+ parent: {
32
+ object: '<li />',
33
+ selector: 'li',
34
+ css: {}
35
+ },
36
+ css: {
37
+ display: 'none',
38
+ width: '310px'
39
+ },
40
+ addClass: ''
41
+ };
42
+
43
+ })(jQuery);
@@ -0,0 +1,43 @@
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.topRight = {
4
+ name: 'topRight',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_topRight_layout_container" />',
10
+ selector: 'ul#noty_topRight_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ top: 20,
14
+ right: 20,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ if (window.innerWidth < 600) {
25
+ $(this).css({
26
+ right: 5
27
+ });
28
+ }
29
+ }
30
+ },
31
+ parent: {
32
+ object: '<li />',
33
+ selector: 'li',
34
+ css: {}
35
+ },
36
+ css: {
37
+ display: 'none',
38
+ width: '310px'
39
+ },
40
+ addClass: ''
41
+ };
42
+
43
+ })(jQuery);
@@ -0,0 +1,432 @@
1
+ /*!
2
+ * Noty Helpers Javascript From JQuery Javascript Library
3
+ *
4
+ * Ported by Maksim Pecherskiy. Original Licensing:
5
+ *
6
+ * http://jquery.com/
7
+ *
8
+ * Copyright 2011, John Resig
9
+ * Dual licensed under the MIT or GPL Version 2 licenses.
10
+ * http://jquery.org/license
11
+ *
12
+ * Includes Sizzle.js
13
+ * http://sizzlejs.com/
14
+ * Copyright 2011, The Dojo Foundation
15
+ * Released under the MIT, BSD, and GPL Licenses.
16
+ *
17
+ * Date: Mon Nov 21 21:11:03 2011 -0500
18
+ */
19
+
20
+
21
+ (function(){
22
+
23
+ // String to Object flags format cache
24
+ var flagsCache = {};
25
+
26
+ // Convert String-formatted flags into Object-formatted ones and store in cache
27
+ function createFlags( flags ) {
28
+ var object = flagsCache[ flags ] = {},
29
+ i, length;
30
+ flags = flags.split( /\s+/ );
31
+ for ( i = 0, length = flags.length; i < length; i++ ) {
32
+ object[ flags[i] ] = true;
33
+ }
34
+ return object;
35
+ }
36
+
37
+ jQuery.extend({
38
+
39
+ _mark: function( elem, type ) {
40
+ if ( elem ) {
41
+ type = (type || "fx") + "mark";
42
+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
43
+ }
44
+ },
45
+
46
+ _unmark: function( force, elem, type ) {
47
+ if ( force !== true ) {
48
+ type = elem;
49
+ elem = force;
50
+ force = false;
51
+ }
52
+ if ( elem ) {
53
+ type = type || "fx";
54
+ var key = type + "mark",
55
+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
56
+ if ( count ) {
57
+ jQuery.data( elem, key, count, true );
58
+ } else {
59
+ jQuery.removeData( elem, key, true );
60
+ handleQueueMarkDefer( elem, type, "mark" );
61
+ }
62
+ }
63
+ },
64
+
65
+ queue: function( elem, type, data ) {
66
+ if ( elem ) {
67
+ type = (type || "fx") + "queue";
68
+ var q = jQuery.data( elem, type, undefined, true );
69
+ // Speed up dequeue by getting out quickly if this is just a lookup
70
+ if ( data ) {
71
+ if ( !q || jQuery.isArray(data) ) {
72
+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
73
+ } else {
74
+ q.push( data );
75
+ }
76
+ }
77
+ return q || [];
78
+ }
79
+ },
80
+
81
+ dequeue: function( elem, type ) {
82
+ type = type || "fx";
83
+
84
+ var queue = jQuery.queue( elem, type ),
85
+ fn = queue.shift(),
86
+ defer;
87
+
88
+ // If the fx queue is dequeued, always remove the progress sentinel
89
+ if ( fn === "inprogress" ) {
90
+ fn = queue.shift();
91
+ }
92
+
93
+ if ( fn ) {
94
+ // Add a progress sentinel to prevent the fx queue from being
95
+ // automatically dequeued
96
+ if ( type === "fx" ) {
97
+ queue.unshift("inprogress");
98
+ }
99
+
100
+ fn.call(elem, function() {
101
+ jQuery.dequeue(elem, type);
102
+ });
103
+ }
104
+
105
+ if ( !queue.length ) {
106
+ jQuery.removeData( elem, type + "queue", true );
107
+ handleQueueMarkDefer( elem, type, "queue" );
108
+ }
109
+ }
110
+ });
111
+
112
+ jQuery.fn.extend({
113
+ queue: function( type, data ) {
114
+ if ( typeof type !== "string" ) {
115
+ data = type;
116
+ type = "fx";
117
+ }
118
+
119
+ if ( data === undefined ) {
120
+ return jQuery.queue( this[0], type );
121
+ }
122
+ return this.each(function() {
123
+ var queue = jQuery.queue( this, type, data );
124
+
125
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
126
+ jQuery.dequeue( this, type );
127
+ }
128
+ });
129
+ },
130
+ dequeue: function( type ) {
131
+ return this.each(function() {
132
+ jQuery.dequeue( this, type );
133
+ });
134
+ },
135
+ // Based off of the plugin by Clint Helfers, with permission.
136
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
137
+ delay: function( time, type ) {
138
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
139
+ type = type || "fx";
140
+
141
+ return this.queue( type, function() {
142
+ var elem = this;
143
+ setTimeout(function() {
144
+ jQuery.dequeue( elem, type );
145
+ }, time );
146
+ });
147
+ },
148
+ clearQueue: function( type ) {
149
+ return this.queue( type || "fx", [] );
150
+ },
151
+ // Get a promise resolved when queues of a certain type
152
+ // are emptied (fx is the type by default)
153
+ promise: function( type, object ) {
154
+ if ( typeof type !== "string" ) {
155
+ object = type;
156
+ type = undefined;
157
+ }
158
+ type = type || "fx";
159
+ var defer = jQuery.Deferred(),
160
+ elements = this,
161
+ i = elements.length,
162
+ count = 1,
163
+ deferDataKey = type + "defer",
164
+ queueDataKey = type + "queue",
165
+ markDataKey = type + "mark",
166
+ tmp;
167
+ function resolve() {
168
+ if ( !( --count ) ) {
169
+ defer.resolveWith( elements, [ elements ] );
170
+ }
171
+ }
172
+ while( i-- ) {
173
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
174
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
175
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
176
+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
177
+ count++;
178
+ tmp.done( resolve );
179
+ }
180
+ }
181
+ resolve();
182
+ return defer.promise();
183
+ }
184
+ });
185
+
186
+ function handleQueueMarkDefer( elem, type, src ) {
187
+ var deferDataKey = type + "defer",
188
+ queueDataKey = type + "queue",
189
+ markDataKey = type + "mark",
190
+ defer = jQuery._data( elem, deferDataKey );
191
+ if ( defer &&
192
+ ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
193
+ ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
194
+ // Give room for hard-coded callbacks to fire first
195
+ // and eventually mark/queue something else on the element
196
+ setTimeout( function() {
197
+ if ( !jQuery._data( elem, queueDataKey ) &&
198
+ !jQuery._data( elem, markDataKey ) ) {
199
+ jQuery.removeData( elem, deferDataKey, true );
200
+ defer.fire();
201
+ }
202
+ }, 0 );
203
+ }
204
+ }
205
+
206
+
207
+
208
+ jQuery.Callbacks = function( flags ) {
209
+
210
+ // Convert flags from String-formatted to Object-formatted
211
+ // (we check in cache first)
212
+ flags = flags ? ( /*flagsCache[ flags ] || */createFlags( flags ) ) : {};
213
+
214
+ var // Actual callback list
215
+ list = [],
216
+ // Stack of fire calls for repeatable lists
217
+ stack = [],
218
+ // Last fire value (for non-forgettable lists)
219
+ memory,
220
+ // Flag to know if list is currently firing
221
+ firing,
222
+ // First callback to fire (used internally by add and fireWith)
223
+ firingStart,
224
+ // End of the loop when firing
225
+ firingLength,
226
+ // Index of currently firing callback (modified by remove if needed)
227
+ firingIndex,
228
+ // Add one or several callbacks to the list
229
+ add = function( args ) {
230
+ var i,
231
+ length,
232
+ elem,
233
+ type,
234
+ actual;
235
+ for ( i = 0, length = args.length; i < length; i++ ) {
236
+ elem = args[ i ];
237
+ type = jQuery.type( elem );
238
+ if ( type === "array" ) {
239
+ // Inspect recursively
240
+ add( elem );
241
+ } else if ( type === "function" ) {
242
+ // Add if not in unique mode and callback is not in
243
+ if ( !flags.unique || !self.has( elem ) ) {
244
+ list.push( elem );
245
+ }
246
+ }
247
+ }
248
+ },
249
+ // Fire callbacks
250
+ fire = function( context, args ) {
251
+ args = args || [];
252
+ memory = !flags.memory || [ context, args ];
253
+ firing = true;
254
+ firingIndex = firingStart || 0;
255
+ firingStart = 0;
256
+ firingLength = list.length;
257
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
258
+ if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
259
+ memory = true; // Mark as halted
260
+ break;
261
+ }
262
+ }
263
+ firing = false;
264
+ if ( list ) {
265
+ if ( !flags.once ) {
266
+ if ( stack && stack.length ) {
267
+ memory = stack.shift();
268
+ self.fireWith( memory[ 0 ], memory[ 1 ] );
269
+ }
270
+ } else if ( memory === true ) {
271
+ self.disable();
272
+ } else {
273
+ list = [];
274
+ }
275
+ }
276
+ },
277
+ // Actual Callbacks object
278
+ self = {
279
+ // Add a callback or a collection of callbacks to the list
280
+ add: function() {
281
+ if ( list ) {
282
+ var length = list.length;
283
+ add( arguments );
284
+ // Do we need to add the callbacks to the
285
+ // current firing batch?
286
+ if ( firing ) {
287
+ firingLength = list.length;
288
+ // With memory, if we're not firing then
289
+ // we should call right away, unless previous
290
+ // firing was halted (stopOnFalse)
291
+ } else if ( memory && memory !== true ) {
292
+ firingStart = length;
293
+ fire( memory[ 0 ], memory[ 1 ] );
294
+ }
295
+ }
296
+ return this;
297
+ },
298
+ // Remove a callback from the list
299
+ remove: function() {
300
+ if ( list ) {
301
+ var args = arguments,
302
+ argIndex = 0,
303
+ argLength = args.length;
304
+ for ( ; argIndex < argLength ; argIndex++ ) {
305
+ for ( var i = 0; i < list.length; i++ ) {
306
+ if ( args[ argIndex ] === list[ i ] ) {
307
+ // Handle firingIndex and firingLength
308
+ if ( firing ) {
309
+ if ( i <= firingLength ) {
310
+ firingLength--;
311
+ if ( i <= firingIndex ) {
312
+ firingIndex--;
313
+ }
314
+ }
315
+ }
316
+ // Remove the element
317
+ list.splice( i--, 1 );
318
+ // If we have some unicity property then
319
+ // we only need to do this once
320
+ if ( flags.unique ) {
321
+ break;
322
+ }
323
+ }
324
+ }
325
+ }
326
+ }
327
+ return this;
328
+ },
329
+ // Control if a given callback is in the list
330
+ has: function( fn ) {
331
+ if ( list ) {
332
+ var i = 0,
333
+ length = list.length;
334
+ for ( ; i < length; i++ ) {
335
+ if ( fn === list[ i ] ) {
336
+ return true;
337
+ }
338
+ }
339
+ }
340
+ return false;
341
+ },
342
+ // Remove all callbacks from the list
343
+ empty: function() {
344
+ list = [];
345
+ return this;
346
+ },
347
+ // Have the list do nothing anymore
348
+ disable: function() {
349
+ list = stack = memory = undefined;
350
+ return this;
351
+ },
352
+ // Is it disabled?
353
+ disabled: function() {
354
+ return !list;
355
+ },
356
+ // Lock the list in its current state
357
+ lock: function() {
358
+ stack = undefined;
359
+ if ( !memory || memory === true ) {
360
+ self.disable();
361
+ }
362
+ return this;
363
+ },
364
+ // Is it locked?
365
+ locked: function() {
366
+ return !stack;
367
+ },
368
+ // Call all callbacks with the given context and arguments
369
+ fireWith: function( context, args ) {
370
+ if ( stack ) {
371
+ if ( firing ) {
372
+ if ( !flags.once ) {
373
+ stack.push( [ context, args ] );
374
+ }
375
+ } else if ( !( flags.once && memory ) ) {
376
+ fire( context, args );
377
+ }
378
+ }
379
+ return this;
380
+ },
381
+ // Call all the callbacks with the given arguments
382
+ fire: function() {
383
+ self.fireWith( this, arguments );
384
+ return this;
385
+ },
386
+ // To know if the callbacks have already been called at least once
387
+ fired: function() {
388
+ return !!memory;
389
+ }
390
+ };
391
+
392
+ return self;
393
+ };
394
+
395
+
396
+
397
+ jQuery.fn.extend({
398
+ // Get a promise resolved when queues of a certain type
399
+ // are emptied (fx is the type by default)
400
+ promise: function( type, object ) {
401
+ if ( typeof type !== "string" ) {
402
+ object = type;
403
+ type = undefined;
404
+ }
405
+ type = type || "fx";
406
+ var defer = jQuery.Deferred(),
407
+ elements = this,
408
+ i = elements.length,
409
+ count = 1,
410
+ deferDataKey = type + "defer",
411
+ queueDataKey = type + "queue",
412
+ markDataKey = type + "mark",
413
+ tmp;
414
+ function resolve() {
415
+ if ( !( --count ) ) {
416
+ defer.resolveWith( elements, [ elements ] );
417
+ }
418
+ }
419
+ while( i-- ) {
420
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
421
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
422
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
423
+ jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
424
+ count++;
425
+ tmp.add( resolve );
426
+ }
427
+ }
428
+ resolve();
429
+ return defer.promise();
430
+ }
431
+ });
432
+ })();