告诉Netbeans这是一个Ruby文件 [英] Tell Netbeans it's a Ruby file
问题描述
我有一个名为Vagrantfile的文件,它是一个ruby文件,但文件名末尾不能有.rb.
I've got a file named Vagrantfile and it's a ruby file but it cannot have the .rb at the end of the filename.
有没有办法告诉Netbeans它是Ruby文件?
Is there a way to tell Netbeans that it's Ruby file?
推荐答案
在文件"视图中右键单击文件( Ctrl - Shift - 2 或⌘- Shift - 2 ),然后查找"Open As...
".上下文菜单打开时,选择"text/x-ruby
".请注意,这仅在未自动检测到文件类型时有效.
需要注意的是:不带扩展名的文件作为Ruby文件打开后,它将不带扩展名的所有文件都视为Ruby文件.
Right-click the file in Files view (Ctrl-Shift-2 or ⌘-Shift-2) and look for "Open As...
". When the context menu opens, select "text/x-ruby
". Note that this works only when a file type is not detected automatically.
There is a caveat with this: Once a file w/o extension is opened as Ruby file, it treats all files w/o extension as Ruby files.
这篇关于告诉Netbeans这是一个Ruby文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!