Home Download Buy Blog Forum Support

rails vs ruby syntax

rails vs ruby syntax

Postby sheamus on Thu Jun 28, 2012 5:56 am

Is there a way to have my .rb files in my rails project recognized as RoR so that my snippets work? I know I can saw always open files with this extension as RoR files, but I often do just pure Ruby scripting too, so I want files to be recognized a pure ruby as well.

It should be simple to tell if you are in a RoR projects, based on directory structure that file belongs too. I am sure someone has already solved this issue.
sheamus
 
Posts: 19
Joined: Wed May 30, 2012 12:48 am

Re: rails vs ruby syntax

Postby phillip.koebbe on Thu Jun 28, 2012 2:41 pm

sheamus wrote:Is there a way to have my .rb files in my rails project recognized as RoR so that my snippets work? I know I can saw always open files with this extension as RoR files, but I often do just pure Ruby scripting too, so I want files to be recognized a pure ruby as well.

It should be simple to tell if you are in a RoR projects, based on directory structure that file belongs too. I am sure someone has already solved this issue.


Yes, someone has! This was the exact problem DetectSyntax [1] was created to solve.

[1] https://github.com/phillipkoebbe/DetectSyntax
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 20 guests