PageRenderTime 67ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>jEdit Ruby Editor Plugin</title>
  6. <!-- metadata -->
  7. <meta name="author" content="Rob McKinnon" />
  8. <!-- configuration parameters -->
  9. <meta name="defaultView" content="slideshow" />
  10. <meta name="controlVis" content="hidden" />
  11. <!-- style sheet links -->
  12. <link rel="stylesheet" href="ui/slides.css" type="text/css" media="projection" id="slideProj" />
  13. <link rel="stylesheet" href="ui/outline.css" type="text/css" media="screen" id="outlineStyle" />
  14. <link rel="stylesheet" href="ui/print.css" type="text/css" media="print" id="slidePrint" />
  15. <link rel="stylesheet" href="ui/opera.css" type="text/css" media="projection" id="operaFix" />
  16. <!-- embedded styles -->
  17. <style type="text/css" media="all">
  18. .imgcon {width: 525px; margin: 0 auto; padding: 0; text-align: center;}
  19. #anim {width: 270px; height: 320px; position: relative; margin-top: 0.5em;}
  20. #anim img {position: absolute; top: 42px; left: 24px;}
  21. img#me01 {top: 0; left: 0;}
  22. img#me02 {left: 23px;}
  23. img#me04 {top: 44px;}
  24. img#me05 {top: 43px;left: 36px;}
  25. </style>
  26. <!-- S5 JS -->
  27. <script src="ui/slides.js" type="text/javascript"></script>
  28. <script type="text/javascript">
  29. /* This hack adds a styling hook - a span inside every h1 */
  30. window.addEventListener('load', function() {
  31. var h1s = document.getElementsByTagName('h1');
  32. for (var i = 0, h1; h1 = h1s[i]; i++) {
  33. var span = document.createElement('span');
  34. span.appendChild(h1.firstChild);
  35. h1.appendChild(span);
  36. }
  37. }, true);
  38. </script>
  39. </head>
  40. <body>
  41. <div class="layout">
  42. <div id="controls"><!-- DO NOT EDIT --></div>
  43. <div id="currentSlide"><!-- DO NOT EDIT --></div>
  44. <div id="header"></div>
  45. <div id="footer">
  46. <h1>jEdit Ruby Editor Plugin</h1>
  47. <h2>Euruko 2005 &#8226; 15-16th Oct 02005</h2>
  48. </div>
  49. </div>
  50. <ol class="xoxo presentation">
  51. <li class="slide">
  52. <h1>jEdit Ruby Editor Plugin</h1>
  53. <h3>Rob McKinnon</h3>
  54. <h4>
  55. <em></em>
  56. </h4>
  57. <h4>
  58. <a href="http://kiwimp.sf.net/" rel="external">http://jedit.org/ruby/</a>
  59. </h4>
  60. <div class="handout"></div>
  61. </li>
  62. <li class="slide">
  63. <h1>The Web says ...</h1>
  64. <ul>
  65. <li>
  66. <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>
  67. <small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  68. - Review of JEdit as a Ruby on Rails IDE | Data Inadequate</small>
  69. </li>
  70. <li class="incremental">
  71. <blockquote cite="">"I eventually settled on Jedit for Ruby as recipient of the <strong>'best free Ruby IDE I found today'</strong> award."</blockquote>
  72. <small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  73. - Ruby IDE - a quick opinion | exactly one turtle</small>
  74. <!-- <dl>
  75. <dt>Ruby IDE - a quick opinion | exactly one turtle</dt>
  76. <dd>"I eventually settled on Jedit for Ruby as recipient of the ?best free Ruby IDE I found today? award."</dd>
  77. </dl>
  78. -->
  79. </li>
  80. <!-- <li class="incremental">
  81. <blockquote cite="">"JEdit plus dem Ruby-Plugin sein, was ich momentan benutze"</blockquote>
  82. <small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  83. - RadRails - Rails Usergroup Deutschland</small>
  84. </li>
  85. -->
  86. </ul>
  87. </li>
  88. <li class="slide">
  89. <h1>Why a new editor?</h1>
  90. <ul>
  91. <li>Started as a twinkle in my eye at RubyConf 2004 ...</li>
  92. <li>... and as a few beanshell macros for jEdit</li>
  93. <li>Wanted to:
  94. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  95. have auto-insert 'end' - the killer feature</li>
  96. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  97. prove naive type-based completion was possible</li>
  98. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  99. have syntax aware navigation</li>
  100. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  101. ... [insert your idea here]</li>
  102. </li>
  103. </ul>
  104. </li>
  105. <li class="slide">
  106. <h1>What's jEdit?</h1>
  107. <ul>
  108. <li>jEdit - a programmer's text editor</li>
  109. <li>Free Software released under GPL</li>
  110. <li>Core written by Slava Pestov (started he was 15)</li>
  111. <li>Plugins written by the masses (like me)</li>
  112. <li>Implemented in Java ...</li>
  113. </ul>
  114. </li>
  115. <li class="slide">
  116. <h1>Why a jEdit Ruby Editor Plugin?</h1>
  117. <ul>
  118. <li>Yeah ... it's Java ... I know ... but:</li>
  119. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  120. I'd worked on jEdit plugins before</li>
  121. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  122. Works on GNU/Linux, Mac OSX and Windows</li>
  123. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  124. Allowed me to use JRuby parser</li>
  125. <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  126. A neat Free Software programmer's editor!</li>
  127. </ul>
  128. </li>
  129. <li class="slide">
  130. <h1>Why not the Eclipse Plugin?</h1>
  131. <ul>
  132. <li>Find the Eclipse user interface constraining</li>
  133. <li>Don't like the Ruby Eclipse license, it's CPL</li>
  134. <li>Faster for me to develop a jEdit plugin</li>
  135. </ul>
  136. </li>
  137. <li class="slide">
  138. <h1>Plugin Features</h1>
  139. <ul>
  140. <li>Auto-indent and insert 'end'</li>
  141. <li>File structure popup</li>
  142. <li>Syntax error highlighting</li>
  143. <li>Type-based method completion
  144. <br/><br/><em>if it quacks like a duck it'll probably waddle like a duck</em>
  145. </li>
  146. <li>Integrated RDoc viewer</li>
  147. </ul>
  148. </li>
  149. <li class="slide">
  150. <h1>Implementation</h1>
  151. <ul>
  152. <li>org.jedit.ruby</li>
  153. <li>
  154. <ul>
  155. <li>ast</li>
  156. <li>cache</li>
  157. <li>completion</li>
  158. <li>icons</li>
  159. <li>parser</li>
  160. <li>ri</li>
  161. <li>structure</li>
  162. <li>test</li>
  163. <li>utils</li>
  164. </ul>
  165. </li>
  166. </ul>
  167. </li>
  168. <li class="slide">
  169. <h1>Parsing with JRuby</h1>
  170. <pre>
  171. DefaultRubyParser parser = new DefaultRubyParser();
  172. parser.init(new RubyParserConfiguration());
  173. LexerSource source = LexerSource.getSource(filePath, content);
  174. RubyParserResult result = parser.parse(source);
  175. Node node = result.getAST();
  176. </pre>
  177. </li>
  178. <li class="slide">
  179. <h1>Walking Abstract Syntax Tree</h1>
  180. <pre>
  181. Node node = result.getAST();
  182. RubyNodeVisitor visitor = new RubyNodeVisitor(lineCounter, moduleMembers, classMembers, methodMembers, listeners);
  183. if (node != null) {
  184. node.accept(visitor);
  185. }
  186. List<Member> members = visitor.getMembers();
  187. </pre>
  188. </li>
  189. <li class="slide">
  190. <h1>NodeVisitor Implementation</h1>
  191. <pre>
  192. class RubyNodeVisitor extends AbstractVisitor { ...
  193. protected void visitNode(Node node) { ...
  194. public void visitBlockNode(BlockNode node) { ...
  195. public void visitNewlineNode(NewlineNode node) { ...
  196. public void visitModuleNode(ModuleNode node) { ...
  197. public void visitClassNode(ClassNode node) { ...
  198. public void visitDefnNode(DefnNode node) { ...
  199. public void visitDefsNode(DefsNode node) { ...
  200. public void visitScopeNode(ScopeNode node) { ...
  201. </pre>
  202. </li>
  203. <li class="slide">
  204. <h1>Parsing problems</h1>
  205. <ul>
  206. <li>JRuby doesn't report node start offsets (only end offsets)</li>
  207. <li>I use regular expressions to identify start offsets - brittle</li>
  208. <li>Problems with single line modules, etc</li>
  209. <li>Auto-indent and insert 'end' also uses regular expressions</li>
  210. </ul>
  211. </li>
  212. <li class="slide">
  213. <h1>Getting RDocs into Java</h1>
  214. <ul>
  215. <li>Use RI YAML format</li>
  216. <li>Didn't want to write a Java YAML parser</li>
  217. <li>Instead use Ruby to create serialized Java object XML files</li>
  218. <li>Wrote Java classes to represent RDoc</li>
  219. <li>YAML+Ruby -> serialized Java XML -> deserialized at runtime</li>
  220. </ul>
  221. </li>
  222. <li class="slide">
  223. <h1>Popularity</h1>
  224. <ul>
  225. <li>Home page: 40 visitors a day, 7800 in total</li>
  226. <li>Download pg: 27 visitors a day, 5200 in total</li>
  227. <li>Top of Google search for "Ruby editor"</li>
  228. </ul>
  229. </li>
  230. <li class="slide">
  231. <h1>Download page by country</h1>
  232. <img alt="" src="download.png"/>
  233. </li>
  234. <li class="slide">
  235. <h1>Download page by continent</h1>
  236. <img alt="" src="download2.png"/>
  237. </li>
  238. <li class="slide">
  239. <h1>Future features</h1>
  240. <ul>
  241. <li>Import RDoc - gives you method completion for import</li>
  242. <li>Find usages</li>
  243. <li>Goto declaration</li>
  244. <li>Incremental selection</li>
  245. <li>Extract variable</li>
  246. <li>Extract method</li>
  247. <li>Code completion for user classes</li>
  248. </ul>
  249. </li>
  250. <li class="slide">
  251. <h1>Final words</h1>
  252. <ul>
  253. <li>
  254. <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>
  255. <small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  256. - Editors and IDEs | Livsey.org</small>
  257. </li>
  258. </ul>
  259. </li>
  260. </ol>
  261. </body>
  262. </html>