Permalink
Browse files

First Commit

added setting for a loud failure
  • Loading branch information...
1 parent 2622961 commit 45632a831d3eb4bfec538341dc854c9d4594849e James Farrington committed Oct 4, 2012
Showing with 42 additions and 5 deletions.
  1. +5 −2 AUTHORS
  2. +24 −1 LICENSE
  3. +4 −2 README.rst
  4. +2 −0 coffeescript/exceptions.py
  5. +2 −0 coffeescript/settings.py
  6. +5 −0 coffeescript/templatetags/coffeescript.py
View
@@ -1,6 +1,9 @@
-Andrey Fedoseev <andrey.fedoseev@gmail.com>
+slashRoot Tech Collective
+Justin Holmes
+James Farrington
Contributors:
-Roman Vorushin
+Roman Vorushin
+Andrey Fedoseev <andrey.fedoseev@gmail.com>
View
@@ -1,4 +1,27 @@
-django-coffeescript
+django-coldbrew
+-------------------
+Copyright (c) 2012 django-coldbrew authors (see AUTHORS file)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+django-coldbrew contains code from Andrey Fedoseev's Django Coffeescript
-------------------
Copyright (c) 2011 django-coffeescript authors (see AUTHORS file)
View
@@ -1,5 +1,7 @@
-Django CoffeeScript
-===================
+ColdBrew
+========
+
+django-coldbrew started as a fork of Django Coffeescript.
Django CoffeeScript provides template tags to compile CoffeeScript into JavaScript from templates.
It works with both inline code and extenal files.
@@ -0,0 +1,2 @@
+class ColdBrewCompileError(SyntaxError):
+ pass
@@ -9,6 +9,8 @@
COFFEESCRIPT_MTIME_DELAY = getattr(settings, "COFFEESCRIPT_MTIME_DELAY", 10) # 10 seconds
COFFEESCRIPT_OUTPUT_DIR = getattr(settings, "COFFEESCRIPT_OUTPUT_DIR", "COFFEESCRIPT_CACHE")
+COLDBREW_FAIL_LOUD = getattr(settings, 'COLDBREW_FAIL_LOUD', settings.DEBUG)
+
try:
COFFEESCRIPT_LOCATION = settings.COFFEESCRIPT_LOCATION
except AttributeError:
@@ -2,6 +2,7 @@
from ..settings import COFFEESCRIPT_EXECUTABLE, COFFEESCRIPT_USE_CACHE, \
COFFEESCRIPT_CACHE_TIMEOUT, COFFEESCRIPT_OUTPUT_DIR, POSIX_COMPATIBLE, \
COFFEESCRIPT_LOCATION
+from ..exceptions import ColdBrewCompileError
from django.conf import settings
from django.core.cache import cache
from django.template.base import Library, Node
@@ -97,6 +98,10 @@ def coffeescript(path):
os.remove(os.path.join(output_directory, filename))
elif errors:
logger.error(errors)
+
+ if settings.COLDBREW_FAIL_LOUD:
+ raise ColdBrewCompileError('Compiling %s \n\n %s' % (full_path, errors))
+
return path
# If DEBUG is on, we want to see if a staticfiles directory is at the beginning

0 comments on commit 45632a8

Please sign in to comment.