注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

姑射道人的博客

博客新地址:nixuchen.com

 
 
 

日志

 
 

Ruby编辑器  

2014-04-23 17:34:50|  分类: Ruby |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
We write our Rails programs using a programmer’s editor. We’ve found over
the years that different editors work best with different languages and envi-
ronments. For example, Dave originally wrote this chapter using Emacs
because he thinks that its Filladapt mode is unsurpassed when it comes to
neatly formatting XML as he types. Sam updated the chapter using Vim. But
many think that neither Emacs nor Vim is ideal for Rails development.
Although the choice of editor is a personal one, here are some suggestions of
features to look for in a Rails editor:
report erratum ? discuss
Setting Up Your Development Environment ? 9
? Support for syntax highlighting of Ruby and HTML. Ideally support for
.erb files (a Rails file format that embeds Ruby snippets within HTML).
? Support of automatic indentation and reindentation of Ruby source. This
is more than an aesthetic feature: having an editor indent your program
as you type is the best way of spotting bad nesting in your code. Being
able to reindent is important when you refactor your code and move stuff.
(TextMate’s ability to reindent when it pastes code from the clipboard is
very convenient.)
? Support for insertion of common Ruby and Rails constructs. You’ll be
writing lots of short methods, and if the IDE creates method skeletons
with a keystroke or two, you can concentrate on the interesting stuff
inside.
? Good file navigation. As you’ll see, Rails applications are spread across
many files; for example, a newly created Rails application enters the world
containing forty-six files spread across thirty-four directories. That’s before
you’ve written a thing.
You need an environment that helps you navigate quickly between these.
You’ll add a line to a controller to load a value, switch to the view to add
a line to display it, and then switch to the test to verify you did it all right.
Something like Notepad, where you traverse a File Open dialog box to
select each file to edit, just won’t cut it. We prefer a combination of a tree
view of files in a sidebar, a small set of keystrokes that help us find a file
(or files) in a directory tree by name, and some built-in smarts that know
how to navigate (say) between a controller action and the corresponding
view.
? Name completion. Names in Rails tend to be long. A nice editor will let
you type the first few characters and then suggest possible completions
to you at the touch of a key.
We hesitate to recommend specific editors because we’ve used only a few in
earnest and we’ll undoubtedly leave someone’s favorite editor off the list.
Nevertheless, to help you get started with something other than Notepad,
here are some suggestions:
? TextMate was once the Mac OS X de facto standard text editor for Ruby
on Rails.9
9.
http://macromates.com/
Chapter 1. Installing Rails ? 10
report erratum ? discuss
? Sublime Text10 is a cross-platform alternative that some see as the de
facto successor for TextMate.
? Aptana Studio 311 is an integrated Rails development environment that
runs in Eclipse. It runs on Windows, Mac OS X, and Linux. Originally
known as RadRails, it won an award for being the best open source
developer tool based on Eclipse in 2006, and Aptana became the home
for the project in 2007.
? jEdit12 is a fully featured editor with support for Ruby. It has extensive
plugin support.
? Komodo13is ActiveState’s IDE for dynamic languages, including Ruby.
? RubyMine14 is a commercial IDE for Ruby and is available for free to
qualified educational and open source projects. It runs on Windows, Mac
OS X, and Linux.
? NetBeans Ruby and Rails plugin15 is an open source plugin for the popular
NetBeans IDE.
Ask experienced developers who use your kind of operating system which
editor they use. Spend a week or so trying alternatives before settling in.
  评论这张
 
阅读(749)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017