Rails accelerates and simplifies the development of Web applications, but it's not mature enough, especially at high-end enterprise-level features. On the other hand, the Java platform and its virtual machines, libraries, and application servers have been upgraded in speed, stability and functionality, and are now recognized as the leading platform for high-end server applications. However, if the Java platform is not associated with emerging languages such as Ruby, it is likely to lag behind in fashion trends.
Sample code:
Require "Java"
include_class "Java.util.TreeSet"
include_class "com.example.CallMe" Include_class "
Com.example.ISpeaker "
puts" Hello from Ruby "
set = Treeset.new
set.add" foo "
set.add" Bar "
Set.add "Baz"
Set.each {|v| puts "value: #{v}"}
cm = callme.new
cm.hello
$globalCM. Hello
Class Calljava
include Ispeaker
def initialize
super
@count = 0
end
def say (msg)
Puts "Ruby saying #{msg}"
end
def addone (from)
# M.synchronize {
@count + 1
puts ' now Got # @count from #{from} '
# }
End