<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog@Surfulater &#187; ED for Windows</title>
	<atom:link href="http://blog.surfulater.com/category/ed-for-windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.surfulater.com</link>
	<description>Surfulater, the journey continues...</description>
	<lastBuildDate>Thu, 09 Feb 2012 00:56:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Get up and running with TortoiseSVN and Subversion in 15 minutes.</title>
		<link>http://blog.surfulater.com/2007/02/28/get-up-and-running-with-tortoisesvn-and-subversion-in-15-minutes/</link>
		<comments>http://blog.surfulater.com/2007/02/28/get-up-and-running-with-tortoisesvn-and-subversion-in-15-minutes/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 14:04:03 +0000</pubDate>
		<dc:creator>nevf</dc:creator>
				<category><![CDATA[ED for Windows]]></category>

		<guid isPermaLink="false">http://blog.surfulater.com/2007/02/28/get-up-and-running-with-tortoisesvn-and-subversion-in-15-minutes/</guid>
		<description><![CDATA[Subversion is the most popular free, cross platformÂ Version Control Systems (VCS) available today. It also happens to be open source, is being actively developed and has a strong community behind it. To quote from the Subversion Web site: &#8220;The goal &#8230; <a href="http://blog.surfulater.com/2007/02/28/get-up-and-running-with-tortoisesvn-and-subversion-in-15-minutes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://subversion.tigris.org/" target="_blank">Subversion</a> is the most popular free, cross platformÂ Version Control Systems (VCS) available today. It also happens to be open source, is being actively developed and has a strong community behind it.</p>
<p>To quote from the Subversion Web site:</p>
<blockquote><p>&#8220;The goal of the Subversion project is to build a version control system that is a compelling replacement for CVS in the open source community. The software is released under an Apache/BSD- style open source license.&#8221;</p></blockquote>
<p>Version Control gives you a time machine for your files, enabling you to go back in time to any earlier version, see what changes have been made over time, and revert your work to an earlier version if need be. It also gives you an audit trail of changes and a commented history of those changes, amongst other capabilities.</p>
<p>The easiest way to use Subversion in Microsoft Windows is to use <a href="http://tortoisesvn.tigris.org/" target="_blank">TortoiseSVN</a>Â  To quote from the TortoiseSVN site:</p>
<blockquote><p>&#8220;TortoiseSVN is a really easy to use Revision control / version control / source control software for Windows. Since it&#8217;s not an integration for a specific IDE you can use it with whatever development tools you like.&#8221;</p></blockquote>
<p>TortoiseSVNÂ Â is a GUI client shell around SubversionÂ and most anything that can be done on Subversion can be done in TortoiseSVN. TortoiseSVN (TSVN) includes Subversion (SVN), so you don&#8217;t necessarily need to download and install it.Â  I&#8217;m very pleased to say that both SVN and TSVN are very well documented, which is atypical in the open source world. As much documentation as there is, I still found it difficult to both comprehend how SVN works and to start using it.<span id="more-86"></span></p>
<p>I&#8217;ve been using a Version Control System for many years, so I understand the basics, however Subversion takes a different approach to what I&#8217;m so used to, which is part of the reason I&#8217;ve been stumbling along. The main areas of difference is that SVN works at the <em>directory level</em> and I&#8217;m used to working at the <em>file level</em>. And I&#8217;m used to having files that are checked out being <em>&#8220;locked&#8221;</em> so other users can&#8217;t edit them, but SVN doesn&#8217;t use this model, although it is available.</p>
<p>The intent of this article is to both help me in my quest to better understand SVN/TSVN and to also help folks who find themselves in this same situation.</p>
<p>By the end of this article you will know how to setup and use TortoiseSVN with your <em>existing projects</em>, and hopefully get there without facing the same hurdles I did. You will also know how to use TortoiseSVN with our Programmer&#8217;s IDE <a href="http://www.getsoft.com" target="_blank">ED for Windows</a>.</p>
<p>Lets get started and work through setting up TortoiseSVN, placing files under version control and then working with those files. Note that my discussion will revolve around version control use by a single person, so you will need to do some further reading regards multi-person and team use. I&#8217;m also focusing on setting up TSVN/SVN to use an existing directory tree of files, not creating a new project from scratch.</p>
<p><strong>Installing TortoiseSVN</strong></p>
<p>Step one is to download and install TortoiseSVN which you will find here <a href="http://tortoisesvn.net/downloads">http://tortoisesvn.net/downloads</a></p>
<p>TortoiseSVN integrates into Windows Explorer and is used via. <em>right click</em> context menu&#8217;s in Explorer and other applications such as our ED4W. Once TSVN is installed you can right click anywhere in Windows Explorer and choose <strong>TortoiseSVN|Help</strong> to read the detailed product help.</p>
<p><strong>Creating a Repository</strong></p>
<p>Step two is to Create a Repository to hold your versioned files. An SVN Repository is created in a folder on your local drive or on a networked drive. The repository contains a virtual file system where all of the files you place under version control are held and maintained, along with other <em>metadata</em> such as comments you add about file changes. A repository can be moved to a different location and of course backed up.</p>
<p>There are three ways to access an SVN repository. The simplest and the one I&#8217;ll be using in this article is to treat it as a local file system. The other two enable repositories to be stored on remote servers and accessed over the Internet. All three methods use a URL to access the repository, either file://, svn:// or http:// plus secure versions of these such as https://.</p>
<p>You need to decide where you want the repository created <em>(which drive and base folder)</em>, then create a new folder to hold it. Right click on this new folder in Windows Explorer and choose TortoiseSVN|Create repository here&#8230; For this article the repository is in c:\svnrepos.</p>
<div style="text-align: center"><img src="http://blog.surfulater.com/images/tsvn-createmenu.jpg" /></div>
<p>Â </p>
<p>Leave the default &#8216;Native filesystem (FSFS)&#8217; selected and click OK.</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-createrepotype.jpg" /></p>
<p>To learn about suggested Repository Layouts see Chapter 5.2.1 in the TSVN Help.</p>
<p>To create the example repository layout I&#8217;m using for this article follow these steps:</p>
<ol>
<li>Right click on c:\svnrepos and select TortoiseSVN|Repo-browser.</li>
<li>Right click on &#8220;file:///C:/svnrepos&#8221; in the Browser window and select &#8216;Create Folder&#8230;&#8217;</li>
<li>Enter a name based on the project you want to use. eg. &#8220;Ruler&#8221;</li>
<li>Create three folders in this project folder: &#8220;trunk&#8221;, &#8220;branches&#8221; and &#8220;tags&#8221;</li>
</ol>
<p>You should now have:</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-repofolders.jpg" /></p>
<p align="center">Â </p>
<p><strong>The &#8220;Working Copy&#8221;</strong></p>
<p>In addition to the SVN Repository each SVN user has their own &#8220;Working Copy&#8221; of the repository. This is where you edit files and create new files etc. Note that you never access files in the repository directly, only via. the working copy. In fact if your peak inside the repository with Windows Explorer you can&#8217;t even see your files.</p>
<p><strong>Adding an existing set of files to the repository</strong></p>
<p>Our next step is to our add existing files to the SVN repository we just created, so that they can be put under version control. There are two ways to do this.</p>
<p>The commonly suggested method is to use Import &#8211; see TSVN Chapter 5.2.2. TortoiseSVN|Import&#8230;Â will import an entire directory tree, including all files, into the repository. I don&#8217;t like this approach because you have to <em>Checkout</em> the files to create your &#8216;Working Copy&#8217;, which is fine, except that you can only checkout into an <em>empty directory</em>. This means that if you aren&#8217;t putting all files and folders within a directory tree, under version control, you will have to merge the missing files and folders from their original home into the newly created working copy, which is messy and error prone.</p>
<p>The second method is to use TortoiseSVN|Repo-browser and Checkout the trunk folder <em>(or a sub-folder)</em> to the base of the directory tree containing our existing files and then Commit that directory to TSVN.</p>
<p>For this example I&#8217;ve created a Folder named &#8220;RulerSrc&#8221; within the &#8220;trunk&#8221; folder and my existing tree of source files is located in D:\MFC\Ruler. Right click on &#8220;RulerSrc&#8221; in Repo-browser and select Checkout.</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-repocheckout.jpg" /></p>
<p>The &#8216;URL of repository&#8217; will already be set correctly and for &#8216;Checkout directory&#8217; enter &#8220;D:\mfc\Ruler&#8221; and press OK. Then press &#8220;Yes&#8221;Â  at the &#8220;D:\mfc\Ruler&#8221; isn&#8217;t empty prompt. Windows Explorer will now show &#8220;D:\mfc\Ruler&#8221; with a checkout overlay image.</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-explorercheckout1.jpg" /></p>
<p>Â </p>
<p>Now we need to add the files and folders for &#8220;D:\mfc\Ruler&#8221; to the repository. This is where I faced my biggest hurdle, as I didn&#8217;t want to include all of the files and folders in my existing directory tree in the repository. I&#8217;m referring to temporary files, such as compiler output files and entire directories such as \Debug and \Release. It took lots of reading and a few posts to the TSVN mailing list before I knew how to handle this.</p>
<p><strong>Excluding files and folders from the repository</strong></p>
<p>It was clear from my reading that you use &#8216;Add to ignore list&#8217; to inform SVN about which files and folders you don&#8217;t want added to the repository. However before &#8216;Add to ignore list&#8217; can be used on a file or a folder, the parent folder must be added to SVN. As I commented on the mailing list: <em>&#8220;This just seems backwards. ie. I have to &#8216;Add&#8217; things before I can &#8216;Remove&#8217; sub-things.&#8221;</em> It would be far simpler if I could simply submit a list of files and folder paths to ignore, to a folder in the SVN repository.</p>
<p>The <a href="http://svnbook.red-bean.com/" target="_blank">SVN Book</a> and TSVN Help both state that you use the Ignore option before using Import or Add, but neither tell you that you can only use Ignore (svn:ignore) on folders that SVN is already aware of. It is basically a <em>chicken and egg</em> situation. See the FAQ item <a href="http://tortoisesvn.net/node/248" target="_blank">How Can I select files and folders to import</a>.Â </p>
<p>TSVN/SVN does enable you to specify a <strong>Global list</strong> of files and folders to exclude, however this list affects every SVN repository that you create, every project in every repository and every user using the repository. This is fine for files that makes sense to be ignored on a global basis, such as transient and temporary compiler output files, but is too course grained for other exclusion requirements. That said you should definitely setup the TortoiseSVN|Settings|General|Global ignore pattern. Do this now before proceeding. See TSVN Chapter 5.26.1. for details.</p>
<p align="center"><img title="Gloabl ignore settings" alt="Gloabl ignore settings" src="http://blog.surfulater.com/images/tsvn-globalignore.jpg" /></p>
<p>Â </p>
<p><strong>Adding and excluding files and folders</strong></p>
<p>So back to ignoring files on a per project and per user basis. As I stated above we need start by Adding all of the folders and files we want included in the repository. To do this use TortoiseSVN|Add.</p>
<p>An important point to be aware of is that &#8220;Add&#8221; doesn&#8217;t actually add anything to the repository. In fact you don&#8217;t even need access to the repository to use Add, which is an important capability for folks that create new files, but aren&#8217;t always connected to the repository. Add simply adds the chosen file or folder name to a list, which is stored in the .svn directories of your local &#8216;working copy&#8217;. When you next Commit your changes, this list is used to help build the list of files to be committed.</p>
<p>Note that TSVN works with three categories of files; Versioned files <em>(those in the repository),</em> Unversioned files <em>(files which aren&#8217;t in the repository)</em> and Ignored files <em>(unversioned files which are ignored during Add, Commit etc)</em>.</p>
<p>Apart from adding the files and folders <em>&#8220;you do want&#8221;</em> in the repository, you must also add all of the folders that contain files that <em>&#8220;you don&#8217;t want&#8221;</em> in the repository. Only then can you use &#8216;Add to ignore list&#8217; for every folder and file that you want excluded from the commit process, and hence the repository.</p>
<p>Don&#8217;t add folders for directory trees that you don&#8217;t want in the repository. Add their parent folder and then use &#8216;Add to ignore list&#8217; on the folder to exclude it and its sub-directories.</p>
<p>You don&#8217;t actually have to add files here as you can select them when you do the commit. Use whatever works best for you. Folders are the important thing, so we can use &#8216;Add to ignore list&#8217; on files in any required folder.</p>
<p>If you add a file by mistake use TortoiseSVN|Revert&#8230; to remove it from the &#8216;add list&#8217;. And if you ignore a file and then change your mind, use TortoiseSVN|Remove from ignore list.</p>
<p>Note that &#8216;Add to ignore list&#8217; is not available for files or folders that match the Global ignore list patterns, nor for files added to the queue.</p>
<p>Once you&#8217;ve completed the Add and Ignore processes you can finally get the files into the repository.</p>
<p>This picture shows the overlay images in Windows Explorer after we&#8217;ve added files and before they are committed.</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-exploreradd.jpg" /></p>
<p><strong>Getting committed</strong></p>
<p>Whenever you want to update the SVN repository so that it includes the changes you&#8217;ve made in your &#8216;working copy&#8217; you need to commit your changes. To do thisÂ right click on &#8220;D:\MFC\Ruler&#8221; in Explorer and select &#8216;SVN Commit&#8230;&#8217; from the context menu.</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-commitdlg.jpg" /></p>
<p>In the Commit Dialog write a message stating the reason for this commit. Enable &#8216;Show unversioned files&#8217; if necessary and verify that all of the files you want to place under version control are checked, then click OK. Commit then adds all of our existing files and folders to the repository and Explorer changes as shown here. The Debug folder is in the <em>ignore</em> list, which explains its overlay image.</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-explorercommit.jpg" /></p>
<p>Â </p>
<p>To verify the contents of the repository use TortoiseSVN|Repo-browser.</p>
<p>Following this second method enablesÂ you to use your existing files and folders <em>as is</em>, without the issues raised if you were to use Import. I borrowed this from technique from <a href="http://blog.surfulater.com/wp-admin/http:%20/subversion.tigris.org/faq.html#in-place-import" target="_blank">here</a>.</p>
<p>Â </p>
<p><strong>Working with the Repository</strong></p>
<p>Ok so now we have an existing project under version control, what next.</p>
<ul>
<li>Note: In the scenario I&#8217;m writing about here, we have a &#8220;Working Copy&#8221; in place, but if you don&#8217;t, you need to Checkout the relevant directory tree from the repository into an <em>empty directory</em> to create your working copy. Use TortoiseSVN|Repo-browser for this.</li>
</ul>
<p>You can now edit your files as you normally would. If you create a new file you can use TortoiseSVN|Add to add it to the pending queue, or alternativelyÂ select the file from the <em>non-versioned</em> list of files at the next commit.</p>
<p>You can see the changes you&#8217;ve made during editing by viewing what&#8217;s different between it and a versioned copy of the file in the repository. TortoiseSVN|Diff does this. Diff is also on the right click context menu inside TortoiseSVN|Commit&#8230; and TortoiseSVN|Check for modifications&#8230;</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-diffmenu.jpg" /></p>
<p>This picture shows the TortoiseSVN context menuÂ activated on the current file in <a href="http://www.getsoft.com" target="_blank">ED for Windows</a>, ready to do a Diff.</p>
<p>You can use EDs Difference Analysis to view and merge differences by adding it to TSVN. Use TortoiseSVN|Settings|External Programs|Diff Viewer and set the External option along with:<br />
&#8220;C:\Program Files\SAIG\ED4W\ED32.exe&#8221; -1- -np -nf -diff %base %mine<br />
as shown here.</p>
<p align="center"><img title="Setup TSVN to use ED's Diff and Merge" alt="Setup TSVN to use ED's Diff and Merge" src="http://blog.surfulater.com/images/tsvn-diffviewer.jpg" /></p>
<p>See TSVN Help section: 5.9. &#8220;Viewing Differences&#8221; for more information.</p>
<p>When you are satisfied with your editing and want to update the repository so that it includes your changes, it is time to commit the file. If you&#8217;ve edited a number of files or added some new files, then it is best to commit the base folder. ie. Right click on the folder in Explorer or EDs Files Tree and choose: SVN Commit&#8230; If you just want to commit the changes for a single file, then you can do that as well by selecting the file in Explorer or ED and using SVN Commit&#8230;</p>
<p>If you are working with other users then you need to use SVN Update to resolve any conflicts that come about from someone else editing the same files as you have. See TSVN Chapter 5.5. &#8220;Update Your Working Copy With Changes From Others&#8221; for details.</p>
<p>Â </p>
<p><strong>Using ED for WindowsÂ with TortoiseSVN</strong></p>
<p>The Windows Explorer TortoiseSVN menu commands can be used directly inside <a href="http://www.getsoft.com" target="_blank">ED for Windows</a>. This enables you to commitÂ a file orÂ a folder, update it, view differences etc.</p>
<p>TortoiseSVN is available from EDs <strong>Explorer</strong> context menu. To open ED&#8217;s Explorer menu <em>right click</em> on whitespace in an editing window, use File|Explorer or right click on a file in the Project window. To access the Explorer menu for a Folder, right click on the Folder in ED&#8217;s Files Tree (File|Files Workspace).</p>
<p align="center"><img src="http://blog.surfulater.com/images/tsvn-edcommit.jpg" /></p>
<p>Â </p>
<p>You can also execute any TortoiseSVN command directly from ED using <em>TortoiseProc.exe</em> as documented in the TSVN Help: Appendix D. Automating TortoiseSVN</p>
<p>To open the TSVN Repository Browser from ED, for a specific repository, you can use:<br />
File|Run Program&#8230; &#8220;C:\Program Files\TortoiseSVN\bin\TortoiseProc&#8221; /command:repobrowser /path:&#8221;<em>uri/to/repository</em>&#8221; /notempfile</p>
<p>This could be setup as an ED Macro or on a Toolbar button. You could also get ED to prompt for the repository URL.</p>
<p>To commit the current file you would use:<br />
&#8220;C:\Program Files\TortoiseSVN\bin\TortoiseProc&#8221; /command:commit /path:&#8221;&lt;name&gt;&#8221; /notempfile /closeonend</p>
<p>Again this can be assigned to a toolbar button, menu etc.</p>
<p>Â </p>
<p><strong>Finale</strong></p>
<p>The focus of this article is to help you get an existing code base set up under version control as quickly and easily as possible. However there is a lot more to TortoiseSVN and Subversion than what I&#8217;ve covered here. I would urge you to read the Subversion Book and the TortoiseSVN Help thoroughly before committing yourself and your team to using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.surfulater.com/2007/02/28/get-up-and-running-with-tortoisesvn-and-subversion-in-15-minutes/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Write Ruby code faster with ED for Windows</title>
		<link>http://blog.surfulater.com/2007/02/21/write-ruby-code-faster-with-ed-for-windows/</link>
		<comments>http://blog.surfulater.com/2007/02/21/write-ruby-code-faster-with-ed-for-windows/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 09:37:00 +0000</pubDate>
		<dc:creator>nevf</dc:creator>
				<category><![CDATA[ED for Windows]]></category>

		<guid isPermaLink="false">http://blog.surfulater.com/2007/02/21/write-ruby-code-faster-with-ed-for-windows/</guid>
		<description><![CDATA[Ruby is the most expressive and interesting language I&#8217;ve come across in all these years of developing our programmer&#8217;s editor/ide ED for Windows. It takes Object Oriented programming and Dynamic language support to new levels, at least in my eyes. &#8230; <a href="http://blog.surfulater.com/2007/02/21/write-ruby-code-faster-with-ed-for-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Ruby web site" href="http://www.ruby-lang.org/en/" target="_blank">Ruby</a> is the most expressive and interesting language I&#8217;ve come across in all these years of developing our programmer&#8217;s editor/ide <a title="ED Web site" href="http://www.getsoft.com" target="_blank">ED for Windows.</a> It takes Object Oriented programming and Dynamic language support to new levels, at least in my eyes.</p>
<p>Ruby enables you to do more than other languages in less lines of code and still be reasonably readable, and important asset for any language. The library that is included with Ruby is the most comprehensive I&#8217;ve seen, which means there is less searching out other libraries or having to write your own code. The bottom line is simply that you should be more productive writing in Ruby than other languages, which is pretty important in todays fast paced world. And if you can do more with less code, there should be fewer bugs, right!<span id="more-85"></span></p>
<p>There are however a few things that concern me with the Ruby language. First up whitespace is relevant, which is pretty unusual in a programming language. For example: id = &#8220;%x&#8221; % (ab * 2) is completely different to: id = &#8220;%x&#8221; %(ab * 2). In the second fragment there is no space between %(.</p>
<p>My next concern is that you can&#8217;tÂ declare variables, youÂ just use them when and wherever. The problem here is that if you make a simple typing mistake you&#8217;ll have two <em>(or more) </em>variables instead of the one and probablyÂ won&#8217;t know until you <em>(hopefully)</em> discover the code isn&#8217;t working as expected. For example:</p>
<p>if thelight == 1<br />
Â  tehlight = 0Â  # typo<br />
end</p>
<p>The Ruby interpreter won&#8217;t complain about this and <em>thelight</em> will never get set to 0. Other dynamic languages also work this way, so Ruby isn&#8217;t alone, but PHP for example provides an option where you are forced to declare variables before use. Ruby would really benefit from this.</p>
<p><strong>Ruby + ED for Windows</strong></p>
<p>Developing <a href="http://www.getsoft.com" target="_blank">ED4W</a> language support for RubyÂ was difficult. Ruby code can be ambiguous when looked at in isolation and this poses many challenges for editor writers. In fact, I spent some time looking at the other editors which support Ruby and was quite surprised at how poorly they faired. Syntax highlighting was often wrong and this is the area which is so important in helping you quickly see mistakes as you are writing, instead of waiting for the Ruby interpreter to point them out and getting wound up waisting time with unnecessary edit-compile cycles.</p>
<p>Aside from extensible syntax highlighting ED4W delivers a range of capabilities to help you write code faster, and not just in Ruby but in a wide range of programming languages. I&#8217;ll quickly run through some of these.</p>
<p><img title="Smart indenting and Auto-completion" alt="Smart indenting and Auto-completion" src="http://blog.surfulater.com/images/ruby1.gif" /></p>
<p>This short code fragment was written without pressing the space bar or tab key and without typing and end&#8217;s. EDs <strong>smart indenting</strong> took care of all of the indenting and its <strong>code templates</strong> filled in the &#8216;end&#8217; statements.</p>
<p>Another way to automatically complete blocks of code is using <strong>code completion</strong>. If the example above was:</p>
<p><img src="http://blog.surfulater.com/images/ruby2.gif" /></p>
<p>Then pressing Enter followed byÂ Escape would give you:</p>
<p><img src="http://blog.surfulater.com/images/ruby3.gif" /></p>
<p>And pressing EnterÂ and Escape once more will give you:</p>
<p><img src="http://blog.surfulater.com/images/ruby4.gif" /></p>
<p>Code completion works outÂ what text needs to be added to <em>close </em>the current block of code. It works with simple text such as brackets [ { and (Â to add ) } or ] and more complex elements as shown above.</p>
<p>Another important ED feature is shown in these two screen shots and that is the matchingÂ <em>if-end</em> and <em>def-end</em> statements are highlighted. I assume all editors these days highlight matching brackets and let you jump to and from the opening and closing brackets, but ED takes this further and enables you to jump between any statements that form blocks of code as shown here.</p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p><center><object id="movie" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="503" width="535" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="14155" name="_cx" /><param value="13309" name="_cy" /><param name="FlashVars" /><param value="http://blog.surfulater.com/images/ED_Statement_matching.swf" name="Movie" /><param value="http://blog.surfulater.com/images/ED_Statement_matching.swf" name="Src" /><param value="Window" name="WMode" /><param value="-1" name="Play" /><param value="-1" name="Loop" /><param value="High" name="Quality" /><param name="SAlign" /><param value="-1" name="Menu" /><param name="Base" /><param name="AllowScriptAccess" /><param value="ShowAll" name="Scale" /><param value="0" name="DeviceFont" /><param value="0" name="EmbedMovie" /><param value="FFFFFF" name="BGColor" /><param name="SWRemote" /><param name="MovieData" /><param value="1" name="SeamlessTabbing" /><param value="0" name="Profile" /><param name="ProfileAddress" /><param value="0" name="ProfilePort" /><param value="all" name="AllowNetworking" /><param value="false" name="AllowFullScreen" /></object></center>You can <em>right click</em> on any statement to jump to its matching statement and as this example shows <em>nested blocks</em> are of course handled correctly. ED uses <em>right click on code</em> to do a variety of clever things, but if you preferÂ the keyboardÂ you&#8217;ll be right at home.Â Â Â Â </p>
<p>Â </p>
<p>Statement matching and code completion are two more ways ED helps you code faster. Smartype, Autocorrection and Parameter assistance also come to the party.</p>
<p><strong>Code templates</strong> write complete blocks of code for you. You simply type the templates abbreviation or pick it from the Skeleton window and ED does the rest as shown here.</p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p><center><object id="movie" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="239" width="310" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="8202" name="_cx" /><param value="6324" name="_cy" /><param name="FlashVars" /><param value="http://blog.surfulater.com/images/ED_Template_Expansion.swf" name="Movie" /><param value="http://blog.surfulater.com/images/ED_Template_Expansion.swf" name="Src" /><param value="Window" name="WMode" /><param value="-1" name="Play" /><param value="-1" name="Loop" /><param value="High" name="Quality" /><param name="SAlign" /><param value="-1" name="Menu" /><param name="Base" /><param name="AllowScriptAccess" /><param value="ShowAll" name="Scale" /><param value="0" name="DeviceFont" /><param value="0" name="EmbedMovie" /><param value="FFFFFF" name="BGColor" /><param name="SWRemote" /><param name="MovieData" /><param value="1" name="SeamlessTabbing" /><param value="0" name="Profile" /><param name="ProfileAddress" /><param value="0" name="ProfilePort" /><param value="all" name="AllowNetworking" /><param value="false" name="AllowFullScreen" /></object></center>Templates can be as simple as &#8216;if .. end&#8217;, to complete slabs of code and they can include other templates, allowing a building block construction approach. Templates are created using plain easy to edit text in a text file.Â Â Â Â </p>
<p>Â </p>
<p>I&#8217;ll end this section by touching onÂ some of the other ways ED will help you write code faster. Macros automate text manipulation operations, full Regular Expression search and replace both within and across files and projects, Filter searches to exclude syntax elements such as comments and strings, Difference Analysis highlights changes in files and enables them to be resolved, Persistent bookmarks keep your place across editing sessions, Comment/uncomment blocks of code, Select text by character, column and line, Spell check and correct, Run compilers and navigate through errors in the source, Open include files and Configure and extend ED to work the way you want to.</p>
<p>To finishÂ I want toÂ show youÂ how ED can helpÂ <strong>navigate around your code</strong> and enable you to work directly with modules, classes and methods so that you no longer have to remember which source fileÂ they are in or where thatÂ file is located. To accomplish this ED has a <em>built-in</em> Source Database Engine (SDB) which parses your source code in the background to build a database of all methods, classes etc., which you can then access in an instant. Lets see how easy this is.</p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p>Â </p>
<p><center><object id="movie" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="489" width="602" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="15928" name="_cx" /><param value="12938" name="_cy" /><param name="FlashVars" /><param value="http://blog.surfulater.com/images/ED_SDB_Lookup.swf" name="Movie" /><param value="http://blog.surfulater.com/images/ED_SDB_Lookup.swf" name="Src" /><param value="Window" name="WMode" /><param value="-1" name="Play" /><param value="-1" name="Loop" /><param value="High" name="Quality" /><param name="SAlign" /><param value="-1" name="Menu" /><param name="Base" /><param name="AllowScriptAccess" /><param value="ShowAll" name="Scale" /><param value="0" name="DeviceFont" /><param value="0" name="EmbedMovie" /><param value="FFFFFF" name="BGColor" /><param name="SWRemote" /><param name="MovieData" /><param value="1" name="SeamlessTabbing" /><param value="0" name="Profile" /><param name="ProfileAddress" /><param value="0" name="ProfilePort" /><param value="all" name="AllowNetworking" /><param value="false" name="AllowFullScreen" /></object></center>This is just one way to find methods, classes and modules. You can query the SDB including using regular expressions. For example to find all methods starting with &#8220;sock&#8221; you would search for &#8220;sock.*&#8221; using Goto|Find in Source Database.Â Â Â Â </p>
<p>Class View displays a tree of all modules, classes and methods for all of the Projects which are currently open.</p>
<p>Â </p>
<div style="text-align: center"><img title="Class View Tree" alt="Class View Tree" src="http://blog.surfulater.com/images/RubyClassView.jpg" /></div>
<p>Â </p>
<p>Double click on any item to open its source file and jump to it.Â Class View is opened using View|Workspace then click on the Class View tab. To locate a method etc. in the current source file in the class view, right click on whitespace inside the method and choose &#8220;Select current item in Class View&#8221;.</p>
<p>ED also makes it easy to move around by method, class or module within the current file, by selectingÂ from the drop-down combobox on the Navigate Toolbar. And Goto|Next Function and Goto|Previous Function do what they say.</p>
<p>Â </p>
<div style="text-align: center"><img title="Function List" alt="Function List" src="http://blog.surfulater.com/images/RubyFunctionList.jpg" /></div>
<p>Â </p>
<p>To use the Source Database you need to create a Project and add your source files to it.Â All files in the project are included in the database. The SDB is updated in real time as you edit code, so it always truly reflects the code.</p>
<p>A sample project for the Ruby library source code is included in the <a title="ED Download web page" href="http://www.getsoft.com/download_trial_version.html" target="_blank">ED Download</a> and is placed in C:\Program Files\SAIG\ED4W\Sample Projects. CopyÂ Ruby Source.edp to a working directory and then use Project|Add Project to Workspace to add this to your own project. This will give you instant access to all Ruby modules, methods and classes.</p>
<p>To run Ruby on the current source file, click on the this button <img title="Run Ruby Toolbar button" alt="Run Ruby Toolbar button" src="http://blog.surfulater.com/images/RubyRun.gif" />Â on the Build Toolbar. Use View|Toolbars|Build to open it if necessary. Any errors are shown in the Output window and Goto|Next/Previous Error navigate through the errors in the relevant source files.</p>
<p>There is a lot more to ED that I could tell you about, but would you keep reading! Probably not, so let me wrap this up.</p>
<p>EDs combination of powerful cross language editing capabilities plus source code navigation and browsing will surely help you code faster and not just in Ruby, but inÂ mostÂ mainstream programming languages.</p>
<p>PS. <a href="http://tryruby.hobix.com/" target="_blank">Try Ruby!</a> lets youÂ give Ruby a quick 15 minute workoutÂ in your Web Browser. Highly recommended.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.surfulater.com/2007/02/21/write-ruby-code-faster-with-ed-for-windows/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

