zfben_rails_assets 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/Rakefile +1 -0
  4. data/example/.gitignore +7 -0
  5. data/example/Gemfile +7 -0
  6. data/example/README +261 -0
  7. data/example/Rakefile +7 -0
  8. data/example/app/assets/images/rails.png +0 -0
  9. data/example/app/assets/javascripts/application.js +9 -0
  10. data/example/app/assets/javascripts/test.js +3 -0
  11. data/example/app/assets/stylesheets/application.css +7 -0
  12. data/example/app/controllers/application_controller.rb +3 -0
  13. data/example/app/controllers/test_controller.rb +7 -0
  14. data/example/app/helpers/application_helper.rb +2 -0
  15. data/example/app/mailers/.gitkeep +0 -0
  16. data/example/app/models/.gitkeep +0 -0
  17. data/example/app/views/test/index.haml +12 -0
  18. data/example/config.ru +4 -0
  19. data/example/config/application.rb +49 -0
  20. data/example/config/boot.rb +6 -0
  21. data/example/config/database.yml +25 -0
  22. data/example/config/environment.rb +5 -0
  23. data/example/config/environments/development.rb +24 -0
  24. data/example/config/environments/production.rb +52 -0
  25. data/example/config/environments/test.rb +39 -0
  26. data/example/config/initializers/backtrace_silencers.rb +7 -0
  27. data/example/config/initializers/inflections.rb +10 -0
  28. data/example/config/initializers/mime_types.rb +5 -0
  29. data/example/config/initializers/secret_token.rb +7 -0
  30. data/example/config/initializers/session_store.rb +8 -0
  31. data/example/config/initializers/wrap_parameters.rb +12 -0
  32. data/example/config/locales/en.yml +5 -0
  33. data/example/config/routes.rb +3 -0
  34. data/example/db/development.sqlite3 +0 -0
  35. data/example/db/seeds.rb +7 -0
  36. data/example/doc/README_FOR_APP +2 -0
  37. data/example/lib/tasks/.gitkeep +0 -0
  38. data/example/public/404.html +26 -0
  39. data/example/public/422.html +26 -0
  40. data/example/public/500.html +26 -0
  41. data/example/public/favicon.ico +0 -0
  42. data/example/public/robots.txt +5 -0
  43. data/example/script/rails +6 -0
  44. data/example/test/fixtures/.gitkeep +0 -0
  45. data/example/test/functional/.gitkeep +0 -0
  46. data/example/test/integration/.gitkeep +0 -0
  47. data/example/test/performance/browsing_test.rb +12 -0
  48. data/example/test/test_helper.rb +13 -0
  49. data/example/test/unit/.gitkeep +0 -0
  50. data/example/vendor/assets/stylesheets/.gitkeep +0 -0
  51. data/example/vendor/plugins/.gitkeep +0 -0
  52. data/lib/zfben_rails_assets.rb +8 -0
  53. data/lib/zfben_rails_assets/version.rb +3 -0
  54. data/vendor/assets/javascripts/jasmine.js +4 -0
  55. data/vendor/assets/javascripts/jasmine/jasmine-html.js +190 -0
  56. data/vendor/assets/javascripts/jasmine/jasmine.js +2445 -0
  57. data/vendor/assets/javascripts/jasmine/mock-ajax.js +114 -0
  58. data/vendor/assets/javascripts/jasmine/spec-helper.js +19 -0
  59. data/vendor/assets/javascripts/jqGrid.js +467 -0
  60. data/vendor/assets/javascripts/jquery.js +1 -0
  61. data/vendor/assets/javascripts/jquery/jquery-ui.js +11631 -0
  62. data/vendor/assets/javascripts/jquery/jquery-ui.js.1 +843 -0
  63. data/vendor/assets/javascripts/jquery/jquery.js +8936 -0
  64. data/vendor/assets/javascripts/qunit.js +1 -0
  65. data/vendor/assets/javascripts/qunit/qunit.js +1448 -0
  66. data/vendor/assets/javascripts/underscore.js +1 -0
  67. data/vendor/assets/javascripts/underscore/underscore.js +807 -0
  68. data/vendor/assets/javascripts/zzf-spec.js +1 -0
  69. data/vendor/assets/javascripts/zzf-spec/core.js +38 -0
  70. data/vendor/assets/javascripts/zzf.js +1 -0
  71. data/vendor/assets/javascripts/zzf/core.js +59 -0
  72. data/vendor/assets/javascripts/zzf/underscore.js +6 -0
  73. data/vendor/assets/stylesheets/jasmine.css +166 -0
  74. data/vendor/assets/stylesheets/qunit.css +225 -0
  75. data/zfben_rails_assets.gemspec +35 -0
  76. metadata +216 -0
