Sublime Forum

Rails vs ruby syntax

#1

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.

0 Likes

#2

[quote=“sheamus”]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.[/quote]

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

[1] github.com/phillipkoebbe/DetectSyntax

0 Likes