[Pkg-javascript-commits] [backbone] 01/12: Helpful error messages on rake tasks

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 16:59:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.3.3
in repository backbone.

commit a98ecc9024c511c00456f5447a076d50ccf83fea
Author: Andrei Bocan <zmaxor at gmail.com>
Date:   Wed Nov 24 02:22:29 2010 +0200

    Helpful error messages on rake tasks
---
 Rakefile | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/Rakefile b/Rakefile
index 6d1b8d4..a77c97d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,10 +1,15 @@
 require 'rubygems'
-require 'closure-compiler'
 
 HEADER = /((^\s*\/\/.*\n)+)/
 
 desc "rebuild the backbone-min.js files for distribution"
 task :build do
+  begin
+    require 'closure-compiler'
+  rescue LoadError
+    puts %{closure-compiler not found.\nInstall it by running 'gem install closure-compiler'}
+    exit
+  end
   source = File.read 'backbone.js'
   header = source.match(HEADER)
   File.open('backbone-min.js', 'w+') do |file|
@@ -14,6 +19,8 @@ end
 
 desc "build the docco documentation"
 task :doc do
+  check('docco', 'docco', 'https://github.com/jashkenas/docco')
+
   system [
     'docco backbone.js',
     'docco examples/todos/todos.js examples/backbone-localstorage.js'
@@ -27,5 +34,15 @@ end
 
 desc "test the CoffeeScript integration"
 task :test do
+  check('coffee', 'CoffeeScript', 'https://github.com/jashkenas/coffee-script.git')
+
   system "coffee test/*.coffee"
-end
\ No newline at end of file
+end
+
+
+def check(exec, name, url)
+  return unless `which #{exec}`.empty?
+
+  puts "#{name} not found.\nGet it from #{url}"
+  exit
+end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list