This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: post | |
title: JRuby 1.5.6 Released | |
--- | |
The JRuby community is pleased to announce the release of JRuby 1.5.6. | |
- Homepage: [http://www.jruby.org/](http://www.jruby.org/) | |
- Download: [http://www.jruby.org/download](http://www.jruby.org/download) | |
JRuby 1.5.6 is a minor follow-up release to address problems with mirroring |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Benchmark | |
def Benchmark::times() | |
puts Process.times | |
end | |
end | |
Benchmark.times |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SafeArray { | |
/** | |
* Contains a compressed sequence of n-dimensions of array values. | |
*/ | |
private Variant[] values; | |
// Each array dimensions first index in the pangea values array | |
private int valueIndexFor[]; | |
// Which index represents the start of each elements array (arrays can | |
// have non-zero index value. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'virtualbox' | |
vm = VirtualBox::VM.find("myvm") | |
# Let's first print out some basic info about the VM | |
#puts "Memory: #{vm.memory_size}" | |
# Let's modify the memory and name... | |
#vm.memory_size = 360 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
java_import java.awt.BorderLayout | |
java_import java.awt.Container | |
java_import java.awt.GridLayout | |
java_import java.awt.event.ActionEvent | |
java_import java.awt.event.ActionListener | |
java_import javax.swing.JButton | |
java_import javax.swing.JFileChooser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.2 ~/work/jruby master* 902% jruby --1.9 -S rails new heh | |
create | |
create README | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/controllers/application_controller.rb | |
create app/helpers/application_helper.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ruby version 1.9.2 (java) | |
RubyGems version 1.3.7 | |
Rack version 1.2 | |
Rails version 3.0.3 | |
Active Record version 3.0.1 | |
Action Pack version 3.0.3 | |
Active Resource version 3.0.3 | |
Action Mailer version 3.0.3 | |
Active Support version 3.0.3 | |
Middleware |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = /a/u | |
puts r.encoding | |
r2 = Regexp.new(r) | |
p r2 | |
puts r2.encoding | |
puts r2.fixed_encoding? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
require 'C:/jdev/jdcbdrivers/11.2/ojdbc6.jar' | |
require 'lib/jdbc_connection' | |
require 'lib/dbms_output' | |
# v--- java_import is better than import if you end up using rake for testing | |
# v--- java,org,edu,javax can all be supplied bare-word instead of string form | |
java_import java.sql.CallableStatement | |
java_import java.sql.Connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base | |
def meth(a, b = 4) | |
# puts a.inspect, b.inspect | |
end | |
end | |
class Derived < Base | |
d = 1 | |
define_method(:meth) do |a, d| | |
puts "d before super #{d}" |