Difference between revisions of "FreeplaneJrubyInstaller Addon"

From Freeplane - free mind mapping and knowledge management software
Line 21: Line 21:
 
Freeplane supports groovy (.groovy) and javascript (.js) scripts out-of-the-box.  
 
Freeplane supports groovy (.groovy) and javascript (.js) scripts out-of-the-box.  
  
This addon '''adds support for ruby (.rb) scripts''', enabling you to '''run ruby scripts''' (ex: <code>xxx/1.5.x/scripts/my_ruby_script.rb</code>) alongside the out-of-the-box .groovy and .js scripts.
+
This addon '''adds support for ruby (.rb) scripts''', enabling you to '''run ruby scripts''' (ex: <code><freeplane-user-dir>/scripts/my_ruby_script.rb</code>) alongside the out-of-the-box .groovy and .js scripts.
  
  
Line 29: Line 29:
 
* To '''''enable Freeplane to use/run ruby scripts'''''. <br /> To run a ruby script, you first need to '''install the FreeplaneJrubyInstaller-addon'''. <br /> Once the FreeplaneJrubyInstaller-addon is installed, you can then '''use ruby scripts in Freeplane''' <br /> The next sections of this page show step-by-step [[FreeplaneJrubyInstaller_Addon#How_to_install_the_FreeplaneJrubyInstaller-Addon_in_Freeplane|How to install the FreeplaneJrubyInstaller-Addon in Freeplane]] and [[FreeplaneJrubyInstaller_Addon#How_to_use_ruby_scripts_in_Freeplane|How to use ruby scripts in Freeplane ]]
 
* To '''''enable Freeplane to use/run ruby scripts'''''. <br /> To run a ruby script, you first need to '''install the FreeplaneJrubyInstaller-addon'''. <br /> Once the FreeplaneJrubyInstaller-addon is installed, you can then '''use ruby scripts in Freeplane''' <br /> The next sections of this page show step-by-step [[FreeplaneJrubyInstaller_Addon#How_to_install_the_FreeplaneJrubyInstaller-Addon_in_Freeplane|How to install the FreeplaneJrubyInstaller-Addon in Freeplane]] and [[FreeplaneJrubyInstaller_Addon#How_to_use_ruby_scripts_in_Freeplane|How to use ruby scripts in Freeplane ]]
  
* To be helpfull for non-programmers who want to '''''try first-steps-of-programming with Ruby and make simple Freeplane ruby scripts'''''.  <br /> Ruby is easy to learn, has many tutorials/books written for new programmers, and the RubyLiveDebugger (part of this addon) gives an instantaneous-visual-test-lab to try ruby with freeplane ([https://www.youtube.com/watch?v=dy6kDGApaKw#t=08m05s demo video]) <br /> Start by installing the addon as explained in this page, and then go read the  [[FreeplaneJrubyInstaller_-_developers|FreeplaneJrubyInstaller - developers]] wiki page.
+
* To '''''be helpfull for non-programmers who want to try first-steps-of-programming with Ruby and make simple Freeplane ruby scripts'''''.  <br /> Ruby is easy to learn, has many tutorials/books written for new programmers, and the RubyLiveDebugger (part of this addon) gives an instantaneous-visual-test-lab to try ruby with freeplane ([https://www.youtube.com/watch?v=dy6kDGApaKw#t=08m05s demo video]) <br /> Start by installing the addon as explained in this page, and then read the  [[FreeplaneJrubyInstaller_-_developers|FreeplaneJrubyInstaller - developers]] wiki page.
  
 
   
 
   
Line 99: Line 99:
 
Once the FreeplaneJrubyInstaller-addon is installed, you can then '''use ruby scripts in Freeplane'''
 
Once the FreeplaneJrubyInstaller-addon is installed, you can then '''use ruby scripts in Freeplane'''
  
TODO: finish this
+
Lets take as an example, that you have a new '''my_ruby_script.rb''' file, that you got from the wiki or the forum or from a friend. You have that file in your computer, and you want to use it in Freeplane. Do this:  
 +
 
 +
* In Freeplane goto '''Tools/Open user directory''' to open the <code><freeplane-user-dir></code> in a new window
 +
 
 +
* Copy/paste the new file into the '''''scripts''''' subdirectory (<code><freeplane-user-dir>/scripts/my_ruby_script.rb</code>)
 +
 
 +
* The new ruby script is now in <code><freeplane-user-dir>/scripts/my_ruby_script.rb</code>, but Freeplane only sees it after a restart. So now restart Freeplane
 +
 
 +
* Open Freeplane again, and you will see that there is a new entry in the menu '''Tools/Scripts/''''''''My_Ruby_Script''''' - click on it to run the new ruby script!
 +
 
  
 
...
 
...
 
(ex: <code>xxx/1.5.x/scripts/my_ruby_script.rb</code>)
 
(ex: <code>xxx/1.5.x/scripts/my_ruby_script.rb</code>)

Revision as of 13:36, 31 August 2016


This page is still a work in progress

Hi you found this page before its finished.

My idea is to finish it and **only then** make an announcement in the forum, and ask to add links to it in the addons wiki page.

This is to avoid misunderstandings and be able to explain the addon and how to use it with some good explanations.

So, if you got here congratulations, but keep the secret! The addon is already in github, so if you cant wait anylonger knock yourself out :)

PS: This is progressing slow but steadly, at the rythm of my very scarce free time... dont worry though, all the coding is already finished and the addon ready, the last missing piece is to make some extense docs here in this wiki to explain how it works...


Introduction

This addon adds support for ruby (.rb) scripts in Freeplane

Freeplane supports groovy (.groovy) and javascript (.js) scripts out-of-the-box.

This addon adds support for ruby (.rb) scripts, enabling you to run ruby scripts (ex: <freeplane-user-dir>/scripts/my_ruby_script.rb) alongside the out-of-the-box .groovy and .js scripts.


The addon was made to:

  • To be helpfull for non-programmers who want to try first-steps-of-programming with Ruby and make simple Freeplane ruby scripts.
    Ruby is easy to learn, has many tutorials/books written for new programmers, and the RubyLiveDebugger (part of this addon) gives an instantaneous-visual-test-lab to try ruby with freeplane (demo video)
    Start by installing the addon as explained in this page, and then read the FreeplaneJrubyInstaller - developers wiki page.




How to install the FreeplaneJrubyInstaller-Addon in Freeplane

To run a freeplane ruby script, you first need to install the FreeplaneJrubyInstaller-addon in Freeplane


To install the addon follow the instructions bellow (click on any image to enlarge it):

You dont need to manually download anything, all downloads are automatic.


Img0.png
  • Copy to your clipboard THE-URL-TO-THE-ADDON (without any leading/trailing spaces! or it fails):

THE-URL-TO-THE-ADDON: https://raw.githubusercontent.com/zipizap/FreeplaneJrubyInstaller/master/addon_lab/FreeplaneJrubyInstaller-v1.6.2.addon.mm


  • Follow the images:
Img1.png


Img2.png


Img3.png


Img4.png


Img5.png


Img6.png



  • Open Freeplane for a second-time, and:
Img6 2.png


Img6 3.png


Img6 4.png


Img7.png


Img8.png


Img9.png


Img10.png



  • Open Freeplane for a third-time, and:
Img11.png



  • The following final window should appear, which indicates that the FreeplaneJrubyInstaller-addon is now installed! Hurray!
Img12.png


Youtube demo video: install FreeplaneJrubyInstaller Addon

https://youtu.be/sJUWTcPhOk0



How to use ruby scripts in Freeplane

Once the FreeplaneJrubyInstaller-addon is installed, you can then use ruby scripts in Freeplane

Lets take as an example, that you have a new my_ruby_script.rb file, that you got from the wiki or the forum or from a friend. You have that file in your computer, and you want to use it in Freeplane. Do this:

  • In Freeplane goto Tools/Open user directory to open the <freeplane-user-dir> in a new window
  • Copy/paste the new file into the scripts subdirectory (<freeplane-user-dir>/scripts/my_ruby_script.rb)
  • The new ruby script is now in <freeplane-user-dir>/scripts/my_ruby_script.rb, but Freeplane only sees it after a restart. So now restart Freeplane
  • Open Freeplane again, and you will see that there is a new entry in the menu Tools/Scripts/'''My_Ruby_Script - click on it to run the new ruby script!


... (ex: xxx/1.5.x/scripts/my_ruby_script.rb)