标签 ruby 下的文章

http://euruko.org/欧洲ruby年会

EuRuKo is an annual conference about the Ruby language with an informal atmosphere and lots of opportunities to listen, to talk, to hack and to have fun.

EuRuKo是Ruby开发语言的一个年会,氛围很自由,在那里可以听到很多,也可以发表自己的观点,主要的是能够快乐.

Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.

Ruby是动态的开源的编程语言,专注于简单高效.它的语法很优雅让人容易看懂.

  • 2011 — berlin
  • 2010 — krakow
  • 2009 — barcelona
  • 2008 — prague
  • 2007 — vienna
  • 2006 — munich
  • 2005 — munich
  • 2004 — stuttgart
  • 2003 — karlsruhe

阅读剩余部分

最近在倒腾ruby,可是在配置环境这个环节总是卡住,感觉很麻烦。所然有rvm这样的工具辅助,但是还是感觉很麻烦。就拿这次的事情来说。在安装RVM时,如果不是以root身份安装,安装的目录就会不同,而且还会产生附带的很多问题。

1.notepad++ 简单介绍

notepad++可能大家都不陌生吧,它是一个很强大的编辑器,它的特性是,开放源代码, 支持多语言的,但是它目前只能运行在Windows平台下(缺点,都4.6的版本,还没看到能在其他os上的版本)。大家用过ruby下自带的SciTE吧,它使用的是 Scintilla edit component ,其实官方网站上说 SciTE本来只是作为Scintilla edit component 推广用的一个Demo。呵呵,notepad++也使用Scintilla edit component,所以感觉像是2兄弟。

notepad++的具体特征我就不详细说了,大家可以去网站看看:
http://notepad-plus.sourceforge.net/uk/site.htm

2.ruby 在 notepad++ 上飞翔
在这之前,我建议大家下载 最新版本4.6, 压缩的包只有1M多。我是下载zip,解压就可以用的(够绿色)。

启动notepad++:

创建一个新rb文件

点击菜单上的Run?

no, no, no 在这里是不行的,不像SciTE, 我们得需要来配置下一个非常棒的插件。

去这个地方:  http://sourceforge.net/projects/npp-plugins/files/

3.军刀 NppExec 插件
瑞士的军刀大家都晓得,比着是方便,好用的工具吧。 我们notepad++下面的NppExec也算是一把军刀呢。它的功能就是执行代码,不过如何执行,请听我下面慢慢讲解.

小心按坏F6, :), 按下快键 F6 ,将出现下面窗口(NppExec),在窗口中输入:
ruby $(FULL_CURRENT_PATH)  (一定要到当前的目录)

点击ok,  啊哦,ruby: No such file or directory -- new (LoadError)

(在运行之前一定要保存,才可以看见当前的代码的效果哦,人家是读文件来解释的)
呵呵 老兄你忘了保存(注:不要保存在有空格的目录下),save and ok again, 结果出来了。

随后,我们可以保存这个Command 为Ruby Run, 这样以后就直接按F6点ok(如果一建就能执行默认的command就好了)。

4. Rails 在 notepad++ 上奔跑
除了NppExec插件,我们还有Light Explorer 插件(这些插件都是默认安装在npp 4.6上的). ok, 找到你的project directory path, 按F6, 我们创建一个GO TO PROJECT(我暂时只想到这个name, Save Command的时候输入这个name), 创建一个Command, 脚本为:CD X:xxxxxxxxx (你的rails的project根目录)。  ok 执行一下。

下面,我们创建一个Run Server 的Command,  按F6, 脚本: ruby script/server



如何快捷,批量的创建和删除Command(界面上没有delete按钮):
你也可以在npp的 pluginsConfig 目录下找到 npes_saved.txt 和npes_temp.txt 文件,打开它们,自己看了哈。下面是我的 npes_save.txt:

::Ruby Run
ruby $(FULL_CURRENT_PATH)

::GO to Project Directory
CD D:tempMy DocumentsNetBeansProjectsRailsDemo

::Run Server
ruby script/server

::Rails Destroy Template
ruby script/destroy --help

::Rails Generate Template
ruby script/generate --help

补充: pluginsdocNppExec.txt 有详细的关于NppExec的说明。

5. *.erb  在notepad++ 漫步

当用npp打开erb的时候,npp把它当作一般的normal text格式文件,所以没有语法高亮,不过你可以点击menu->language->html,马上*.erb就可以漫步了。

总结,notepad++上还有好一些插件,感觉还不错, 如果不喜欢java ide的同学,喜欢速度快的ide的同学们,不妨考虑使用一下这种方式来develop (应该不光是ruby,其他语言也一样可以配置)

共同学习:Functions List这个插件应该是类是自动完成,不过我在pluginsAPIs目录下 创建了一个erb.api,添加了一些常用的字串, 但打开erb文件还是无法在Functions list中看到。我已经给这个插件作者发送了一份email,等待他的答复

lemonzc
Symbio Chengdu

本文转自javaeye,经过一些修改

from his blog:   http://kunal.kundaje.net/2007/07/notepad-and-the-ruby-blue-style/

I enjoy using Visual Studio as an all-in-one IDE for Windows programming, but when I’m writing code for the web, I prefer simpler text editors. I’ve tried many, and eventually settled on Notepad++ sometime last year.

What I really like about Notepad++ (besides the fact that it’s free) is how lightweight it is. It fires up instantly, just like classic Notepad does, and at the same time includes all the features that I want, including syntax highlighting, auto-completion, brace matching and auto-indentation, tabs, support for regular expressions, macros etc.

Notepad++ - Ruby Blue

As I was working on a project this morning, it occurred to me that I should mention a custom syntax highlighting style called Ruby Blue that I’ve been using (image above, courtesy of the author). It’s quite surprising how beneficial a good font and syntax highlighting scheme can be, and Ruby Blue, coupled with DejaVu Sans Mono or Consolas, works very well for me.

The Ruby Blue style is also available for Vim and TextMate.

Do you have a favorite text editor, monospace font, and syntax highlighting scheme?