jsc 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.bnsignore +18 -0
- data/.gitignore +23 -3
- data/History.txt +14 -0
- data/LICENSE +20 -0
- data/README.rdoc +15 -27
- data/Rakefile +46 -20
- data/TODO.org +5 -11
- data/VERSION +1 -0
- data/bin/jsc +18 -6
- data/features/run_command.feature +67 -0
- data/features/support/env.rb +8 -0
- data/lib/jsc.rb +1 -1
- data/lib/jsc/closure_compiler.rb +48 -26
- data/lib/jsc/parser.rb +75 -0
- data/spec/jsc_spec.rb +7 -7
- metadata +39 -44
- data/js/extra/alcadialer_im.js +0 -559
- data/js/extra/strophe.js +0 -3543
- data/jsc.gemspec +0 -66
- data/rdoc/classes/JSCompiler.html +0 -649
- data/rdoc/classes/String.html +0 -118
- data/rdoc/created.rid +0 -1
- data/rdoc/files/README_rdoc.html +0 -234
- data/rdoc/files/lib/jsc/closure_compiler_rb.html +0 -151
- data/rdoc/files/lib/jsc_rb.html +0 -101
- data/rdoc/fr_class_index.html +0 -28
- data/rdoc/fr_file_index.html +0 -29
- data/rdoc/fr_method_index.html +0 -38
- data/rdoc/index.html +0 -26
- data/rdoc/rdoc-style.css +0 -208
- data/tmp/aruba/js/compiled_code.js +0 -4
- data/tmp/aruba/js/errors.js +0 -4
- data/tmp/aruba/js/warnings.js +0 -5
data/rdoc/classes/String.html
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: String</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">String</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../files/lib/jsc/closure_compiler_rb.html">
|
59
|
-
lib/jsc/closure_compiler.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
|
86
|
-
</div>
|
87
|
-
|
88
|
-
|
89
|
-
<!-- if includes -->
|
90
|
-
<div id="includes">
|
91
|
-
<h3 class="section-bar">Included Modules</h3>
|
92
|
-
|
93
|
-
<div id="includes-list">
|
94
|
-
<span class="include-name">Term::ANSIColor</span>
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
|
98
|
-
<div id="section">
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<!-- if method_list -->
|
108
|
-
|
109
|
-
|
110
|
-
</div>
|
111
|
-
|
112
|
-
|
113
|
-
<div id="validator-badges">
|
114
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
115
|
-
</div>
|
116
|
-
|
117
|
-
</body>
|
118
|
-
</html>
|
data/rdoc/created.rid
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Mon, 22 Feb 2010 15:12:02 +0100
|
data/rdoc/files/README_rdoc.html
DELETED
@@ -1,234 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>File: README.rdoc</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="fileHeader">
|
50
|
-
<h1>README.rdoc</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>README.rdoc
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Mon Feb 22 14:55:09 +0100 2010</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
<div id="description">
|
72
|
-
<h2>jsc</h2>
|
73
|
-
<p>
|
74
|
-
jsc, JavaScript Compiler
|
75
|
-
</p>
|
76
|
-
<pre>
|
77
|
-
by Davide Saurino
|
78
|
-
http://github.com/sub/jsc
|
79
|
-
</pre>
|
80
|
-
<p>
|
81
|
-
Simple Ruby API to Google Closure Compiler Web service.
|
82
|
-
</p>
|
83
|
-
<h2>Features</h2>
|
84
|
-
<p>
|
85
|
-
With <b>jsc</b> you can compile your JavaScript code throught <a
|
86
|
-
href="http://code.google.com/closure/compiler/">Google Closure Compiler
|
87
|
-
REST service</a>.
|
88
|
-
</p>
|
89
|
-
<p>
|
90
|
-
The package comes with a jsc commands which accepts several options, run:
|
91
|
-
</p>
|
92
|
-
<pre>
|
93
|
-
jsc --help
|
94
|
-
</pre>
|
95
|
-
<p>
|
96
|
-
for help.
|
97
|
-
</p>
|
98
|
-
<p>
|
99
|
-
More in details:
|
100
|
-
</p>
|
101
|
-
<ul>
|
102
|
-
<li>Ruby API actually is a single function call (ex: <a
|
103
|
-
href="../classes/JSCompiler.html#M000003">JSCompiler.compile</a>(file_name,
|
104
|
-
"statistics", "SIMPLE_OPTIMIZATIONS") )
|
105
|
-
|
106
|
-
</li>
|
107
|
-
<li>Handling of JSON responses, parse and print them (same output of the Google
|
108
|
-
web interface!)
|
109
|
-
|
110
|
-
</li>
|
111
|
-
<li>Handling of Server Errors responses
|
112
|
-
|
113
|
-
</li>
|
114
|
-
<li>Compile a piece of code, a file or a whole directory
|
115
|
-
|
116
|
-
</li>
|
117
|
-
<li><b>Emacs snippet</b> to compile code your code for errors and warnings
|
118
|
-
|
119
|
-
</li>
|
120
|
-
</ul>
|
121
|
-
<p>
|
122
|
-
Check <a
|
123
|
-
href="http://code.google.com/intl/it-IT/closure/compiler/docs/api-ref.html">Google
|
124
|
-
API Reference</a> for more info about accepted parameters.
|
125
|
-
</p>
|
126
|
-
<h2>Synopsis</h2>
|
127
|
-
<p>
|
128
|
-
Get compiled code, if no errors are found:
|
129
|
-
</p>
|
130
|
-
<pre>
|
131
|
-
jsc js/compiled_code.js
|
132
|
-
</pre>
|
133
|
-
<p>
|
134
|
-
Compile a file, check for errors:
|
135
|
-
</p>
|
136
|
-
<pre>
|
137
|
-
jsc js/errors.js -e
|
138
|
-
</pre>
|
139
|
-
<p>
|
140
|
-
Compile a file, check for warnings:
|
141
|
-
</p>
|
142
|
-
<pre>
|
143
|
-
jsc js/warnings.js -w
|
144
|
-
</pre>
|
145
|
-
<p>
|
146
|
-
Compile a file and get compression stats:
|
147
|
-
</p>
|
148
|
-
<pre>
|
149
|
-
jsc js/compiled_code.js -s
|
150
|
-
</pre>
|
151
|
-
<p>
|
152
|
-
Compile a piece of code, check for errors:
|
153
|
-
</p>
|
154
|
-
<pre>
|
155
|
-
jsc -e -c "function("
|
156
|
-
</pre>
|
157
|
-
<p>
|
158
|
-
Compile a file and get compiled code if no errors or warnings are found:
|
159
|
-
</p>
|
160
|
-
<pre>
|
161
|
-
jsc js/compiled_code.js -a
|
162
|
-
</pre>
|
163
|
-
<h2>Emacs Snippet</h2>
|
164
|
-
<p>
|
165
|
-
Wants to compile your code right from Emacs?
|
166
|
-
</p>
|
167
|
-
<p>
|
168
|
-
Copy
|
169
|
-
</p>
|
170
|
-
<pre>
|
171
|
-
plugins/jsc.el
|
172
|
-
</pre>
|
173
|
-
<p>
|
174
|
-
to your emacs <em>load-path</em> and restart Emacs.
|
175
|
-
</p>
|
176
|
-
<p>
|
177
|
-
Now, select the code to compile and run:
|
178
|
-
</p>
|
179
|
-
<ul>
|
180
|
-
<li><em>CcJe</em> to check for errors
|
181
|
-
|
182
|
-
</li>
|
183
|
-
<li><em>CcJw</em> to check for warnings.
|
184
|
-
|
185
|
-
</li>
|
186
|
-
</ul>
|
187
|
-
<h2>REQUIREMENTS: (FIX)</h2>
|
188
|
-
<p>
|
189
|
-
jsc requires the <a href="http://gemcutter.org/gems/bones">bones</a> gem.
|
190
|
-
</p>
|
191
|
-
<h2>Install</h2>
|
192
|
-
<p>
|
193
|
-
If you have gemcutter in your gem sources, run:
|
194
|
-
</p>
|
195
|
-
<pre>
|
196
|
-
[sudo] gem install jsc
|
197
|
-
</pre>
|
198
|
-
<h2>Copyright</h2>
|
199
|
-
<p>
|
200
|
-
Copyright (c) 2010 Davide Saurino. See LICENSE for details.
|
201
|
-
</p>
|
202
|
-
|
203
|
-
</div>
|
204
|
-
|
205
|
-
|
206
|
-
</div>
|
207
|
-
|
208
|
-
|
209
|
-
</div>
|
210
|
-
|
211
|
-
|
212
|
-
<!-- if includes -->
|
213
|
-
|
214
|
-
<div id="section">
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
<!-- if method_list -->
|
224
|
-
|
225
|
-
|
226
|
-
</div>
|
227
|
-
|
228
|
-
|
229
|
-
<div id="validator-badges">
|
230
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
231
|
-
</div>
|
232
|
-
|
233
|
-
</body>
|
234
|
-
</html>
|
@@ -1,151 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>File: closure_compiler.rb</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="fileHeader">
|
50
|
-
<h1>closure_compiler.rb</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>lib/jsc/closure_compiler.rb
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Mon Feb 22 11:56:44 +0100 2010</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
|
72
|
-
<div id="requires-list">
|
73
|
-
<h3 class="section-bar">Required files</h3>
|
74
|
-
|
75
|
-
<div class="name-list">
|
76
|
-
rubygems
|
77
|
-
activesupport
|
78
|
-
active_support/core_ext/integer/inflections
|
79
|
-
json
|
80
|
-
net/http
|
81
|
-
term/ansicolor
|
82
|
-
</div>
|
83
|
-
</div>
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
|
88
|
-
</div>
|
89
|
-
|
90
|
-
|
91
|
-
<!-- if includes -->
|
92
|
-
|
93
|
-
<div id="section">
|
94
|
-
|
95
|
-
|
96
|
-
<div id="constants-list">
|
97
|
-
<h3 class="section-bar">Constants</h3>
|
98
|
-
|
99
|
-
<div class="name-list">
|
100
|
-
<table summary="Constants">
|
101
|
-
<tr class="top-aligned-row context-row">
|
102
|
-
<td class="context-item-name">GOOGLE_SERVICE_ADDRESS</td>
|
103
|
-
<td>=</td>
|
104
|
-
<td class="context-item-value">"http://closure-compiler.appspot.com/compile"</td>
|
105
|
-
<td width="3em"> </td>
|
106
|
-
<td class="context-item-desc">
|
107
|
-
Link to Google Closure Compiler service
|
108
|
-
|
109
|
-
</td>
|
110
|
-
</tr>
|
111
|
-
<tr class="top-aligned-row context-row">
|
112
|
-
<td class="context-item-name">DEFAULT_SERVICE</td>
|
113
|
-
<td>=</td>
|
114
|
-
<td class="context-item-value">"compiled_code"</td>
|
115
|
-
<td width="3em"> </td>
|
116
|
-
<td class="context-item-desc">
|
117
|
-
Default output_info parameter
|
118
|
-
|
119
|
-
</td>
|
120
|
-
</tr>
|
121
|
-
<tr class="top-aligned-row context-row">
|
122
|
-
<td class="context-item-name">DEFAULT_LEVEL</td>
|
123
|
-
<td>=</td>
|
124
|
-
<td class="context-item-value">"SIMPLE_OPTIMIZATIONS"</td>
|
125
|
-
<td width="3em"> </td>
|
126
|
-
<td class="context-item-desc">
|
127
|
-
Default compilation_level parameter
|
128
|
-
|
129
|
-
</td>
|
130
|
-
</tr>
|
131
|
-
</table>
|
132
|
-
</div>
|
133
|
-
</div>
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
<!-- if method_list -->
|
141
|
-
|
142
|
-
|
143
|
-
</div>
|
144
|
-
|
145
|
-
|
146
|
-
<div id="validator-badges">
|
147
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
148
|
-
</div>
|
149
|
-
|
150
|
-
</body>
|
151
|
-
</html>
|