digital_opera 0.0.10 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/.gitignore +4 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +186 -0
  5. data/Guardfile +15 -0
  6. data/README.md +35 -0
  7. data/Rakefile +6 -3
  8. data/app/helpers/digital_opera/s3_helper.rb +14 -0
  9. data/digital_opera.gemspec +37 -0
  10. data/lib/digital_opera/banker.rb +1 -1
  11. data/lib/digital_opera/builders/s3_form_builder.rb +118 -0
  12. data/lib/digital_opera/document/base.rb +0 -0
  13. data/lib/digital_opera/document/fields/standard.rb +185 -0
  14. data/lib/digital_opera/document.rb +167 -0
  15. data/lib/digital_opera/engine.rb +9 -0
  16. data/lib/digital_opera/form_object/base.rb +115 -0
  17. data/lib/digital_opera/form_object.rb +13 -0
  18. data/lib/digital_opera/presenter/base.rb +6 -0
  19. data/lib/digital_opera/presenter/concerns/json_serialization.rb +30 -0
  20. data/lib/digital_opera/presenter.rb +9 -0
  21. data/lib/digital_opera/services/s3.rb +148 -0
  22. data/lib/digital_opera/version.rb +1 -1
  23. data/lib/digital_opera.rb +8 -1
  24. data/spec/dummy/README.rdoc +28 -0
  25. data/spec/dummy/Rakefile +8 -0
  26. data/spec/dummy/app/assets/images/.keep +0 -0
  27. data/spec/dummy/app/assets/javascripts/application.js +2 -0
  28. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  29. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  30. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  31. data/spec/dummy/app/mailers/.keep +0 -0
  32. data/spec/dummy/app/models/.keep +0 -0
  33. data/spec/dummy/app/models/concerns/.keep +0 -0
  34. data/spec/dummy/app/views/application/show.html.erb +0 -0
  35. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  36. data/spec/dummy/bin/bundle +3 -0
  37. data/spec/dummy/bin/rails +4 -0
  38. data/spec/dummy/bin/rake +4 -0
  39. data/spec/dummy/config/application.rb +23 -0
  40. data/spec/dummy/config/boot.rb +5 -0
  41. data/spec/dummy/config/database.yml +25 -0
  42. data/spec/dummy/config/environment.rb +5 -0
  43. data/spec/dummy/config/environments/development.rb +29 -0
  44. data/spec/dummy/config/environments/production.rb +80 -0
  45. data/spec/dummy/config/environments/test.rb +36 -0
  46. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/spec/dummy/config/initializers/inflections.rb +16 -0
  49. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  50. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  51. data/spec/dummy/config/initializers/session_store.rb +3 -0
  52. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  53. data/spec/dummy/config/locales/en.yml +23 -0
  54. data/spec/dummy/config/routes.rb +3 -0
  55. data/spec/dummy/config.ru +4 -0
  56. data/spec/dummy/db/development.sqlite3 +0 -0
  57. data/spec/dummy/db/schema.rb +16 -0
  58. data/spec/dummy/db/test.sqlite3 +0 -0
  59. data/spec/dummy/lib/assets/.keep +0 -0
  60. data/spec/dummy/public/404.html +58 -0
  61. data/spec/dummy/public/422.html +58 -0
  62. data/spec/dummy/public/500.html +57 -0
  63. data/spec/dummy/public/favicon.ico +0 -0
  64. data/spec/dummy/spec/javascripts/helpers/.gitkeep +0 -0
  65. data/spec/dummy/spec/javascripts/support/jasmine.yml +116 -0
  66. data/spec/dummy/spec/javascripts/support/jasmine_helper.rb +10 -0
  67. data/spec/javascripts/spec/ellipsis_spec.js +10 -28
  68. data/spec/javascripts/spec/events_spec.js +15 -40
  69. data/spec/javascripts/spec/preload_images_spec.js +20 -32
  70. data/spec/javascripts/spec/tables_spec.js +3 -3
  71. data/spec/{banker_spec.rb → lib/digital_opera/banker_spec.rb} +4 -4
  72. data/spec/{base_extensions → lib/digital_opera/base_extensions}/object_spec.rb +0 -0
  73. data/spec/{presenter → lib/digital_opera/presenter}/base_spec.rb +0 -3
  74. data/spec/lib/digital_opera/services/s3_spec.rb +203 -0
  75. data/spec/{token_spec.rb → lib/digital_opera/token_spec.rb} +0 -0
  76. data/spec/spec_helper.rb +11 -5
  77. data/spec/support/aws.rb +5 -0
  78. data/spec/support/document.rb +10 -0
  79. data/tasks/spec.rake +5 -0
  80. data/tmp/rspec_guard_result +1 -0
  81. metadata +268 -46
  82. data/spec/javascripts/SpecRunner.html +0 -62
  83. data/spec/javascripts/lib/jasmine-1.3.1/MIT.LICENSE +0 -20
  84. data/spec/javascripts/lib/jasmine-1.3.1/jasmine-html.js +0 -681
  85. data/spec/javascripts/lib/jasmine-1.3.1/jasmine.css +0 -82
  86. data/spec/javascripts/lib/jasmine-1.3.1/jasmine.js +0 -2600
  87. data/spec/javascripts/src/digital_opera.js +0 -149
