screw_server 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/assets/screw-jshint.js +2 -2
- data/bin/screw_server +2 -0
- data/lib/screw_server/app.rb +3 -3
- data/screw_server.gemspec +1 -1
- metadata +66 -33
- data/assets/vendor/jslint/README +0 -41
- data/assets/vendor/jslint/init_ui.js +0 -178
- data/assets/vendor/jslint/intercept.js +0 -98
- data/assets/vendor/jslint/jslint.html +0 -309
- data/assets/vendor/jslint/jslint.js +0 -6945
- data/assets/vendor/jslint/lint.html +0 -765
data/assets/screw-jshint.js
CHANGED
@@ -36,7 +36,7 @@ $("script").map(function() {
|
|
36
36
|
|
37
37
|
if (Screw.jshint_suites.length > 0) {
|
38
38
|
Screw.Unit(function(){
|
39
|
-
describe("
|
39
|
+
describe("JSHint check", function() {
|
40
40
|
it("should succeed", function() {
|
41
41
|
var message = "";
|
42
42
|
var ajax = Screw.ajax;
|
@@ -51,7 +51,7 @@ if (Screw.jshint_suites.length > 0) {
|
|
51
51
|
if (e) {
|
52
52
|
var line = parseInt(e.line, 10);
|
53
53
|
var character = parseInt(e.character, 10);
|
54
|
-
message += '
|
54
|
+
message += 'JSHint at ' + name + ":" + line + ' character ' +
|
55
55
|
character + ': ' + e.reason + "\n";
|
56
56
|
message += (e.evidence || '').
|
57
57
|
replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1") + "\n";
|
data/bin/screw_server
CHANGED
data/lib/screw_server/app.rb
CHANGED
@@ -179,10 +179,10 @@ module ScrewServer
|
|
179
179
|
|
180
180
|
def url_for_source_file(filename)
|
181
181
|
file = File.expand_path(filename)
|
182
|
-
if file.start_with?(Base.
|
183
|
-
file[Base.code_base_dir.to_s.length..-1]
|
184
|
-
elsif file.start_with?(Base.spec_base_dir.to_s)
|
182
|
+
if file.start_with?(Base.spec_base_dir.to_s)
|
185
183
|
url_for_spec(file[(Base.spec_base_dir.to_s.length + 1)..-1])
|
184
|
+
elsif file.start_with?(Base.code_base_dir.to_s)
|
185
|
+
file[Base.code_base_dir.to_s.length..-1]
|
186
186
|
else
|
187
187
|
raise "file #{file} cannot be checked by jshint since it it not inside the spec or code path: #{Base.code_base_dir} or #{Base.spec_base_dir}"
|
188
188
|
end
|
data/screw_server.gemspec
CHANGED
@@ -2,7 +2,7 @@ require File.expand_path("../bundler_version", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{screw_server}
|
5
|
-
s.version = '0.1.
|
5
|
+
s.version = '0.1.11'
|
6
6
|
s.authors = ["Kristian Hanekamp", "Infopark AG"]
|
7
7
|
s.description = %q{Screw Server - easy javascript unit tests}
|
8
8
|
s.email = %q{kristian.hanekamp@infopark.de}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: screw_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,33 +10,43 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-03-
|
13
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
|
-
- - =
|
20
|
+
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.6.5
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - '='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 1.6.5
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: haml
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
|
-
- - =
|
36
|
+
- - '='
|
32
37
|
- !ruby/object:Gem::Version
|
33
38
|
version: 3.0.13
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - '='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.0.13
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: bundler
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ~>
|
@@ -44,62 +54,92 @@ dependencies:
|
|
44
54
|
version: '1.2'
|
45
55
|
type: :runtime
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.2'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: rack
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
|
-
- - =
|
68
|
+
- - '='
|
54
69
|
- !ruby/object:Gem::Version
|
55
70
|
version: 1.1.0
|
56
71
|
type: :runtime
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - '='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 1.1.0
|
59
79
|
- !ruby/object:Gem::Dependency
|
60
80
|
name: sinatra
|
61
|
-
requirement:
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
62
82
|
none: false
|
63
83
|
requirements:
|
64
|
-
- - =
|
84
|
+
- - '='
|
65
85
|
- !ruby/object:Gem::Version
|
66
86
|
version: '1.0'
|
67
87
|
type: :runtime
|
68
88
|
prerelease: false
|
69
|
-
version_requirements:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - '='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.0'
|
70
95
|
- !ruby/object:Gem::Dependency
|
71
96
|
name: daemons
|
72
|
-
requirement:
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
73
98
|
none: false
|
74
99
|
requirements:
|
75
|
-
- - =
|
100
|
+
- - '='
|
76
101
|
- !ruby/object:Gem::Version
|
77
102
|
version: 1.0.10
|
78
103
|
type: :runtime
|
79
104
|
prerelease: false
|
80
|
-
version_requirements:
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.0.10
|
81
111
|
- !ruby/object:Gem::Dependency
|
82
112
|
name: eventmachine
|
83
|
-
requirement:
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
84
114
|
none: false
|
85
115
|
requirements:
|
86
|
-
- - =
|
116
|
+
- - '='
|
87
117
|
- !ruby/object:Gem::Version
|
88
118
|
version: 0.12.6
|
89
119
|
type: :runtime
|
90
120
|
prerelease: false
|
91
|
-
version_requirements:
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - '='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 0.12.6
|
92
127
|
- !ruby/object:Gem::Dependency
|
93
128
|
name: thin
|
94
|
-
requirement:
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
95
130
|
none: false
|
96
131
|
requirements:
|
97
|
-
- - =
|
132
|
+
- - '='
|
98
133
|
- !ruby/object:Gem::Version
|
99
134
|
version: 1.2.7
|
100
135
|
type: :runtime
|
101
136
|
prerelease: false
|
102
|
-
version_requirements:
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - '='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 1.2.7
|
103
143
|
description: Screw Server - easy javascript unit tests
|
104
144
|
email: kristian.hanekamp@infopark.de
|
105
145
|
executables:
|
@@ -117,12 +157,6 @@ files:
|
|
117
157
|
- assets/screw-server.js
|
118
158
|
- assets/screw.css
|
119
159
|
- assets/vendor/jshint.js
|
120
|
-
- assets/vendor/jslint/init_ui.js
|
121
|
-
- assets/vendor/jslint/intercept.js
|
122
|
-
- assets/vendor/jslint/jslint.html
|
123
|
-
- assets/vendor/jslint/jslint.js
|
124
|
-
- assets/vendor/jslint/lint.html
|
125
|
-
- assets/vendor/jslint/README
|
126
160
|
- assets/vendor/screw-unit/CHANGES
|
127
161
|
- assets/vendor/screw-unit/example/models/cat.js
|
128
162
|
- assets/vendor/screw-unit/example/models/man.js
|
@@ -198,9 +232,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
232
|
version: '0'
|
199
233
|
requirements: []
|
200
234
|
rubyforge_project:
|
201
|
-
rubygems_version: 1.8.
|
235
|
+
rubygems_version: 1.8.25
|
202
236
|
signing_key:
|
203
237
|
specification_version: 3
|
204
238
|
summary: Screw Server
|
205
239
|
test_files: []
|
206
|
-
has_rdoc:
|
data/assets/vendor/jslint/README
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
JSLint, The JavaScript Code Quality Tool
|
2
|
-
|
3
|
-
Douglas Crockford
|
4
|
-
douglas@crockford.com
|
5
|
-
|
6
|
-
2011-04-17
|
7
|
-
|
8
|
-
jslint.js contains the fully commented JSLINT function.
|
9
|
-
|
10
|
-
jslint.html runs the JSLINT function in a web page. The page also depends
|
11
|
-
on adsafe.js [www.ADsafe.org] and json2.js [www.JSON.org] (which are not
|
12
|
-
included in this project) and intercept.js and init_ui.js (which are). The
|
13
|
-
js files should all be minified, and all except init_ui.js are concatenated
|
14
|
-
together to form web_jslint.js.
|
15
|
-
|
16
|
-
intercept.js augments ADsafe, giving widgets access to the clock, cookies,
|
17
|
-
and the JSLINT function.
|
18
|
-
|
19
|
-
init_ui.js hooks the HTML ui components to ADsafe.
|
20
|
-
|
21
|
-
lint.html describes JSLint's usage.
|
22
|
-
|
23
|
-
Direct questions and comments to http://tech.groups.yahoo.com/group/jslint_com/.
|
24
|
-
|
25
|
-
JSLint can be run anywhere that JavaScript (or Java) can run. See for example
|
26
|
-
http://tech.groups.yahoo.com/group/jslint_com/database?method=reportRows&tbl=1
|
27
|
-
|
28
|
-
The place to express yourself in programming is in the quality of your ideas,
|
29
|
-
and the efficiency of execution. The role of style is the same as in
|
30
|
-
literature. A great writer doesn't express himself by putting the spaces
|
31
|
-
before his commas instead of after, or by putting extra spaces inside his
|
32
|
-
parentheses. A great writer will slavishly conform to some rules of style,
|
33
|
-
and that in no way constrains his power to express himself creatively.
|
34
|
-
See for example William Strunk's The Elements of Style
|
35
|
-
[http://www.crockford.com/wrrrld/style.html].
|
36
|
-
|
37
|
-
This applies to programming as well. Conforming to a consistent style
|
38
|
-
improves readability, and frees you to express yourself in ways that matter.
|
39
|
-
JSLint here plays the part of a stern but benevolent editor, helping you to
|
40
|
-
get the style right so that you can focus your creative energy where it is
|
41
|
-
most needed.
|
@@ -1,178 +0,0 @@
|
|
1
|
-
// init_ui.js
|
2
|
-
// 2011-07-19
|
3
|
-
|
4
|
-
// This is the web browser companion to fulljslint.js. It is an ADsafe
|
5
|
-
// lib file that implements a web ui by adding behavior to the widget's
|
6
|
-
// html tags.
|
7
|
-
|
8
|
-
// It stores a function in lib.init_ui. Calling that function will
|
9
|
-
// start up the JSLint widget ui.
|
10
|
-
|
11
|
-
// option = {adsafe: true, fragment: false}
|
12
|
-
|
13
|
-
/*properties check, cookie, each, edition, get, getCheck, getTitle, getValue,
|
14
|
-
has, indent, isArray, join, jslint, length, lib, maxerr, maxlen, on,
|
15
|
-
predef, push, q, select, set, split, stringify, style, target, tree, value
|
16
|
-
*/
|
17
|
-
|
18
|
-
|
19
|
-
ADSAFE.lib("init_ui", function (lib) {
|
20
|
-
"use strict";
|
21
|
-
|
22
|
-
return function (dom) {
|
23
|
-
var table = dom.q('#JSLINT_TABLE'),
|
24
|
-
boxes = table.q('span'),
|
25
|
-
indent = dom.q('#JSLINT_INDENT'),
|
26
|
-
input = dom.q('#JSLINT_INPUT'),
|
27
|
-
jslintstring = dom.q('#JSLINT_JSLINTSTRING'),
|
28
|
-
maxerr = dom.q('#JSLINT_MAXERR'),
|
29
|
-
maxlen = dom.q('#JSLINT_MAXLEN'),
|
30
|
-
option = lib.cookie.get(),
|
31
|
-
output = dom.q('#JSLINT_OUTPUT'),
|
32
|
-
tree = dom.q('#JSLINT_TREE'),
|
33
|
-
predefined = dom.q('#JSLINT_PREDEF');
|
34
|
-
|
35
|
-
function show_jslint_control() {
|
36
|
-
|
37
|
-
// Build and display a /*jslint*/ control comment.
|
38
|
-
// The comment can be copied into a .js file.
|
39
|
-
|
40
|
-
var a = [];
|
41
|
-
|
42
|
-
boxes.each(function (bunch) {
|
43
|
-
var name = bunch.getTitle(),
|
44
|
-
value = ADSAFE.get(option, name);
|
45
|
-
if (typeof value === 'boolean') {
|
46
|
-
a.push(name + ': ' + value);
|
47
|
-
bunch.style('backgroundColor', value ? 'black' : 'white');
|
48
|
-
} else {
|
49
|
-
bunch.style('backgroundColor', 'gainsboro');
|
50
|
-
}
|
51
|
-
});
|
52
|
-
if (typeof option.maxerr === 'number' && option.maxerr >= 0) {
|
53
|
-
a.push('maxerr: ' + String(option.maxerr));
|
54
|
-
}
|
55
|
-
if (typeof option.maxlen === 'number' && option.maxlen >= 0) {
|
56
|
-
a.push('maxlen: ' + String(option.maxlen));
|
57
|
-
}
|
58
|
-
if (typeof option.indent === 'number' && option.indent >= 0) {
|
59
|
-
a.push('indent: ' + String(option.indent));
|
60
|
-
}
|
61
|
-
jslintstring.value('/*jslint ' + a.join(', ') + ' */');
|
62
|
-
|
63
|
-
// Make a JSON cookie of the option object.
|
64
|
-
|
65
|
-
lib.cookie.set(option);
|
66
|
-
}
|
67
|
-
|
68
|
-
function show_options() {
|
69
|
-
indent.value(String(option.indent));
|
70
|
-
maxlen.value(String(option.maxlen || ''));
|
71
|
-
maxerr.value(String(option.maxerr));
|
72
|
-
predefined.value(ADSAFE.isArray(option.predef) ? option.predef.join(',') : '');
|
73
|
-
show_jslint_control();
|
74
|
-
}
|
75
|
-
|
76
|
-
function update_box(event) {
|
77
|
-
|
78
|
-
// Boxes are tristate, cycling true, false, undefined.
|
79
|
-
|
80
|
-
var title = event.target.getTitle();
|
81
|
-
if (title) {
|
82
|
-
ADSAFE.set(option, title,
|
83
|
-
ADSAFE.get(option, title) === true ? false :
|
84
|
-
ADSAFE.get(option, title) === false ? undefined : true);
|
85
|
-
}
|
86
|
-
show_jslint_control();
|
87
|
-
}
|
88
|
-
|
89
|
-
function update_number(event) {
|
90
|
-
var value = event.target.getValue();
|
91
|
-
if (value.length === 0 || +value < 0 || !isFinite(value)) {
|
92
|
-
value = '';
|
93
|
-
ADSAFE.set(option, event.target.getTitle(), undefined);
|
94
|
-
} else {
|
95
|
-
ADSAFE.set(option, event.target.getTitle(), +value);
|
96
|
-
}
|
97
|
-
event.target.value(String(value));
|
98
|
-
show_jslint_control();
|
99
|
-
}
|
100
|
-
|
101
|
-
function update_list(event) {
|
102
|
-
var value = event.target.getValue().split(/\s*,\s*/);
|
103
|
-
ADSAFE.set(option, event.target.getTitle(), value);
|
104
|
-
event.target.value(value.join(', '));
|
105
|
-
show_jslint_control();
|
106
|
-
}
|
107
|
-
|
108
|
-
|
109
|
-
// Restore the options from a JSON cookie.
|
110
|
-
|
111
|
-
if (!option || typeof option !== 'object') {
|
112
|
-
option = {
|
113
|
-
indent: 4,
|
114
|
-
maxerr: 50
|
115
|
-
};
|
116
|
-
} else {
|
117
|
-
option.indent =
|
118
|
-
typeof option.indent === 'number' && option.indent >= 0 ?
|
119
|
-
option.indent : 4;
|
120
|
-
option.maxerr =
|
121
|
-
typeof option.maxerr === 'number' && option.maxerr >= 0 ?
|
122
|
-
option.maxerr : 50;
|
123
|
-
}
|
124
|
-
show_options();
|
125
|
-
|
126
|
-
|
127
|
-
// Display the edition.
|
128
|
-
|
129
|
-
dom.q('#JSLINT_EDITION').value('Edition ' + lib.edition());
|
130
|
-
|
131
|
-
// Add click event handlers to the [JSLint] and [clear] buttons.
|
132
|
-
|
133
|
-
dom.q('input&jslint').on('click', function () {
|
134
|
-
tree.value('');
|
135
|
-
|
136
|
-
// Call JSLint and display the report.
|
137
|
-
|
138
|
-
tree.value(String(lib.jslint(input.getValue(), option, output) / 1000) + ' seconds.');
|
139
|
-
input.select();
|
140
|
-
return false;
|
141
|
-
});
|
142
|
-
|
143
|
-
dom.q('input&tree').on('click', function () {
|
144
|
-
output.value('Tree:');
|
145
|
-
tree.value(JSON.stringify(lib.tree(), [
|
146
|
-
'label', 'id', 'string', 'number', 'arity', 'name', 'first',
|
147
|
-
'second', 'third', 'block', 'else', 'quote', 'type'
|
148
|
-
], 4));
|
149
|
-
input.select();
|
150
|
-
});
|
151
|
-
|
152
|
-
dom.q('input&clear').on('click', function () {
|
153
|
-
output.value('');
|
154
|
-
tree.value('');
|
155
|
-
input.value('').select();
|
156
|
-
});
|
157
|
-
|
158
|
-
|
159
|
-
dom.q('#JSLINT_CLEARALL').on('click', function () {
|
160
|
-
option = {
|
161
|
-
indent: 4,
|
162
|
-
maxerr: 50
|
163
|
-
};
|
164
|
-
show_options();
|
165
|
-
});
|
166
|
-
|
167
|
-
table.on('click', update_box);
|
168
|
-
indent.on('change', update_number);
|
169
|
-
maxerr.on('change', update_number);
|
170
|
-
maxlen.on('change', update_number);
|
171
|
-
predefined.on('change', update_list);
|
172
|
-
input
|
173
|
-
.on('change', function () {
|
174
|
-
output.value('');
|
175
|
-
})
|
176
|
-
.select();
|
177
|
-
};
|
178
|
-
});
|