How to create file templates and includes

Hi,

I would like to write my own file templates which prefills some parts dynamically, but I couldn't find any good documentation about file templates. Perhaps you can help me for a specific use case: A JavaScript file in "public/javascript/my_namespace/my_class.js" with a file template should produce the following:

MyNameSpace.MyClass = function(){};

So I would like to convert "public/javascript/my_namespace/my_class.js" dynamically into MyNameSpace.MyClass [1] - how to achieve this?

Thank you!


[1] "public/javascript/my_namespace/my_class.js".gsub("public/javascript/",  "").gsub(/\.js$/,"").split("/").map(&:camelize).join(".")

3 comments
Comment actions Permalink

Nobody has done something similar?

0
Comment actions Permalink

Hello Kai,

Unfortunately it isn't possible, please file an issue - http://youtrack.jetbrains.net/issues/ruby

0

Please sign in to leave a comment.