From 8efcaf6eec74a3b5d58f161f5f602d64f471cccf Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Mon, 25 Jan 2010 22:22:39 -0500 Subject: [PATCH] moved CoffeeScript.tmbundle to extras and rewrote the installation instructions in plain text --- Rakefile | 2 +- coffee-script.gemspec | 3 ++- .../Preferences/CoffeeScript.tmPreferences | 0 .../Syntaxes/CoffeeScript.tmLanguage | 0 .../CoffeeScript.tmbundle/info.plist | 0 extras/EXTRAS | 20 ++++++++++++++++++ extras/VIM-SYNTAX-HOWTO.md | 21 ------------------- lib/coffee_script/command_line.rb | 8 ++++--- 8 files changed, 28 insertions(+), 26 deletions(-) rename {lib/coffee_script => extras}/CoffeeScript.tmbundle/Preferences/CoffeeScript.tmPreferences (100%) rename {lib/coffee_script => extras}/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage (100%) rename {lib/coffee_script => extras}/CoffeeScript.tmbundle/info.plist (100%) create mode 100644 extras/EXTRAS delete mode 100644 extras/VIM-SYNTAX-HOWTO.md diff --git a/Rakefile b/Rakefile index 85059002..ce2a0b97 100644 --- a/Rakefile +++ b/Rakefile @@ -25,7 +25,7 @@ namespace :build do desc "Compile and install the Ultraviolet syntax highlighter" task :ultraviolet do - sh "plist2syntax lib/coffee_script/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage" + sh "plist2syntax extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage" sh "sudo mv coffeescript.yaml /usr/local/lib/ruby/gems/1.8/gems/ultraviolet-0.10.2/syntax/coffeescript.syntax" end diff --git a/coffee-script.gemspec b/coffee-script.gemspec index df04ad5e..f8a1c08a 100644 --- a/coffee-script.gemspec +++ b/coffee-script.gemspec @@ -22,5 +22,6 @@ Gem::Specification.new do |s| s.require_paths = ['lib'] s.executables = ['coffee'] - s.files = Dir['bin/*', 'examples/*', 'lib/**/*', 'coffee-script.gemspec', 'LICENSE', 'README', 'package.json'] + s.files = Dir['bin/*', 'examples/*', 'extras/**/*', 'lib/**/*', + 'coffee-script.gemspec', 'LICENSE', 'README', 'package.json'] end \ No newline at end of file diff --git a/lib/coffee_script/CoffeeScript.tmbundle/Preferences/CoffeeScript.tmPreferences b/extras/CoffeeScript.tmbundle/Preferences/CoffeeScript.tmPreferences similarity index 100% rename from lib/coffee_script/CoffeeScript.tmbundle/Preferences/CoffeeScript.tmPreferences rename to extras/CoffeeScript.tmbundle/Preferences/CoffeeScript.tmPreferences diff --git a/lib/coffee_script/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage b/extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage similarity index 100% rename from lib/coffee_script/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage rename to extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage diff --git a/lib/coffee_script/CoffeeScript.tmbundle/info.plist b/extras/CoffeeScript.tmbundle/info.plist similarity index 100% rename from lib/coffee_script/CoffeeScript.tmbundle/info.plist rename to extras/CoffeeScript.tmbundle/info.plist diff --git a/extras/EXTRAS b/extras/EXTRAS new file mode 100644 index 00000000..d555e3fb --- /dev/null +++ b/extras/EXTRAS @@ -0,0 +1,20 @@ +This folder includes rough cuts of CoffeeScript syntax highlighters for +TextMate and Vim. Improvements to their lexing ability are always welcome. + +To install the TextMate bundle, run `bin/coffee --install-bundle`, or drop it +into "~/Library/Application Support/TextMate/Bundles". + +To install the Vim highlighter, copy "coffee.vim" into the "syntax" directory of +your vim72, and enable it in either of the following two ways: + + * Manually, by running `:set syntax=coffee` + + * Or automatically, by creating a "filetype.vim" file within "~/.vim", which + contains something along these lines: + + if exists("did_load_filetypes") + finish + end + augroup filetypedetect + au! BufRead,BufNewFile *.coffee setfiletype coffee + augroup END diff --git a/extras/VIM-SYNTAX-HOWTO.md b/extras/VIM-SYNTAX-HOWTO.md deleted file mode 100644 index cf43afa6..00000000 --- a/extras/VIM-SYNTAX-HOWTO.md +++ /dev/null @@ -1,21 +0,0 @@ -##Syntax Highlighting For .coffee Files in vim72 - -After copying the coffee.vim file into the `syntax` directory for your vim72 install, you have two options for enabling syntax highlighting of .coffee files - -### Manually - -In the vim console, do: - - :set syntax=coffee - -### Automagically -The "least intrusive" way to add syntax highlighting for `.coffee` files in vim72 is to create a file (named, say, `filetype.vim`) in your `~/.vim` (or platform appropriate) folder. In it, you would put someting like: - - if exists("did_load_filetypes") - finish - end - augroup filetypedetect - au! BufRead,BufNewFile *.coffee setfiletype coffee - augroup END - -And the next time you open a `.coffee` file, voila! diff --git a/lib/coffee_script/command_line.rb b/lib/coffee_script/command_line.rb index ada64f1b..2427169a 100644 --- a/lib/coffee_script/command_line.rb +++ b/lib/coffee_script/command_line.rb @@ -25,9 +25,11 @@ Usage: # Seconds to pause between checks for changed source files. WATCH_INTERVAL = 0.5 + # Path to the root of the CoffeeScript install. + ROOT = File.expand_path(File.dirname(__FILE__) + '/../..') + # Command to execute in Narwhal - PACKAGE = File.expand_path(File.dirname(__FILE__) + '/../..') - LAUNCHER = "narwhal -p #{PACKAGE} -e 'require(\"coffee-script\").run(system.args);'" + LAUNCHER = "narwhal -p #{ROOT} -e 'require(\"coffee-script\").run(system.args);'" # Run the CommandLine off the contents of ARGV. def initialize @@ -159,7 +161,7 @@ Usage: # Install the CoffeeScript TextMate bundle to ~/Library. def install_bundle bundle_dir = File.expand_path('~/Library/Application Support/TextMate/Bundles/') - FileUtils.cp_r(File.dirname(__FILE__) + '/CoffeeScript.tmbundle', bundle_dir) + FileUtils.cp_r("#{ROOT}/extras/CoffeeScript.tmbundle", bundle_dir) end # Use OptionParser for all the options.