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(".")
Please sign in to leave a comment.
Nobody has done something similar?
Hello Kai,
Unfortunately it isn't possible, please file an issue - http://youtrack.jetbrains.net/issues/ruby
FYI, I created a ticket: http://youtrack.jetbrains.net/issue/RUBY-6399?projectKey=RUBY