@@ -1,149 +0,0 @@
1
- // Generated by CoffeeScript 1.6.3
2
- window.digitalOpera = window.digitalOpera || {};
3
-
4
- (function(d) {
5
- return d.ellipsis = function(el) {
6
- var counter, ele, timer;
7
- ele = $(el);
8
- counter = 0;
9
- return timer = setInterval(function() {
10
- var arr, num;
11
- counter++;
12
- if (counter > 3) {
13
- counter = 0;
14
- }
15
- num = 0;
16
- arr = [];
17
- while (num < counter) {
18
- num++;
19
- arr.push('.');
20
- }
21
- return ele.text(arr.join(''));
22
- }, 750);
23
- };
24
- })(window.digitalOpera);
25
-
26
- $('[data-does="animate-ellipsis"]').each(function(idx, ele) {
27
- return window.digitalOpera(ele);
28
- });
29
-
30
- (function(d) {
31
- return d.isClickOutsideElement = function(event, element) {
32
- var target;
33
- target = $(event.target);
34
- if (target[0] === element[0] || element.children(target).length > 0) {
35
- return false;
36
- } else {
37
- return true;
38
- }
39
- };
40
- })(window.digitalOpera);
41
-
42
- (function(d) {
43
- return d.parameterizeObject = function(data) {
44
- var accLoop, key, obj, val;
45
- obj = {};
46
- accLoop = function(key, val) {
47
- var k, v;
48
- if ($.isPlainObject(val)) {
49
- for (k in val) {
50
- v = val[k];
51
- k = "" + key + "[" + k + "]";
52
- accLoop(k, v);
53
- }
54
- } else {
55
- obj[key] = val;
56
- }
57
- };
58
- for (key in data) {
59
- val = data[key];
60
- accLoop(key, val);
61
- }
62
- return obj;
63
- };
64
- })(window.digitalOpera);
65
-
66
- (function(d) {
67
- return d.preloadImages = function(urls, callback) {
68
- var images, increment, numLoaded;
69
- if (typeof urls === 'string') {
70
- urls = [urls];
71
- }
72
- images = [];
73
- numLoaded = 0;
74
- increment = function() {
75
- numLoaded++;
76
- if ((callback != null) && numLoaded === urls.length) {
77
- return callback();
78
- }
79
- };
80
- return urls.map(function(url, i) {
81
- var img;
82
- img = images[i];
83
- img = new Image();
84
- img.onload = increment;
85
- img.onerror = increment;
86
- img.src = url;
87
- return img;
88
- });
89
- };
90
- })(window.digitalOpera);
91
-
92
- (function(d) {
93
- d.capitalize = function(str) {
94
- return str.charAt(0).toUpperCase() + str.slice(1);
95
- };
96
- d.titleize = function(str) {
97
- var arr, newString, string, _i, _len;
98
- arr = str.split(' ');
99
- newString = '';
100
- for (_i = 0, _len = arr.length; _i < _len; _i++) {
101
- string = arr[_i];
102
- arr[_i] = string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
103
- }
104
- return arr.join(' ');
105
- };
106
- return d.formatJSONErrors = function(str, withKeys) {
107
- var errors;
108
- errors = typeof str === 'string' ? JSON.parse(str) : str;
109
- return $.map(errors, function(val, key) {
110
- var obj, values;
111
- values = val.join(' and ');
112
- str = d.capitalize("" + key + " " + values);
113
- if (withKeys != null) {
114
- obj = {};
115
- obj[key] = str;
116
- return obj;
117
- } else {
118
- return str;
119
- }
120
- });
121
- };
122
- })(window.digitalOpera);
123
-
124
- (function(d) {
125
- $(document).on('click', 'tr[data-href]', function(e) {
126
- var currentTarget, href, location, target, win;
127
- target = $(e.target);
128
- currentTarget = $(e.currentTarget);
129
- if (target.is('a') === false && target.parents('a').length === 0) {
130
- href = currentTarget.attr('data-href');
131
- if (currentTarget.attr('data-does') === 'open-window') {
132
- win = window.open(href, '_blank');
133
- return win.focus();
134
- } else {
135
- location = d.forTestingPurposes.getWindowLocation();
136
- return location = href;
137
- }
138
- }
139
- });
140
- return d.forTestingPurposes = (function() {
141
- var getWindowLocation;
142
- getWindowLocation = function() {
143
- return window.location;
144
- };
145
- return {
146
- getWindowLocation: getWindowLocation
147
- };
148
- })();
149
- })(window.digitalOpera);