Skip to content
Browse files

changed bin/coffee-script to bin/coffee

  • Loading branch information...
1 parent 6a30d48 commit 3c67d54bbe3e993411564fa50ef8fb3a1e941ad5 @jashkenas jashkenas committed Dec 26, 2009
View
2 README
@@ -26,7 +26,7 @@
gem install coffee-script
Compile a script:
- coffee-script /path/to/script.coffee
+ coffee /path/to/script.coffee
For documentation, usage, and examples, see:
http://jashkenas.github.com/coffee-script/
View
4 Rakefile
@@ -19,15 +19,15 @@ namespace :build do
desc "Compile the Narwhal interface for --interactive and --run"
task :narwhal do
- sh "bin/coffee-script lib/coffee_script/narwhal/*.coffee -o lib/coffee_script/narwhal/js"
+ sh "bin/coffee lib/coffee_script/narwhal/*.coffee -o lib/coffee_script/narwhal/js"
end
end
desc "Build the documentation page"
task :doc do
source = 'documentation/index.html.erb'
- child = fork { exec "bin/coffee-script documentation/coffee/*.coffee -o documentation/js -w" }
+ child = fork { exec "bin/coffee documentation/coffee/*.coffee -o documentation/js -w" }
at_exit { Process.kill("INT", child) }
Signal.trap("INT") { exit }
loop do
View
0 bin/coffee-script → bin/coffee
File renamed without changes.
View
2 coffee-script.gemspec
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.has_rdoc = false
s.require_paths = ['lib']
- s.executables = ['coffee-script']
+ s.executables = ['coffee']
s.files = Dir['bin/*', 'examples/*', 'lib/**/*', 'coffee-script.gemspec', 'LICENSE', 'README']
end
View
18 documentation/index.html.erb
@@ -91,12 +91,12 @@
gem install coffee-script</pre>
<p>
- Installing the gem provides the <tt>coffee-script</tt> command, which can
+ Installing the gem provides the <tt>coffee</tt> command, which can
be used to compile CoffeeScript <tt>.coffee</tt> files into JavaScript, as
well as debug them. In conjunction with
- <a href="http://narwhaljs.org/">Narwhal</a>, the <tt>coffee-script</tt>
+ <a href="http://narwhaljs.org/">Narwhal</a>, the <tt>coffee</tt>
command also provides direct evaluation and an interactive REPL.
- When compiling to JavaScript, <tt>coffee-script</tt> writes the output
+ When compiling to JavaScript, <tt>coffee</tt> writes the output
as <tt>.js</tt> files in the same directory by default, but output
can be customized with the following options:
</p>
@@ -148,7 +148,7 @@ gem install coffee-script</pre>
<td><code>-e, --eval</code></td>
<td>
Compile and print a little snippet of CoffeeScript directly from the
- command line (or from <b>stdin</b>). For example:<br /><tt>coffee-script -e "square: x => x * x."</tt>
+ command line (or from <b>stdin</b>). For example:<br /><tt>coffee -e "square: x => x * x."</tt>
</td>
</tr>
<tr>
@@ -187,10 +187,10 @@ gem install coffee-script</pre>
</p>
<pre>
-coffee-script path/to/script.coffee
-coffee-script --interactive
-coffee-script --watch --lint experimental.coffee
-coffee-script --print app/scripts/*.coffee > concatenation.js</pre>
+coffee path/to/script.coffee
+coffee --interactive
+coffee --watch --lint experimental.coffee
+coffee --print app/scripts/*.coffee > concatenation.js</pre>
<h2>Language Reference</h2>
@@ -470,7 +470,7 @@ coffee-script --print app/scripts/*.coffee > concatenation.js</pre>
<p>
<b class="header" style="margin-top: 20px;">0.1.3</b>
- The <tt>coffee-script</tt> command now includes <tt>--interactive</tt>,
+ The <tt>coffee</tt> command now includes <tt>--interactive</tt>,
which launches an interactive CoffeeScript session, and <tt>--run</tt>,
which directly compiles and executes a script. Both options depend on a
working installation of Narwhal.
View
8 documentation/js/array_comprehensions.js
@@ -1,5 +1,5 @@
(function(){
- var __a, __b, __c, __d, __e, __f, __g, __h, food, i, lunch, row;
+ var __a, __b, __c, __d, __e, __f, __g, __h, __i, __j, __k, __l, food, i, lunch, row;
// Eat lunch.
__a = ['toast', 'cheese', 'wine'];
__d = [];
@@ -17,4 +17,10 @@
__h[__f] = i % 2 === 0 ? highlight(row) : null;
}
__h;
+ // Check the first one hundred combinations.
+ __k = [];
+ for (__l=0, i=1, __j=100; i<=__j; i++, __l++) {
+ __k[__l] = lockpick(combinations[i]);
+ }
+ __k;
})();
View
29 index.html
@@ -159,12 +159,12 @@ <h2 id="installation">Installation and Usage</h2>
gem install coffee-script</pre>
<p>
- Installing the gem provides the <tt>coffee-script</tt> command, which can
+ Installing the gem provides the <tt>coffee</tt> command, which can
be used to compile CoffeeScript <tt>.coffee</tt> files into JavaScript, as
well as debug them. In conjunction with
- <a href="http://narwhaljs.org/">Narwhal</a>, the <tt>coffee-script</tt>
+ <a href="http://narwhaljs.org/">Narwhal</a>, the <tt>coffee</tt>
command also provides direct evaluation and an interactive REPL.
- When compiling to JavaScript, <tt>coffee-script</tt> writes the output
+ When compiling to JavaScript, <tt>coffee</tt> writes the output
as <tt>.js</tt> files in the same directory by default, but output
can be customized with the following options:
</p>
@@ -216,7 +216,7 @@ <h2 id="installation">Installation and Usage</h2>
<td><code>-e, --eval</code></td>
<td>
Compile and print a little snippet of CoffeeScript directly from the
- command line (or from <b>stdin</b>). For example:<br /><tt>coffee-script -e "square: x => x * x."</tt>
+ command line (or from <b>stdin</b>). For example:<br /><tt>coffee -e "square: x => x * x."</tt>
</td>
</tr>
<tr>
@@ -255,10 +255,10 @@ <h2 id="installation">Installation and Usage</h2>
</p>
<pre>
-coffee-script path/to/script.coffee
-coffee-script --interactive
-coffee-script --watch --lint experimental.coffee
-coffee-script --print app/scripts/*.coffee > concatenation.js</pre>
+coffee path/to/script.coffee
+coffee --interactive
+coffee --watch --lint experimental.coffee
+coffee --print app/scripts/*.coffee > concatenation.js</pre>
<h2>Language Reference</h2>
@@ -580,7 +580,10 @@ <h2 id="installation">Installation and Usage</h2>
<span class="Comment"><span class="Comment">#</span> Zebra-stripe a table.</span>
highlight(row) <span class="Keyword">for</span> row, i <span class="Keyword">in</span> table <span class="Keyword">if</span> i <span class="Keyword">%</span> <span class="Number">2</span> <span class="Keyword">is</span> <span class="Number">0</span>.
-</pre><pre class="idle"><span class="Storage">var</span> __a, __b, __c, __d, __e, __f, __g, __h, food, i, lunch, row;
+
+<span class="Comment"><span class="Comment">#</span> Check the first one hundred combinations.</span>
+lockpick(combinations[i]) <span class="Keyword">for</span> i <span class="Keyword">in</span> [<span class="Number">1</span>..<span class="Number">100</span>].
+</pre><pre class="idle"><span class="Storage">var</span> __a, __b, __c, __d, __e, __f, __g, __h, __i, __j, __k, __l, food, i, lunch, row;
<span class="Comment"><span class="Comment">//</span> Eat lunch.</span>
__a <span class="Keyword">=</span> [<span class="String"><span class="String">'</span>toast<span class="String">'</span></span>, <span class="String"><span class="String">'</span>cheese<span class="String">'</span></span>, <span class="String"><span class="String">'</span>wine<span class="String">'</span></span>];
__d <span class="Keyword">=</span> [];
@@ -598,6 +601,12 @@ <h2 id="installation">Installation and Usage</h2>
__h[__f] <span class="Keyword">=</span> i <span class="Keyword">%</span> <span class="Number">2</span> <span class="Keyword">===</span> <span class="Number">0</span> ? highlight(row) : <span class="BuiltInConstant">null</span>;
}
__h;
+<span class="Comment"><span class="Comment">//</span> Check the first one hundred combinations.</span>
+__k <span class="Keyword">=</span> [];
+<span class="Keyword">for</span> (__l<span class="Keyword">=</span><span class="Number">0</span>, i<span class="Keyword">=</span><span class="Number">1</span>, __j<span class="Keyword">=</span><span class="Number">100</span>; i<span class="Keyword">&lt;=</span>__j; i<span class="Keyword">++</span>, __l<span class="Keyword">++</span>) {
+ __k[__l] <span class="Keyword">=</span> lockpick(combinations[i]);
+}
+__k;
</pre><br class='clear' /></div>
<p id="slice">
@@ -889,7 +898,7 @@ <h2 id="change_log">Change Log</h2>
<p>
<b class="header" style="margin-top: 20px;">0.1.3</b>
- The <tt>coffee-script</tt> command now includes <tt>--interactive</tt>,
+ The <tt>coffee</tt> command now includes <tt>--interactive</tt>,
which launches an interactive CoffeeScript session, and <tt>--run</tt>,
which directly compiles and executes a script. Both options depend on a
working installation of Narwhal.
View
10 lib/coffee_script/command_line.rb
@@ -5,15 +5,15 @@
module CoffeeScript
- # The CommandLine handles all of the functionality of the `coffee-script`
+ # The CommandLine handles all of the functionality of the `coffee`
# utility.
class CommandLine
BANNER = <<-EOS
-coffee-script compiles CoffeeScript source files into JavaScript.
+coffee compiles CoffeeScript source files into JavaScript.
Usage:
- coffee-script path/to/script.coffee
+ coffee path/to/script.coffee
EOS
# Seconds to pause between checks for changed source files.
@@ -190,8 +190,8 @@ def parse_options
install_bundle
exit
end
- opts.on_tail('--version', 'display coffee-script version') do
- puts "coffee-script version #{CoffeeScript::VERSION}"
+ opts.on_tail('--version', 'display CoffeeScript version') do
+ puts "CoffeeScript version #{CoffeeScript::VERSION}"
exit
end
opts.on_tail('-h', '--help', 'display this help message') do
View
6 lib/coffee_script/narwhal/coffee-script.coffee
@@ -1,6 +1,6 @@
# This (javascript) file is generated from lib/coffee_script/narwhal/coffee-script.coffee
-# Executes the `coffee-script` Ruby program to convert from CoffeeScript
+# Executes the `coffee` Ruby program to convert from CoffeeScript
# to Javascript. Eventually this will hopefully happen entirely within JS.
# Require external dependencies.
@@ -9,13 +9,13 @@ File: require('file')
Readline: require('readline')
# The path to the CoffeeScript Compiler.
-coffeePath: File.path(module.path).dirname().dirname().dirname().dirname().dirname().join('bin', 'coffee-script')
+coffeePath: File.path(module.path).dirname().dirname().dirname().dirname().dirname().join('bin', 'coffee')
# Our general-purpose error handler.
checkForErrors: coffeeProcess =>
return true if coffeeProcess.wait() is 0
system.stderr.print(coffeeProcess.stderr.read())
- throw new Error("coffee-script compile error").
+ throw new Error("CoffeeScript compile error").
# Run a simple REPL, round-tripping to the CoffeeScript compiler for every
# command.
View
6 lib/coffee_script/narwhal/js/coffee-script.js
@@ -1,19 +1,19 @@
(function(){
var File, OS, Readline, checkForErrors, coffeePath;
- // This (javascript) file is generated from lib/coffee_script/narwhal/coffee-script.coffee Executes the `coffee-script` Ruby program to convert from CoffeeScript
+ // This (javascript) file is generated from lib/coffee_script/narwhal/coffee-script.coffee Executes the `coffee` Ruby program to convert from CoffeeScript
// to Javascript. Eventually this will hopefully happen entirely within JS. Require external dependencies.
OS = require('os');
File = require('file');
Readline = require('readline');
// The path to the CoffeeScript Compiler.
- coffeePath = File.path(module.path).dirname().dirname().dirname().dirname().dirname().join('bin', 'coffee-script');
+ coffeePath = File.path(module.path).dirname().dirname().dirname().dirname().dirname().join('bin', 'coffee');
// Our general-purpose error handler.
checkForErrors = function(coffeeProcess) {
if (coffeeProcess.wait() === 0) {
return true;
}
system.stderr.print(coffeeProcess.stderr.read());
- throw new Error("coffee-script compile error");
+ throw new Error("CoffeeScript compile error");
};
// Run a simple REPL, round-tripping to the CoffeeScript compiler for every
// command.
View
7 lib/coffee_script/nodes.rb
@@ -320,6 +320,13 @@ def exclusive?
@exclusive
end
+ # TODO -- figure out if we can detect if a range runs negative.
+ def downward?
+
+ end
+
+ # TODO -- figure out if we can expand ranges into the corresponding array,
+ # as an expression, reliably.
def compile(o={})
write()
end
View
8 test/unit/test_execution.rb
@@ -7,21 +7,21 @@ class ExecutionTest < Test::Unit::TestCase
def test_execution_of_coffeescript
sources = ['test/fixtures/execution/*.coffee'].join(' ')
- assert `bin/coffee-script -r #{sources}`.match(ALLS_WELL)
+ assert `bin/coffee -r #{sources}`.match(ALLS_WELL)
end
def test_lintless_coffeescript
- lint_results = `bin/coffee-script -l test/fixtures/execution/*.coffee`
+ lint_results = `bin/coffee -l test/fixtures/execution/*.coffee`
assert lint_results.match(NO_WARNINGS)
end
def test_lintless_examples
- lint_results = `bin/coffee-script -l examples/*.coffee`
+ lint_results = `bin/coffee -l examples/*.coffee`
assert lint_results.match(NO_WARNINGS)
end
def test_lintless_documentation
- lint_results = `bin/coffee-script -l documentation/coffee/*.coffee`
+ lint_results = `bin/coffee -l documentation/coffee/*.coffee`
assert lint_results.match(NO_WARNINGS)
end

0 comments on commit 3c67d54

Please sign in to comment.
Something went wrong with that request. Please try again.