/www/tags/NOV_07_2009/htdocs/ruby/slides/02005/euruko/index.html
HTML | 301 lines | 246 code | 39 blank | 16 comment | 0 complexity | 1510ff79e9b947d688d4afedcb897f5e MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>jEdit Ruby Editor Plugin</title>
- <!-- metadata -->
- <meta name="author" content="Rob McKinnon" />
- <!-- configuration parameters -->
- <meta name="defaultView" content="slideshow" />
- <meta name="controlVis" content="hidden" />
- <!-- style sheet links -->
- <link rel="stylesheet" href="ui/slides.css" type="text/css" media="projection" id="slideProj" />
- <link rel="stylesheet" href="ui/outline.css" type="text/css" media="screen" id="outlineStyle" />
- <link rel="stylesheet" href="ui/print.css" type="text/css" media="print" id="slidePrint" />
- <link rel="stylesheet" href="ui/opera.css" type="text/css" media="projection" id="operaFix" />
- <!-- embedded styles -->
- <style type="text/css" media="all">
- .imgcon {width: 525px; margin: 0 auto; padding: 0; text-align: center;}
- #anim {width: 270px; height: 320px; position: relative; margin-top: 0.5em;}
- #anim img {position: absolute; top: 42px; left: 24px;}
- img#me01 {top: 0; left: 0;}
- img#me02 {left: 23px;}
- img#me04 {top: 44px;}
- img#me05 {top: 43px;left: 36px;}
- </style>
- <!-- S5 JS -->
- <script src="ui/slides.js" type="text/javascript"></script>
- <script type="text/javascript">
- /* This hack adds a styling hook - a span inside every h1 */
- window.addEventListener('load', function() {
- var h1s = document.getElementsByTagName('h1');
- for (var i = 0, h1; h1 = h1s[i]; i++) {
- var span = document.createElement('span');
- span.appendChild(h1.firstChild);
- h1.appendChild(span);
- }
- }, true);
- </script>
- </head>
- <body>
- <div class="layout">
- <div id="controls"><!-- DO NOT EDIT --></div>
- <div id="currentSlide"><!-- DO NOT EDIT --></div>
- <div id="header"></div>
- <div id="footer">
- <h1>jEdit Ruby Editor Plugin</h1>
- <h2>Euruko 2005 • 15-16th Oct 02005</h2>
- </div>
- </div>
- <ol class="xoxo presentation">
- <li class="slide">
- <h1>jEdit Ruby Editor Plugin</h1>
- <h3>Rob McKinnon</h3>
- <h4>
- <em></em>
- </h4>
- <h4>
- <a href="http://kiwimp.sf.net/" rel="external">http://jedit.org/ruby/</a>
- </h4>
- <div class="handout"></div>
- </li>
- <li class="slide">
- <h1>The Web says ...</h1>
- <ul>
- <li>
- <blockquote cite="">"The Ruby Editor Plugin for jEdit is a joy to use. ... <strong>a great open source Ruby Editor</strong>, good for Rails work too ... I recommend it"</blockquote>
- <small>
- - Review of JEdit as a Ruby on Rails IDE | Data Inadequate</small>
- </li>
- <li class="incremental">
- <blockquote cite="">"I eventually settled on Jedit for Ruby as recipient of the <strong>'best free Ruby IDE I found today'</strong> award."</blockquote>
- <small>
- - Ruby IDE - a quick opinion | exactly one turtle</small>
-
- <!-- <dl>
- <dt>Ruby IDE - a quick opinion | exactly one turtle</dt>
- <dd>"I eventually settled on Jedit for Ruby as recipient of the ?best free Ruby IDE I found today? award."</dd>
- </dl>
- -->
- </li>
- <!-- <li class="incremental">
- <blockquote cite="">"JEdit plus dem Ruby-Plugin sein, was ich momentan benutze"</blockquote>
- <small>
- - RadRails - Rails Usergroup Deutschland</small>
- </li>
- -->
- </ul>
- </li>
- <li class="slide">
- <h1>Why a new editor?</h1>
- <ul>
- <li>Started as a twinkle in my eye at RubyConf 2004 ...</li>
- <li>... and as a few beanshell macros for jEdit</li>
- <li>Wanted to:
- <li>
- have auto-insert 'end' - the killer feature</li>
- <li>
- prove naive type-based completion was possible</li>
- <li>
- have syntax aware navigation</li>
- <li>
- ... [insert your idea here]</li>
- </li>
- </ul>
- </li>
- <li class="slide">
- <h1>What's jEdit?</h1>
- <ul>
- <li>jEdit - a programmer's text editor</li>
- <li>Free Software released under GPL</li>
- <li>Core written by Slava Pestov (started he was 15)</li>
- <li>Plugins written by the masses (like me)</li>
- <li>Implemented in Java ...</li>
- </ul>
- </li>
- <li class="slide">
- <h1>Why a jEdit Ruby Editor Plugin?</h1>
- <ul>
- <li>Yeah ... it's Java ... I know ... but:</li>
- <li>
- I'd worked on jEdit plugins before</li>
- <li>
- Works on GNU/Linux, Mac OSX and Windows</li>
- <li>
- Allowed me to use JRuby parser</li>
- <li>
- A neat Free Software programmer's editor!</li>
- </ul>
- </li>
- <li class="slide">
- <h1>Why not the Eclipse Plugin?</h1>
- <ul>
- <li>Find the Eclipse user interface constraining</li>
- <li>Don't like the Ruby Eclipse license, it's CPL</li>
- <li>Faster for me to develop a jEdit plugin</li>
- </ul>
- </li>
- <li class="slide">
- <h1>Plugin Features</h1>
- <ul>
- <li>Auto-indent and insert 'end'</li>
- <li>File structure popup</li>
- <li>Syntax error highlighting</li>
- <li>Type-based method completion
- <br/><br/><em>if it quacks like a duck it'll probably waddle like a duck</em>
- </li>
- <li>Integrated RDoc viewer</li>
- </ul>
- </li>
- <li class="slide">
- <h1>Implementation</h1>
- <ul>
- <li>org.jedit.ruby</li>
- <li>
- <ul>
- <li>ast</li>
- <li>cache</li>
- <li>completion</li>
- <li>icons</li>
- <li>parser</li>
- <li>ri</li>
- <li>structure</li>
- <li>test</li>
- <li>utils</li>
- </ul>
- </li>
- </ul>
- </li>
- <li class="slide">
- <h1>Parsing with JRuby</h1>
- <pre>
- DefaultRubyParser parser = new DefaultRubyParser();
- parser.init(new RubyParserConfiguration());
- LexerSource source = LexerSource.getSource(filePath, content);
- RubyParserResult result = parser.parse(source);
- Node node = result.getAST();
- </pre>
- </li>
- <li class="slide">
- <h1>Walking Abstract Syntax Tree</h1>
- <pre>
- Node node = result.getAST();
- RubyNodeVisitor visitor = new RubyNodeVisitor(lineCounter, moduleMembers, classMembers, methodMembers, listeners);
- if (node != null) {
- node.accept(visitor);
- }
- List<Member> members = visitor.getMembers();
- </pre>
- </li>
-
- <li class="slide">
- <h1>NodeVisitor Implementation</h1>
- <pre>
- class RubyNodeVisitor extends AbstractVisitor { ...
- protected void visitNode(Node node) { ...
- public void visitBlockNode(BlockNode node) { ...
- public void visitNewlineNode(NewlineNode node) { ...
- public void visitModuleNode(ModuleNode node) { ...
- public void visitClassNode(ClassNode node) { ...
- public void visitDefnNode(DefnNode node) { ...
- public void visitDefsNode(DefsNode node) { ...
- public void visitScopeNode(ScopeNode node) { ...
- </pre>
- </li>
-
- <li class="slide">
- <h1>Parsing problems</h1>
- <ul>
- <li>JRuby doesn't report node start offsets (only end offsets)</li>
- <li>I use regular expressions to identify start offsets - brittle</li>
- <li>Problems with single line modules, etc</li>
- <li>Auto-indent and insert 'end' also uses regular expressions</li>
- </ul>
- </li>
-
- <li class="slide">
- <h1>Getting RDocs into Java</h1>
- <ul>
- <li>Use RI YAML format</li>
- <li>Didn't want to write a Java YAML parser</li>
- <li>Instead use Ruby to create serialized Java object XML files</li>
- <li>Wrote Java classes to represent RDoc</li>
- <li>YAML+Ruby -> serialized Java XML -> deserialized at runtime</li>
- </ul>
- </li>
-
- <li class="slide">
- <h1>Popularity</h1>
- <ul>
- <li>Home page: 40 visitors a day, 7800 in total</li>
- <li>Download pg: 27 visitors a day, 5200 in total</li>
- <li>Top of Google search for "Ruby editor"</li>
- </ul>
- </li>
-
- <li class="slide">
- <h1>Download page by country</h1>
- <img alt="" src="download.png"/>
- </li>
- <li class="slide">
- <h1>Download page by continent</h1>
- <img alt="" src="download2.png"/>
- </li>
- <li class="slide">
- <h1>Future features</h1>
- <ul>
- <li>Import RDoc - gives you method completion for import</li>
- <li>Find usages</li>
- <li>Goto declaration</li>
- <li>Incremental selection</li>
- <li>Extract variable</li>
- <li>Extract method</li>
- <li>Code completion for user classes</li>
- </ul>
- </li>
-
- <li class="slide">
- <h1>Final words</h1>
- <ul>
- <li>
- <blockquote cite="">"I've now been using jEdit fairly intensively for the past few days and have to say I'm a convert. ... it's a highly capable editor and <strong>I highly recommend checking it out</strong>."</blockquote>
- <small>
- - Editors and IDEs | Livsey.org</small>
- </li>
- </ul>
- </li>
- </ol>
- </body>
- </html>