haml-more 0.4.0.c → 0.4.0.d
Sign up to get free protection for your applications and to get access to all the features.
- data/vendor/coffee-script/Cakefile +8 -0
- data/vendor/coffee-script/Rakefile +11 -0
- data/vendor/coffee-script/documentation/index.html.erb +85 -50
- data/vendor/coffee-script/documentation/js/aliases.js +1 -1
- data/vendor/coffee-script/documentation/js/arguments.js +1 -1
- data/vendor/coffee-script/documentation/js/array_comprehensions.js +1 -1
- data/vendor/coffee-script/documentation/js/assignment.js +1 -1
- data/vendor/coffee-script/documentation/js/cake_tasks.js +1 -1
- data/vendor/coffee-script/documentation/js/comparisons.js +1 -1
- data/vendor/coffee-script/documentation/js/conditionals.js +1 -1
- data/vendor/coffee-script/documentation/js/embedded.js +1 -1
- data/vendor/coffee-script/documentation/js/existence.js +1 -1
- data/vendor/coffee-script/documentation/js/expressions.js +1 -1
- data/vendor/coffee-script/documentation/js/expressions_assignment.js +1 -1
- data/vendor/coffee-script/documentation/js/expressions_comprehension.js +1 -1
- data/vendor/coffee-script/documentation/js/expressions_try.js +1 -1
- data/vendor/coffee-script/documentation/js/fat_arrow.js +1 -1
- data/vendor/coffee-script/documentation/js/functions.js +1 -1
- data/vendor/coffee-script/documentation/js/heredocs.js +1 -1
- data/vendor/coffee-script/documentation/js/multiple_return_values.js +1 -1
- data/vendor/coffee-script/documentation/js/object_comprehensions.js +1 -1
- data/vendor/coffee-script/documentation/js/object_extraction.js +1 -1
- data/vendor/coffee-script/documentation/js/objects_and_arrays.js +1 -1
- data/vendor/coffee-script/documentation/js/overview.js +1 -1
- data/vendor/coffee-script/documentation/js/parallel_assignment.js +1 -1
- data/vendor/coffee-script/documentation/js/range_comprehensions.js +1 -1
- data/vendor/coffee-script/documentation/js/scope.js +1 -1
- data/vendor/coffee-script/documentation/js/slices.js +1 -1
- data/vendor/coffee-script/documentation/js/soaks.js +1 -1
- data/vendor/coffee-script/documentation/js/splats.js +1 -1
- data/vendor/coffee-script/documentation/js/splices.js +1 -1
- data/vendor/coffee-script/documentation/js/strings.js +1 -1
- data/vendor/coffee-script/documentation/js/super.js +1 -1
- data/vendor/coffee-script/documentation/js/switch.js +1 -1
- data/vendor/coffee-script/documentation/js/try.js +1 -1
- data/vendor/coffee-script/documentation/js/while.js +1 -1
- data/vendor/coffee-script/extras/EXTRAS +9 -1
- data/vendor/coffee-script/extras/coffee-script.js +1 -0
- data/vendor/coffee-script/index.html +83 -48
- data/vendor/coffee-script/lib/cake.js +30 -32
- data/vendor/coffee-script/lib/coffee-script.js +12 -16
- data/vendor/coffee-script/lib/command_line.js +64 -74
- data/vendor/coffee-script/lib/grammar.js +1 -1
- data/vendor/coffee-script/lib/lexer.js +1 -1
- data/vendor/coffee-script/lib/narwhal.js +1 -1
- data/vendor/coffee-script/lib/nodes.js +48 -44
- data/vendor/coffee-script/lib/optparse.js +11 -17
- data/vendor/coffee-script/lib/repl.js +1 -1
- data/vendor/coffee-script/lib/rewriter.js +1 -1
- data/vendor/coffee-script/lib/scope.js +1 -1
- data/vendor/coffee-script/package.json +1 -1
- data/vendor/coffee-script/src/cake.coffee +15 -15
- data/vendor/coffee-script/src/coffee-script.coffee +6 -6
- data/vendor/coffee-script/src/command_line.coffee +43 -39
- data/vendor/coffee-script/src/nodes.coffee +43 -41
- data/vendor/coffee-script/src/optparse.coffee +6 -13
- data/vendor/coffee-script/test/test_destructuring_assignment.coffee +6 -0
- metadata +7 -6
@@ -38,6 +38,14 @@ task 'build:underscore', 'rebuild the Underscore.coffee documentation page', ->
|
|
38
38
|
exec 'uv -s coffeescript -t idle -h examples/underscore.coffee > documentation/underscore.html'
|
39
39
|
|
40
40
|
|
41
|
+
task 'build:browser', 'rebuild the merged script for inclusion in the browser', ->
|
42
|
+
exec 'rake browser'
|
43
|
+
|
44
|
+
|
45
|
+
task 'doc', 'watch and continually rebuild the documentation', ->
|
46
|
+
exec 'rake doc'
|
47
|
+
|
48
|
+
|
41
49
|
task 'test', 'run the CoffeeScript language test suite', ->
|
42
50
|
process.mixin require 'assert'
|
43
51
|
test_count: 0
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'erb'
|
2
2
|
require 'fileutils'
|
3
3
|
require 'rake/testtask'
|
4
|
+
require 'rubygems'
|
5
|
+
require 'yui/compressor'
|
4
6
|
|
5
7
|
desc "Build the documentation page"
|
6
8
|
task :doc do
|
@@ -18,3 +20,12 @@ task :doc do
|
|
18
20
|
sleep 1
|
19
21
|
end
|
20
22
|
end
|
23
|
+
|
24
|
+
desc "Build the single concatenated and minified script for the browser"
|
25
|
+
task :browser do
|
26
|
+
sources = %w(rewriter.js lexer.js parser.js scope.js nodes.js coffee-script.js)
|
27
|
+
code = sources.map {|s| File.read('lib/' + s) }.join('')
|
28
|
+
code = YUI::JavaScriptCompressor.new.compress(code)
|
29
|
+
File.open('extras/coffee-script.js', 'w+') {|f| f.write(code) }
|
30
|
+
end
|
31
|
+
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%
|
2
2
|
require 'uv'
|
3
3
|
def code_for(file, executable=false)
|
4
|
-
@stripper ||= /(\A\(function\(\)\{\n|\}\)\(\);\Z|^ )/
|
4
|
+
@stripper ||= /(\A\(function\(\)\{\n|\}\)\(\);\n*\Z|^ )/
|
5
5
|
return '' unless File.exists?("documentation/js/#{file}.js")
|
6
6
|
cs = File.read("documentation/coffee/#{file}.coffee")
|
7
7
|
js = File.read("documentation/js/#{file}.js").gsub(@stripper, '')
|
@@ -60,6 +60,7 @@
|
|
60
60
|
<a href="#comparisons">Chained Comparisons</a>
|
61
61
|
<a href="#strings">Multiline Strings and Heredocs</a>
|
62
62
|
<a href="#cake">Cake, and Cakefiles</a>
|
63
|
+
<a href="#scripts">"text/coffeescript" Script Tags</a>
|
63
64
|
<a href="#resources">Resources</a>
|
64
65
|
<a href="#change_log">Change Log</a>
|
65
66
|
</div>
|
@@ -107,7 +108,7 @@ alert reverse '!tpircseeffoC'</textarea>
|
|
107
108
|
|
108
109
|
<p>
|
109
110
|
<b>Latest Version:</b>
|
110
|
-
<a href="http://github.com/jashkenas/coffee-script/tarball/0.5.
|
111
|
+
<a href="http://github.com/jashkenas/coffee-script/tarball/0.5.2">0.5.2</a>
|
111
112
|
</p>
|
112
113
|
|
113
114
|
<h2>
|
@@ -138,7 +139,7 @@ alert reverse '!tpircseeffoC'</textarea>
|
|
138
139
|
</h2>
|
139
140
|
|
140
141
|
<p>
|
141
|
-
The CoffeeScript compiler is written in pure CoffeeScript, using a
|
142
|
+
The CoffeeScript compiler is written in pure CoffeeScript, using a
|
142
143
|
<a href="http://github.com/jashkenas/coffee-script/blob/master/src/grammar.coffee">small DSL</a>
|
143
144
|
on top of the <a href="http://github.com/zaach/jison">Jison parser generator</a>, and is available
|
144
145
|
as a <a href="http://nodejs.org/">Node.js</a> utility. The core compiler however,
|
@@ -152,7 +153,7 @@ alert reverse '!tpircseeffoC'</textarea>
|
|
152
153
|
<a href="http://nodejs.org/">Node.js</a>, 0.1.30 or higher. Then clone the CoffeeScript
|
153
154
|
<a href="http://github.com/jashkenas/coffee-script">source repository</a>
|
154
155
|
from GitHub, or download the latest
|
155
|
-
release: <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.
|
156
|
+
release: <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.2">0.5.2</a>.
|
156
157
|
To install the CoffeeScript compiler system-wide
|
157
158
|
under <tt>/usr/local</tt>, open the directory and run:
|
158
159
|
</p>
|
@@ -214,6 +215,14 @@ sudo bin/cake install</pre>
|
|
214
215
|
conjunction with <tt>--watch</tt>)
|
215
216
|
</td>
|
216
217
|
</tr>
|
218
|
+
<tr>
|
219
|
+
<td><code>-s, --stdio</code></td>
|
220
|
+
<td>
|
221
|
+
Pipe in CoffeeScript to STDIN and get back JavaScript over STDOUT.
|
222
|
+
Good for use with processes written in other languages. An example:<br />
|
223
|
+
<tt>cat src/cake.coffee | coffee -s</tt>
|
224
|
+
</td>
|
225
|
+
</tr>
|
217
226
|
<tr>
|
218
227
|
<td><code>-e, --eval</code></td>
|
219
228
|
<td>
|
@@ -717,6 +726,34 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre>
|
|
717
726
|
</p>
|
718
727
|
<%= code_for('cake_tasks') %>
|
719
728
|
|
729
|
+
<h2>
|
730
|
+
<span id="scripts" class="bookmark"></span>
|
731
|
+
"text/coffeescript" Script Tags
|
732
|
+
</h2>
|
733
|
+
|
734
|
+
<p>
|
735
|
+
While it's not recommended for serious use, CoffeeScripts may be included
|
736
|
+
directly within the browser using <tt><script type="text/coffeescript"></tt>
|
737
|
+
tags. The codebase includes a compressed and minified version of the compiler
|
738
|
+
(<a href="extras/coffee-script.js">Download current version here, 43k when gzipped</a>).
|
739
|
+
Include <tt>coffee-script.js</tt> on the page <b>after</b> any <tt>text/coffeescript</tt> tags
|
740
|
+
with inline CoffeeScript, and it will compile and evaluate them in order.
|
741
|
+
</p>
|
742
|
+
|
743
|
+
<p>
|
744
|
+
In fact, the little bit of glue script that runs "Try CoffeeScript" above,
|
745
|
+
as well as jQuery for the menu, is implemented in just this way.
|
746
|
+
View source and look at the bottom of the page to see the example.
|
747
|
+
Including the script also gives you access to <tt>CoffeeScript.compile()</tt>
|
748
|
+
so you can pop open Firebug and try compiling some strings.
|
749
|
+
</p>
|
750
|
+
|
751
|
+
<p>
|
752
|
+
The usual caveats about CoffeeScript apply — your inline scripts will
|
753
|
+
run within a closure wrapper, so if you want to expose global variables or
|
754
|
+
functions, attach them to the <tt>window</tt> object.
|
755
|
+
</p>
|
756
|
+
|
720
757
|
<h2>
|
721
758
|
<span id="resources" class="bookmark"></span>
|
722
759
|
Resources
|
@@ -745,6 +782,15 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre>
|
|
745
782
|
Change Log
|
746
783
|
</h2>
|
747
784
|
|
785
|
+
<p>
|
786
|
+
<b class="header" style="margin-top: 20px;">0.5.2</b>
|
787
|
+
Added a compressed version of the compiler for inclusion in web pages as
|
788
|
+
<br /><tt>extras/coffee-script.js</tt>. It'll automatically run any script tags
|
789
|
+
with type <tt>text/coffeescript</tt> for you. Added a <tt>--stdio</tt> option
|
790
|
+
to the <tt>coffee</tt> command, for piped-in compiles.
|
791
|
+
</p>
|
792
|
+
|
793
|
+
|
748
794
|
<p>
|
749
795
|
<b class="header" style="margin-top: 20px;">0.5.1</b>
|
750
796
|
Improvements to null soaking with the existential operator, including
|
@@ -915,53 +961,42 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre>
|
|
915
961
|
|
916
962
|
</div>
|
917
963
|
|
918
|
-
<script type="text/
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
window.
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
currentNav = null;
|
951
|
-
};
|
952
|
-
nav.click(function(e) {
|
953
|
-
if (e.target.tagName.toLowerCase() == 'a') return;
|
954
|
-
if (this !== (currentNav && currentNav[0])) {
|
955
|
-
closeMenus();
|
956
|
-
currentNav = $(this);
|
957
|
-
currentNav.addClass('active');
|
958
|
-
}
|
959
|
-
return false;
|
960
|
-
});
|
961
|
-
$(document.body).click(function() {
|
962
|
-
closeMenus();
|
963
|
-
});
|
964
|
+
<script type="text/coffeescript">
|
965
|
+
|
966
|
+
window.repl_compile: ->
|
967
|
+
source: $('#repl_source').val()
|
968
|
+
window.compiled_js: ''
|
969
|
+
try
|
970
|
+
window.compiled_js: CoffeeScript.compile source, {no_wrap: true}
|
971
|
+
catch error then alert error
|
972
|
+
$('#repl_results').html window.compiled_js
|
973
|
+
|
974
|
+
window.repl_run: ->
|
975
|
+
try
|
976
|
+
eval window.compiled_js
|
977
|
+
catch error then alert error
|
978
|
+
|
979
|
+
nav: $('.navigation')
|
980
|
+
current_nav: null
|
981
|
+
|
982
|
+
close_menus: ->
|
983
|
+
current_nav.removeClass 'active' if current_nav
|
984
|
+
current_nav: null
|
985
|
+
|
986
|
+
nav.click (e) ->
|
987
|
+
return if e.target.tagName.toLowerCase() is 'a'
|
988
|
+
if this isnt (current_nav and current_nav[0])
|
989
|
+
close_menus();
|
990
|
+
current_nav: $(this)
|
991
|
+
current_nav.addClass 'active'
|
992
|
+
false
|
993
|
+
|
994
|
+
$(document.body).click -> close_menus()
|
995
|
+
|
964
996
|
</script>
|
965
997
|
|
998
|
+
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
|
999
|
+
<script src="extras/coffee-script.js"></script>
|
1000
|
+
|
966
1001
|
</body>
|
967
1002
|
</html>
|