Developing cross platform desktop application with Ruby
•
21 likes•18,896 views
A brief introduction and example of developing desktop application with Ruby programming language. JRuby and shoesrb is discussed as platform.
Prepared for and Presented on Ruby Conference Bangladesh 2003.
1 of 54
Download to read offline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
More Related Content
Developing cross platform desktop application with Ruby
23. Why JRuby?
●
High performance
●
Real threading
●
Vast array of libraries (gems + JARs)
24. Why JRuby?
●
High performance
●
Real threading
●
Vast array of libraries (gems + JARs)
●
Platform Independent
25. Why JRuby?
●
High performance
●
Real threading
●
Vast array of libraries (gems + JARs)
●
Platform Independent
●
Enterprise Acceptance
26. Why JRuby?
●
High performance
●
Real threading
●
Vast array of libraries (gems + JARs)
●
Platform Independent
●
Enterprise Acceptance
The best of both worlds!
28. Get JRuby
●
Download
●
Extract
●
Add bin subdirectory to your $PATH
– (PATH=path/to/jruby/bin:$PATH)
●
Test it: jruby -v
●
Assuming you have jdk 1.7 installed
●
Can be installed with rvm too
30. Make a Frame (JFrame)
class NumberConverter < JFrame
def initialize
super('Number Format Converter')
set_size(400,140);
set_visible(true);
set_default_close_operation(JFrame::EXIT_ON_CLOSE);
end
end
num_converter = NumberConverter.new
40. Set Event Handler cont.
main.add(btn = Jbutton.new("CONVERT"));
btn.add_action_listener do |evt|
result.set_text(convert.upcase);
end
def convert
# Take the value of @input
# Take formats form @cmbFrom and @cmbTo
# Convert to required format
end
end # end of class NumFormat
50. BTW, JRuby is not ONLY for Desktop
●
It's just Ruby*
●
Rails just works
*Here are differences- https://github.com/jruby/jruby/wiki/DifferencesBetweenMriAndJruby