Java 版的 Ruby 解譯器 JRuby 1.7.14 發布_ruby專題

來源:互聯網
上載者:User

JRuby 1.7.14 發布 ,此版本現已提供下載:

http://www.jruby.org/download

JRuby 1.7 主要是為了相容 Ruby 1.9.3 版本,改進記錄如下:

解決了 30 個 issues

修複了 Jar 檔案源潛在的記憶體流失問題

因為在 Rails 應用啟動比較慢,所以預設禁用 invokedynamic

load/require 內部重構和簡化

解決了一些相容性問題

1.7.14 修複的 bug:

#1923 - String#start_with? returns false when using an empty string#1905 - Tempfile and deleteOnExit#1899 - Can't call static method on Java 8 interface#1898 - Fix the memory leak and actually close the resources.#1889 - NPE from org.jruby.java.proxies.ArrayJavaProxy.to_a#1888 - native memory leak when reading files from inside a .jar#1859 - JMX tries to double-bind a port when using bundle exec#1858 - JRuby with Java 8 4 to 10 times slower than Java 7#1852 - JRubyClassloader seems to have a problem with file urls pointing to jar ...#1850 - embedded jars do not get loaded#1846 - Fix $LOAD_FEATURES paths for 1.8#1818 - fix ArrayJavaProxy#to_a failure on arrays containing null#1813 - can not load resources from jar anymore with jar uri#1809 - apply minor enebo's comments#1808 - Fix BigDecimal#round behavior with NAN and INFINITY#1805 - Zlib crc improvements#1803 - Fix minor bug in `setNativeEnabled`, and expose it in ScriptingContainer#1802 - Fix Encoding::Converter#inspect output#1799 - mvn -Pall fails at the documentation step#1790 - Make Time#to_r consistent with MRI#1777 - ServerSocket#accept_nonblock returns the server's port, not the client's#1772 - avoid sub-classing ThreadLocal since it will leak in envs such as .wars#1765 - added a java_field method for use in the jrubyc command.#1762 - enhanced the java_class compiler so it can handle multiple constructors#1750 - Refactor LoadService to make use of resources#1729 - no valid struct layout for Ethon::Curl::Slist#1676 - Empty hash optimization#1580 - IO.select raises CancelledKeyException on shutdown#1520 - Date comparison as java objects#1435 - bouncy-castle-java JARs missing when warbling with JRuby 1.7.10

JRuby是面向Ruby、基於Java虛擬機器(JVM)的一種解釋程式,它結合了Ruby語言的簡易性和功能強大的JVM的執行機制,包括與 Java庫 全面整合。Rails徹底加快及簡化了Web應用的開發,不過它讓人覺得不夠成熟,特別是在高端企業級功能方面。另一方面,Java平台及其虛擬機器、庫和 應用伺服器的速度、穩定性和功能方面卻一直在提升,現在已被公認為是開發高端伺服器應用的領先平台。不過如果Java平台不與Ruby等新興語言聯絡在一 起,就有可能落後於流行趨勢。

範例程式碼:

require "java"include_class "java.util.TreeSet"include_class "com.example.CallMe"include_class "com.example.ISpeaker"puts "Hello from ruby"set = TreeSet.newset.add "foo"set.add "Bar"set.add "baz"set.each { |v| puts "value: #{v}" }cm = CallMe.newcm.hello$globalCM.helloclass CallJavainclude ISpeakerdef initialize super @count = 0enddef say(msg) puts "Ruby saying #{msg}"enddef addOne(from)#  m.synchronize {  @count += 1  puts "Now got #@count from #{from}"#  }endend

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.