rb.dll - CodeWright support for editing ruby source code


Please note: This DLL works fine with CodeWright 5.1, CodeWright 6.0, CodeWright 6.6a, but don't use it "as-is" with CodeWright 6.5. CodeWright 6.5 users please go to http://www.222lake.com/projects/ruby.html.
Download rb.zip. Contains ReadMe.txt, rb.dll and its source code. Also contains rbsnippets.zip. Snippets are a nice feature of CodeWright 6 which are parameterized templates for pieces of ruby code or comments you insert into your code frequently. (27k)
Download rb_dll.zip. Contains rb.dll only. (14k)
The web page for rb.dll is http://www.geocities.com/uncle_gaga/rb_dll.html
Send email to uncle_gaga@geocities.com.
Release Notes

0) This DLL provides ruby support in CodeWright for these CodeWright features:-

   a) Syntax coloring for keywords, strings, numbers, comments and operators.
      
   b) Selective display. Collapses the display of ruby code to a sequence of 
      expandable 'class', 'def' and 'module' lines.

   c) Template expansion.  Type in abbreviated keywords and CodeWright will expand 
      them. 

   d) Smart Indenting.  Next line after 'def' etc. will be indented automatically.

   e) Processing of ruby compile errors.  Use the CodeWright Project, Compile menu 
      to run ruby -c on the current .rb file and put the cursor on lines with errors.

   f) CodeWright Outline tab.  Displays clickable list of ruby classes, defs, modules
      in the Outline tab in CodeWright's left pane.


1) You are free to modify this code any way you want, but it is useless
   without a normal installation of CodeWright which comes with the .h
   and DLL files needed to compile it and interface with CodeWright. 


2) Email comments, suggestions, and improvements to uncle_gaga@geocities.com.
   I am very busy so I can't promise to reply quickly.


3) Latest version from this author will always be at 
   
   http://www.geocities.com/uncle_gaga/rb_dll.html


4) This DLL is not finished or perfect, but it will not hurt your computer
   and will not hurt any of your files, and offers a significant improvement
   over CodeWright without ruby support.


5) This DLL was written starting with sample C code from the CodeWright 5.1 CD.
   It was compiled using Visual C++ 6.0.  It does not require MFC.
   The C source, VC workspace and project files are provided in the rb.zip.  
   
   To compile the rb.dll, you must have exports.h and cwstart.h that come with
   the CodeWright CD.

6) Tested with 32-bit CodeWright 5.1 and CodeWright 6.0, CodeWright 6.6a
   Should work with later version of CodeWright, but don't be surprised if you
   have to modify the code. 

   
7) How to use this DLL:-

   Some of the menu locations are slightly different between CodeWright 5 and 6.
   The locations mentioned below are for CodeWright 5, but they are easy enough
   to find in CodeWright 6.

   a) Put the rb.dll in your CodeWright home directory.

   b) In CodeWright, go to the Tools, Libraries dialog.

   c) Click the Add button, browse for rb.dll, make sure it's in the
      User Defined Libraries list, click OK. 

   d) Close CodeWright and start it again.
      ruby source files will have syntax coloring at this point.

   e) If you aren't in a CodeWright project, create one for specifically 
      editing ruby code.
      
   f) Go to the Project, Properties property sheet.
      
      i) In the Errors tab, go to the Error Parser 1: combo box and
	  select _RubyErrorInfo.

      ii) In the Tools tab:-  
          
            select Compile at the top of the Project list box.
            check Redirect Output.
            check Save all files.
            
            Click on the Compiler button to get the Language property sheet.

            From the File type list box on the left, click on .rb  
            In the Compiler name: combo box, select "ruby syntax checker".
            ( you should see ${FTEE} ruby -c %b%e appear in the Compile combo box )

            In the Edit tab (of the Language sheet), check Smart Indenting 
            and check Template Expansion. 

            Click on the Templates tab (of the Language sheet) to see what ruby
            keyword abbreviations can be automatically expanded for you, and how.

            Click on the Symbols tab (of the Language sheet) and check the boxes
            for class, def, and module.

      iii) In the Filters tab:-  
        
            Type ruby in the Description edit box, and *.rb in the Pattern box.
            Click Add.

      iv) Click OK.


    g) Go to the Text, Selective Display dialog and click on the 
       Routine definitions radio button.

8) Future enhancements - formatting of highlighted code.


9) Possible problem - 
   CodeWright (or command.com ?) appears to remove newlines from the output of ruby -c
   on some machines, so that Project, Compile can only position you on the first error
   in your code.  I think it is something that can be corrected on our machine by 
   changing CodeWright, ftee.pif, command.pif, or some other setting.  I don't think 
   it can be fixed in the rb.dll, because it works on one of my machines.  If anyone 
   has this situation and figures it out, please email me with your findings.