Using jruby irb
Explore JRubyArt, propane, and even java with jirb
Say for example you want to find what javax look and feels are available on your system (eg for control_panel), fire up jirb
. The at the irb prompt:-
>> Java::JavaxSwing::UIManager.get_installed_look_and_feels.each do |lf|
>> puts lf.name
>> end
Output
Metal
Nimbus
CDE/Motif
GTK+
=> javax.swing.UIManager$LookAndFeelInfo[javax.swing.UIManager$LookAndFeelInfo[Metal javax.swing.plaf.metal.MetalLookAndFeel], javax.swing.UIManager$LookAndFeelInfo[Nimbus javax.swing.plaf.nimbus.NimbusLookAndFeel], javax.swing.UIManager$LookAndFeelInfo[CDE/Motif com.sun.java.swing.plaf.motif.MotifLookAndFeel], javax.swing.UIManager$LookAndFeelInfo[GTK+ com.sun.java.swing.plaf.gtk.GTKLookAndFeel]]@449a4f23
Explore JRubyArt and propane methods
JRubyArt requires pry
installed for jruby jgem install pry
k9 --create my_sketch 200 200
k9 --live my_sketch.rb # creates a live sketch bound to pry
At the pry prompt:-
>> $app.find_method 'ellipse'
Output:-
=> [:ellipse, :ellipseMode, :ellipse_mode]
propane does not currently have a live mode but you can load into pry or jirb
propane --create my_sketch 200 200
jirb
At the pry prompt:-
>> load 'my_sketch.rb'
>> $app.find_method 'ellipse'
Output:-
=> [:ellipse, :ellipseMode, :ellipse_mode]
Tip: create a convenience jpry (to use pry instead of jirb)
In your ~/.profile
or ~/.bashrc
linux or .bash_profile
MacOS
alias jpry="jruby -e \"require 'pry'; binding.pry\""