@@ -0,0 +1 @@
1
+ //= require zzf-spec/core
@@ -0,0 +1,38 @@
1
+ module('Init');
2
+
3
+ test('jQuery', function(){
4
+ ok($ === jQuery, '$ === jQuery');
5
+ });
6
+
7
+ module('Load module');
8
+
9
+ asyncTest('success load', function(){
10
+
11
+ ok($.load('underscore') === 202, 'underscore is not loaded');
12
+
13
+ var i = 0;
14
+
15
+ $.load('underscore', function(){
16
+ ok($.isFunction(_), '_ is loaded');
17
+ ok($.load('underscore') === 200, 'underscore loaded');
18
+ i++;
19
+ ok(i === 1, 'success func is loaded');
20
+ });
21
+ $.load('underscore', function(){
22
+ i++;
23
+ ok(i === 2, 'twice success func is loaded');
24
+ start();
25
+ });
26
+ });
27
+
28
+ asyncTest('error load', function(){
29
+ ok($.load('null') === 202, 'null is not loaded');
30
+
31
+ $.load('null', {
32
+ error: function(){
33
+ ok($.load('null') === 500, 'module null is error');
34
+ start();
35
+ }
36
+ });
37
+ });
38
+
@@ -0,0 +1 @@
1
+ //= require zzf/core
@@ -0,0 +1,59 @@
1
+ //= require jquery
2
+
3
+ // zzf-core
4
+
5
+ var MODULE_PATH = '/assets';
6
+
7
+ // load module
8
+ // $.load(module_name, success_function)
9
+ // $.load(module_name, ajax_options)
10
+
11
+ (function($){
12
+
13
+ var info = {};
14
+
15
+ $.load = function(module, opts){
16
+ opts = opts || {};
17
+
18
+ if($.isFunction(opts)){
19
+ opts = {
20
+ success: opts
21
+ };
22
+ }
23
+
24
+ if(typeof info[module] === 'undefined'){
25
+ var defaults = {
26
+ url: MODULE_PATH + '/' + module + '.js',
27
+ dataType: 'script'
28
+ };
29
+
30
+ opts = $.extend(defaults, opts);
31
+
32
+ var xhr = $.ajax(opts).success(function(){
33
+ info[module].state = 200;
34
+ }).error(function(){
35
+ info[module].state = 500;
36
+ });
37
+
38
+ info[module] = {
39
+ state: 202,
40
+ xhr: xhr
41
+ };
42
+ }else{
43
+ if(info[module].state === 200){
44
+ if($.isFunction(opts.success)){
45
+ opts.success();
46
+ }
47
+ }
48
+
49
+ if(info[module].state === 202){
50
+ $.each(['success', 'error', 'complete', 'statusCode'], function(i, type){
51
+ if($.isFunction(opts[type])){
52
+ info[module].xhr = info[module].xhr[type](opts[type]);
53
+ }
54
+ });
55
+ }
56
+ }
57
+ return info[module].state;
58
+ };
59
+ })($);
@@ -0,0 +1,6 @@
1
+ //= require underscore/underscore
2
+
3
+ (function($){
4
+ $.underscore = _.noConflict();
5
+
6
+ })(jQuery);
@@ -0,0 +1,166 @@
1
+ body {
2
+ font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
3
+ }
4
+
5
+
6
+ .jasmine_reporter a:visited, .jasmine_reporter a {
7
+ color: #303;
8
+ }
9
+
10
+ .jasmine_reporter a:hover, .jasmine_reporter a:active {
11
+ color: blue;
12
+ }
13
+
14
+ .run_spec {
15
+ float:right;
16
+ padding-right: 5px;
17
+ font-size: .8em;
18
+ text-decoration: none;
19
+ }
20
+
21
+ .jasmine_reporter {
22
+ margin: 0 5px;
23
+ }
24
+
25
+ .banner {
26
+ color: #303;
27
+ background-color: #fef;
28
+ padding: 5px;
29
+ }
30
+
31
+ .logo {
32
+ float: left;
33
+ font-size: 1.1em;
34
+ padding-left: 5px;
35
+ }
36
+
37
+ .logo .version {
38
+ font-size: .6em;
39
+ padding-left: 1em;
40
+ }
41
+
42
+ .runner.running {
43
+ background-color: yellow;
44
+ }
45
+
46
+
47
+ .options {
48
+ text-align: right;
49
+ font-size: .8em;
50
+ }
51
+
52
+
53
+
54
+
55
+ .suite {
56
+ border: 1px outset gray;
57
+ margin: 5px 0;
58
+ padding-left: 1em;
59
+ }
60
+
61
+ .suite .suite {
62
+ margin: 5px;
63
+ }
64
+
65
+ .suite.passed {
66
+ background-color: #dfd;
67
+ }
68
+
69
+ .suite.failed {
70
+ background-color: #fdd;
71
+ }
72
+
73
+ .spec {
74
+ margin: 5px;
75
+ padding-left: 1em;
76
+ clear: both;
77
+ }
78
+
79
+ .spec.failed, .spec.passed, .spec.skipped {
80
+ padding-bottom: 5px;
81
+ border: 1px solid gray;
82
+ }
83
+
84
+ .spec.failed {
85
+ background-color: #fbb;
86
+ border-color: red;
87
+ }
88
+
89
+ .spec.passed {
90
+ background-color: #bfb;
91
+ border-color: green;
92
+ }
93
+
94
+ .spec.skipped {
95
+ background-color: #bbb;
96
+ }
97
+
98
+ .messages {
99
+ border-left: 1px dashed gray;
100
+ padding-left: 1em;
101
+ padding-right: 1em;
102
+ }
103
+
104
+ .passed {
105
+ background-color: #cfc;
106
+ display: none;
107
+ }
108
+
109
+ .failed {
110
+ background-color: #fbb;
111
+ }
112
+
113
+ .skipped {
114
+ color: #777;
115
+ background-color: #eee;
116
+ display: none;
117
+ }
118
+
119
+
120
+ /*.resultMessage {*/
121
+ /*white-space: pre;*/
122
+ /*}*/
123
+
124
+ .resultMessage span.result {
125
+ display: block;
126
+ line-height: 2em;
127
+ color: black;
128
+ }
129
+
130
+ .resultMessage .mismatch {
131
+ color: black;
132
+ }
133
+
134
+ .stackTrace {
135
+ white-space: pre;
136
+ font-size: .8em;
137
+ margin-left: 10px;
138
+ max-height: 5em;
139
+ overflow: auto;
140
+ border: 1px inset red;
141
+ padding: 1em;
142
+ background: #eef;
143
+ }
144
+
145
+ .finished-at {
146
+ padding-left: 1em;
147
+ font-size: .6em;
148
+ }
149
+
150
+ .show-passed .passed,
151
+ .show-skipped .skipped {
152
+ display: block;
153
+ }
154
+
155
+
156
+ #jasmine_content {
157
+ position:fixed;
158
+ right: 100%;
159
+ }
160
+
161
+ .runner {
162
+ border: 1px solid gray;
163
+ display: block;
164
+ margin: 5px 0;
165
+ padding: 2px 0 2px 10px;
166
+ }
@@ -0,0 +1,225 @@
1
+ /**
2
+ * QUnit - A JavaScript Unit Testing Framework
3
+ *
4
+ * http://docs.jquery.com/QUnit
5
+ *
6
+ * Copyright (c) 2011 John Resig, Jörn Zaefferer
7
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
8
+ * or GPL (GPL-LICENSE.txt) licenses.
9
+ */
10
+
11
+ /** Font Family and Sizes */
12
+
13
+ #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
14
+ font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
15
+ }
16
+
17
+ #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
18
+ #qunit-tests { font-size: smaller; }
19
+
20
+
21
+ /** Resets */
22
+
23
+ #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
24
+ margin: 0;
25
+ padding: 0;
26
+ }
27
+
28
+
29
+ /** Header */
30
+
31
+ #qunit-header {
32
+ padding: 0.5em 0 0.5em 1em;
33
+
34
+ color: #8699a4;
35
+ background-color: #0d3349;
36
+
37
+ font-size: 1.5em;
38
+ line-height: 1em;
39
+ font-weight: normal;
40
+
41
+ border-radius: 15px 15px 0 0;
42
+ -moz-border-radius: 15px 15px 0 0;
43
+ -webkit-border-top-right-radius: 15px;
44
+ -webkit-border-top-left-radius: 15px;
45
+ }
46
+
47
+ #qunit-header a {
48
+ text-decoration: none;
49
+ color: #c2ccd1;
50
+ }
51
+
52
+ #qunit-header a:hover,
53
+ #qunit-header a:focus {
54
+ color: #fff;
55
+ }
56
+
57
+ #qunit-banner {
58
+ height: 5px;
59
+ }
60
+
61
+ #qunit-testrunner-toolbar {
62
+ padding: 0.5em 0 0.5em 2em;
63
+ color: #5E740B;
64
+ background-color: #eee;
65
+ }
66
+
67
+ #qunit-userAgent {
68
+ padding: 0.5em 0 0.5em 2.5em;
69
+ background-color: #2b81af;
70
+ color: #fff;
71
+ text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
72
+ }
73
+
74
+
75
+ /** Tests: Pass/Fail */
76
+
77
+ #qunit-tests {
78
+ list-style-position: inside;
79
+ }
80
+
81
+ #qunit-tests li {
82
+ padding: 0.4em 0.5em 0.4em 2.5em;
83
+ border-bottom: 1px solid #fff;
84
+ list-style-position: inside;
85
+ }
86
+
87
+ #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
88
+ display: none;
89
+ }
90
+
91
+ #qunit-tests li strong {
92
+ cursor: pointer;
93
+ }
94
+
95
+ #qunit-tests li a {
96
+ padding: 0.5em;
97
+ color: #c2ccd1;
98
+ text-decoration: none;
99
+ }
100
+ #qunit-tests li a:hover,
101
+ #qunit-tests li a:focus {
102
+ color: #000;
103
+ }
104
+
105
+ #qunit-tests ol {
106
+ margin-top: 0.5em;
107
+ padding: 0.5em;
108
+
109
+ background-color: #fff;
110
+
111
+ border-radius: 15px;
112
+ -moz-border-radius: 15px;
113
+ -webkit-border-radius: 15px;
114
+
115
+ box-shadow: inset 0px 2px 13px #999;
116
+ -moz-box-shadow: inset 0px 2px 13px #999;
117
+ -webkit-box-shadow: inset 0px 2px 13px #999;
118
+ }
119
+
120
+ #qunit-tests table {
121
+ border-collapse: collapse;
122
+ margin-top: .2em;
123
+ }
124
+
125
+ #qunit-tests th {
126
+ text-align: right;
127
+ vertical-align: top;
128
+ padding: 0 .5em 0 0;
129
+ }
130
+
131
+ #qunit-tests td {
132
+ vertical-align: top;
133
+ }
134
+
135
+ #qunit-tests pre {
136
+ margin: 0;
137
+ white-space: pre-wrap;
138
+ word-wrap: break-word;
139
+ }
140
+
141
+ #qunit-tests del {
142
+ background-color: #e0f2be;
143
+ color: #374e0c;
144
+ text-decoration: none;
145
+ }
146
+
147
+ #qunit-tests ins {
148
+ background-color: #ffcaca;
149
+ color: #500;
150
+ text-decoration: none;
151
+ }
152
+
153
+ /*** Test Counts */
154
+
155
+ #qunit-tests b.counts { color: black; }
156
+ #qunit-tests b.passed { color: #5E740B; }
157
+ #qunit-tests b.failed { color: #710909; }
158
+
159
+ #qunit-tests li li {
160
+ margin: 0.5em;
161
+ padding: 0.4em 0.5em 0.4em 0.5em;
162
+ background-color: #fff;
163
+ border-bottom: none;
164
+ list-style-position: inside;
165
+ }
166
+
167
+ /*** Passing Styles */
168
+
169
+ #qunit-tests li li.pass {
170
+ color: #5E740B;
171
+ background-color: #fff;
172
+ border-left: 26px solid #C6E746;
173
+ }
174
+
175
+ #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
176
+ #qunit-tests .pass .test-name { color: #366097; }
177
+
178
+ #qunit-tests .pass .test-actual,
179
+ #qunit-tests .pass .test-expected { color: #999999; }
180
+
181
+ #qunit-banner.qunit-pass { background-color: #C6E746; }
182
+
183
+ /*** Failing Styles */
184
+
185
+ #qunit-tests li li.fail {
186
+ color: #710909;
187
+ background-color: #fff;
188
+ border-left: 26px solid #EE5757;
189
+ }
190
+
191
+ #qunit-tests > li:last-child {
192
+ border-radius: 0 0 15px 15px;
193
+ -moz-border-radius: 0 0 15px 15px;
194
+ -webkit-border-bottom-right-radius: 15px;
195
+ -webkit-border-bottom-left-radius: 15px;
196
+ }
197
+
198
+ #qunit-tests .fail { color: #000000; background-color: #EE5757; }
199
+ #qunit-tests .fail .test-name,
200
+ #qunit-tests .fail .module-name { color: #000000; }
201
+
202
+ #qunit-tests .fail .test-actual { color: #EE5757; }
203
+ #qunit-tests .fail .test-expected { color: green; }
204
+
205
+ #qunit-banner.qunit-fail { background-color: #EE5757; }
206
+
207
+
208
+ /** Result */
209
+
210
+ #qunit-testresult {
211
+ padding: 0.5em 0.5em 0.5em 2.5em;
212
+
213
+ color: #2b81af;
214
+ background-color: #D2E0E6;
215
+
216
+ border-bottom: 1px solid white;
217
+ }
218
+
219
+ /** Fixture */
220
+
221
+ #qunit-fixture {
222
+ position: absolute;
223
+ top: -10000px;
224
+ left: -10000px;
225
+ }