From 2b9409543e07aa2b778cd7c0f5d25ac99efc8146 Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Wed, 23 Nov 2011 05:51:00 +0530 Subject: [PATCH] Issue 110: Modified combined plugin to process during begin_text_resource --- CHANGELOG.rst | 5 +++++ README.rst | 2 +- hyde/ext/plugins/combine.py | 2 +- hyde/tests/ext/combine/script.3.js | 3 ++- hyde/tests/ext/test_combine.py | 4 +--- hyde/version.py | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6674270..c0f8546 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,8 @@ +Version 0.8.5a3 +============================================================ + +* Bug Fix: Modified combined plugin to process during `begin_text_resource`. (Issue #110) + Version 0.8.5a2 ============================================================ diff --git a/README.rst b/README.rst index b903d94..b1374fb 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -Version 0.8.5a2 +Version 0.8.5a3 A brand new **hyde** ==================== diff --git a/hyde/ext/plugins/combine.py b/hyde/ext/plugins/combine.py index d80d0f0..a610779 100644 --- a/hyde/ext/plugins/combine.py +++ b/hyde/ext/plugins/combine.py @@ -96,7 +96,7 @@ class CombinePlugin(Plugin): "Resource [%s] removed because combined" % r) r.is_processable = False - def text_resource_complete(self, resource, text): + def begin_text_resource(self, resource, text): """ When generating a resource, add combined file if needed. """ diff --git a/hyde/tests/ext/combine/script.3.js b/hyde/tests/ext/combine/script.3.js index ef4b9de..eafcfbc 100644 --- a/hyde/tests/ext/combine/script.3.js +++ b/hyde/tests/ext/combine/script.3.js @@ -1 +1,2 @@ -var c = a + 5; +{% set five = 5 %} +var c = a + {{ five }}; diff --git a/hyde/tests/ext/test_combine.py b/hyde/tests/ext/test_combine.py index 4bee815..629a0cc 100644 --- a/hyde/tests/ext/test_combine.py +++ b/hyde/tests/ext/test_combine.py @@ -65,7 +65,6 @@ combine: --- First line - """) expected = """First line var a = 1 + 2; @@ -73,7 +72,7 @@ var b = a + 3; var c = a + 5; """ - assert text == expected + assert text.strip() == expected.strip() return def test_combine_remove(self): @@ -119,7 +118,6 @@ combine: --- Last line""") - print text assert text == """var a = 1 + 2; var b = a + 3; var c = a + 5; diff --git a/hyde/version.py b/hyde/version.py index 485de3a..fc3a2c0 100644 --- a/hyde/version.py +++ b/hyde/version.py @@ -3,4 +3,4 @@ Handles hyde version TODO: Use fabric like versioning scheme """ -__version__ = '0.8.5a2' +__version__ = '0.8.5a3'