Forum: Ruby jruby, profligacy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Einar Magnús Boson (Guest)
on 2008-11-20 03:14
(Received via mailing list)
I am trying to test out profligacy for GUI as it seems to make it
reasonably simple to use swing.
http://ihate.rubyforge.org/profligacy/lel.html

taking their examples I can get them to run although I had to `gem
unpack` profligacy and manually specify the path.
Can anyone explain to me what I need to do to compile this to class-
files that will run on a computer with only normal java installed?
where does the main-method go?

thank you

einarmagnus
Charles Oliver N. (Guest)
on 2008-11-20 09:10
(Received via mailing list)
Einar Magnús Boson wrote:
> I am trying to test out profligacy for GUI as it seems to make it
> reasonably simple to use swing.
> http://ihate.rubyforge.org/profligacy/lel.html
>
> taking their examples I can get them to run although I had to `gem
> unpack` profligacy and manually specify the path.
> Can anyone explain to me what I need to do to compile this to
> class-files that will run on a computer with only normal java installed?
> where does the main-method go?

Compilation is not hard, but you'll always need to ship JRuby if it's
not already present on the target machine. That's not hard either,
though. Is that what you want to do?

- Charlie
Einar Magnús Boson (Guest)
on 2008-11-20 11:24
(Received via mailing list)
On 20.11.2008, at 07:05 , Charles Oliver N. wrote:

> Compilation is not hard, but you'll always need to ship JRuby if
> it's not already present on the target machine. That's not hard
> either, though. Is that what you want to do?
>
> - Charlie
>


I'm sure it isn't, I'm just not that used to java anymore. been a while.
I guess what I want to is to end up with a .jar that when run will do
the same thing as `jruby ProfTest.rb` is doing when ProfTest.rb
contains:

require 'profligacy/swing'
require 'profligacy/lel'

module Test
   include_package 'javax.swing'
   include Profligacy

   layout = "
      [ label_1         | label3      ]
      [ (300,300)*text1 | (150)people ]
      [ <label2         | _           ]
      [ message         | buttons     ]
   "

   ui = Swing::LEL.new(JFrame,layout) do |c,i|
     c.label_1 = JLabel.new "The chat:"
     c.label2  = JLabel.new "What you're saying:"
     c.label3  = JLabel.new "The people:"
     c.text1   = JTextArea.new
     c.people  = JComboBox.new
     c.message = JTextArea.new

     c.buttons = Swing::LEL.new(JPanel, "[send|hate|quit]") do |c,i|
       c.send    = JButton.new "Send"
       c.hate    = JButton.new "Hate"
       c.quit    = JButton.new "Quit"
     end.build :auto_create_container_gaps => false
   end

   ui.build(:args => "Simple LEL Example")
end

how do I include jruby and profligacy inside a jar?


einarmagnus
James B. (Guest)
on 2008-11-20 17:12
(Received via mailing list)
Einar Magnús Boson wrote:

> how do I include jruby and profligacy inside a jar?


Look at Rawr

http://rawr.rubyforge.org/

--
James B.

www.happycamperstudios.com   - Wicked Cool Coding
www.jamesbritt.com           - Playing with Better Toys
www.ruby-doc.org             - Ruby Help & Documentation
www.rubystuff.com            - The Ruby Store for Ruby Stuff
This topic is locked and can not be replied to.