Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Kate editor execute Ruby scripts
Index -> Programming, Ruby -> Ruby Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
gfranken




PostPosted: Wed Jun 14, 2006 4:01 pm   Post subject: Kate editor execute Ruby scripts

With the KDE Kate editor under Linux, you do get an embedded terminal. However, I wanted to customize Kate so it would run the ruby file being edited in Kate when I press a function key. Here's a brief howto:

1) Launch Kate
2) From the menu tool bar: Settings => Configure Kate
3) Click on External Tools in the pane at the left.
3) Click the New button
4) In the Label test box, enter: Run Ruby Script
5) In the script box (this is the tricky part), type:
cd "%directory" && konsole -e sh -c 'ruby "%filename"; printf "%s" "Press any key to exit . . . "; read $dummy'

Be sure to enter all the single quotes (') and double quotes (") as shown above.

6) In the executable box, enter: konsole
7) Click the Save button, and select "current document" from the dropdown list. This will tell Kate to save your Ruby program script before running the script box commands you entered above.
8) In the command line name text box, enter: rubyrun
9) Click the Apply button and then the OK button
10) You're back to the Kate main screen
11) Click Settings => Configure Shortcuts
12 In the External Tools section, you should find your run ruby script. Click on it, and set the Function key (I use the F12 function key) to activate it.
13) When editing a Ruby script in Kate, now, just press the F12 key to run the script. Kate will run the script in a fresh Konsole window.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu Jun 15, 2006 8:11 pm   Post subject: (No subject)

Thanks for the tip! I like the way Kate looks; I might just have to try it and KDE soon.

Too bad gEdit can't do this. Or can it...? Smile
Display posts from previous:   
   Index -> Programming, Ruby -> Ruby Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: