From 498edc7730828ba68ee8cd607f0f0ad5db838c0b Mon Sep 17 00:00:00 2001 From: Ilker Cetinkaya Date: Sat, 9 Feb 2013 23:44:45 +0100 Subject: [PATCH] changing strategy of rjs compilation to rjs conf file within source structure to target temp file. --- hyde/ext/plugins/rjs.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hyde/ext/plugins/rjs.py b/hyde/ext/plugins/rjs.py index 27c1776..f225e78 100644 --- a/hyde/ext/plugins/rjs.py +++ b/hyde/ext/plugins/rjs.py @@ -27,11 +27,11 @@ class RequireJSPlugin(CLTransformer): def begin_site(self): """ - Find all the less css files and set their relative deploy path. + Find the rjs conf file and set their relative deploy path. """ for resource in self.site.content.walk_resources(): - if resource.source_file.name_without_extension == "main" and resource.source_file.kind == "js": - new_name = resource.source_file.name_without_extension + "-bin.js" + if resource.source_file.name_without_extension == "rjs" and resource.source_file.kind == "conf": + new_name = "app.js" target_folder = File(resource.relative_deploy_path).parent resource.relative_deploy_path = target_folder.child(new_name) @@ -48,15 +48,14 @@ class RequireJSPlugin(CLTransformer): Read the generated file and return the text as output. Set the target path to have a css extension. """ - if not resource.source_file.kind == 'js' and not resource.source_file.name_without_extension == "main": + if not resource.source_file.kind == 'conf' and not resource.source_file.name_without_extension == "rjs": return rjs = self.app - source = File.make_temp(text) target = File.make_temp('') args = [unicode(rjs)] args.extend(['-o']) - args.extend([unicode(source)]) + args.extend([unicode(resource)]) args.extend([("out=" + target.fully_expanded_path)]) try: self.call_app(args)