如何使用动态语言工具包(DLTK)将Ruby文件添加到Eclipse 3.6中的现有项目中? [英] How do you add a ruby file to an existing project in Eclipse 3.6 using the Dynamic Languages Toolkit (DLTK)?

查看:101
本文介绍了如何使用动态语言工具包(DLTK)将Ruby文件添加到Eclipse 3.6中的现有项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Eclipse 3.6中安装了Dynamic Languages Toolkit(DLTK)。但是我不知道如何在现有的Java项目中创建Ruby文件。

I've installed the Dynamic Languages Toolkit (DLTK) in Eclipse 3.6. But I can't figure out how to create a Ruby file in an existing Java project.

做明显的事情(新建->空Ruby脚本)只会给出错误消息源文件夹不是正确的项目。我是否必须以某种方式修改项目以告知DLTK可以向其中添加Ruby文件?

Doing the obvious thing (New -> Empty Ruby Script) just gives the error message "Source folder is not a correct project". Do I have to modify the project in some way to tell DLTK that it's OK to add Ruby files to it?

(在Eclipse之外添加文件确实可以。)

(Adding the file outside of Eclipse does work.)

推荐答案

执行以下步骤(对我有用):

Do the following steps (has worked for me):


  1. 创建一个Java项目,或访问现有的Java项目。

  2. 在菜单项中,选择要让ruby文件存在的目录。新文件,然后在对话框中输入文件名 my_file.rb 。必不可少的部分是扩展,因为这将确保已建立红宝石机制。

  3. 输入新的红宝石文件 def 然后按 CTRL-空格,结果将显示带有 def-方法定义(模板)的列表, def 已定义?。这全部是ruby文本编辑器的一部分。

  1. Create a java project, or visit an existing one.
  2. Select in the directory you want the ruby file to live in the menu entry New file and enter in the dialog the filename my_file.rb. The essential part is the extension, because this will ensure that the ruby mechanisms are in place.
  3. Enter in the new ruby file def and press CTRL-SPACE, you should see as a result the list with def - method definition (the template), def and defined?. This is all part of the ruby text editor.

因此可以在同一项目中混合Java和ruby文件,作为自然Java。我唯一注意到的是,运行菜单项仅允许您启动对话框运行方式>运行配置... 并在其中输入必要的参数以启动Ruby脚本。

So it is possible to mix java and ruby files in the same project, that has as nature java. The only thing I has noticed is that the run menu entry only allows you to start the dialog Run As > Run Configurations... and enter there the necessary parameters to start your ruby script.

这篇关于如何使用动态语言工具包(DLTK)将Ruby文件添加到Eclipse 3.6中的现有项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