I would want to remove all comments from my ruby/rails program. It may seem like a simple task, but it is not so. Because you need to have your tool implemented as like your language parser which is actually not so easy.
And am in the search of it, to remove comment from ruby/rails. Hoping help from somebody to suggest about proven way to remove all comments from the source file..
I already searched for some options in ruby command, and it is not there. And googled too.. but unable to. So kindly help me out in achieving this..
If i have not communicated the requirement correctly, let me do it now.
I can write Perl programs to remove the comment, but it is tough to handle all the cases such as,
removing single line comment,
removing multi line comment,
removing comments which are in the side of code
It should not remove the code wrongly, because in ruby,
we can access variables using #.
A string which can contain # in it.
And lot other cases which i dont know. As i want to use this way for a sensitive application, the implementation which i do should not affect the code.
So i want to know about a proven tool or best method to remove source from ruby/rails program. Where as for php we have two standard ways as -w option, or a function in php can parse and give the tokens.
For perl, removing comment in perl is by"perltidy -dac".
I am searching for such a standard way for ruby/rails. Thanks for your time.