[#14690] singleton-of-singleton is Class in 1.9.0 — Sylvain Joyeux <sylvain.joyeux@...4x.org>
In 1.9.0, the singleton of a singleton is Class, while in 1.8 it was a
[#14696] Inconsistency in rescuability of "return" — Charles Oliver Nutter <charles.nutter@...>
Why can you not rescue return, break, etc when they are within
Gary Wright wrote:
On Jan 3, 2008 12:53 AM, Gary Wright <gwtmp01@mac.com> wrote:
Gary Wright wrote:
On Jan 2, 2008 5:26 PM, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
[#14720] bug reports about 1.9 VM — SASADA Koichi <ko1@...>
Hi,
[#14738] Enumerable#zip Needs Love — James Gray <james@...>
The community has been building a Ruby 1.9 compatibility tip list on
Hello James,
On Jan 4, 2008, at 12:11 AM, Martin Duerst wrote:
Hi,
On Jan 7, 2008, at 8:07 PM, Yukihiro Matsumoto wrote:
Hi,
On Jan 7, 2008, at 11:06 PM, Yukihiro Matsumoto wrote:
Hi,
[#14740] Could someone sanity check a paragraph? — Dave Thomas <dave@...>
In the section on writing C extensions for Ruby, I'm talking about
[#14747] BasicObject.instance_eval — Sam Ruby <rubys@...>
I'm looking at converting some code over from BlankSlate to BasicObject,
On Jan 3, 2008 10:06 PM, Sam Ruby <rubys@intertwingly.net> wrote:
[#14772] Manual Memory Management — Pramukta Kumar <prak@...>
I was thinking it would be nice to be able to free large objects at
On Jan 4, 2008 1:25 PM, Pramukta Kumar <prak@fortiusone.com> wrote:
I would only like to add that RMgick for example provides free method to
Marcin Raczkowski wrote:
On Sat, 5 Jan 2008 15:49:30 +0900, Marcin Raczkowski <mailing.mr@gmail.com> wrote:
Python supports 'del reference', which decrements the reference
Evan Weaver wrote:
On Tue, 8 Jan 2008 14:35:28 +0900, Marcin Raczkowski <mailing.mr@gmail.com> wrote:
[#14811] Re: Experimental PATCH to improve thread performance — Brent Roman <brent@...>
Paul,
[#14813] Changes in block_given? in 1.9 — Tomas Matousek <Tomas.Matousek@...>
The following code output differs between 1.8 and 1.9:
[#14816] Fibers clear thread-specific data? — "Tony Arcieri" <tony@...>
Is this behavior intentional?
On Mon, 7 Jan 2008 09:34:35 +0900, "Tony Arcieri" <tony@clickcaster.com> wrote:
On Jan 7, 2008 1:29 PM, MenTaLguY <mental@rydia.net> wrote:
On Tue, 2008-01-08 at 11:12 +0900, Tony Arcieri wrote:
[#14829] Finding I need explicit "GC.start" in my programs to prevent extreme growth. — Ron Mayer <rm_rails@...>
Short summary:
[#14839] Re: Embedding 1.9 — Dave Thomas <dave@...>
Moved over from ruby-talk...
Dave Thomas wrote:
On Wed, Jan 09, 2008 at 02:04:03AM +0900, Dave Thomas wrote:
[#14845] Some (accidental?) syntax changes 1.8 -> 1.9 — "Florian Frank" <flori@...>
Hello,
[#14871] p returning its argument? — "David A. Black" <dblack@...>
Hi --
On Jan 9, 2008 1:14 AM, David A. Black <dblack@rubypal.com> wrote:
[#14877] Array#count returning an enumerator — "David A. Black" <dblack@...>
Hi --
[#14884] memory leak? — ara howard <ara.t.howard@...>
Hi,
[#14885] Segmentation fault when calling procs — Chris "ク" Heath <chris@...>
Hi,
[#14911] Draft of some pages about encoding in Ruby 1.9 — Dave Thomas <dave@...>
Folks:
Hi,
Hello Dave,
>
Hi,
Hi,
[#14943] Re: Really strange GC behaviour: Was [BUG] memory leak? — ara howard <ara.t.howard@...>
[#14959] 1.9 RI blowing up, not sure where to report it. — "Rick DeNatale" <rick.denatale@...>
It's unclear to me whether or not the tracker on Rubyforge is still
Rick DeNatale wrote:
[#14965] Before I create a ticket — Dave Thomas <dave@...>
Is it reasonable to expect the following to produce differing counts
[#14976] nil encoding as synonym for binary encoding — David Flanagan <david@...>
The following just appeared in the ChangeLog
Hi,
Dave Thomas wrote:
Dave Thomas schrieb:
Hi,
Yukihiro Matsumoto writes:
Hi,
Yukihiro Matsumoto wrote:
Hi,
Yukihiro Matsumoto wrote:
David Flanagan wrote:
[#15044] Build failures 15007-15013 — Sam Ruby <rubys@...>
Just FYI, starting with 15007, I am not able to do a successful build.
[#15050] how to "borrow" the RDoc::RubyParser and HTMLGenerator — Phlip <phlip2005@...>
Core Rubies:
On Jan 13, 2008, at 08:54 AM, Phlip wrote:
Eric Hodel wrote:
On Jan 13, 2008, at 20:35 PM, Phlip wrote:
Eric Hodel wrote:
On Jan 15, 2008, at 18:19 PM, Phlip wrote:
Eric Hodel wrote:
On Jan 16, 2008, at 15:01 PM, Phlip wrote:
Eric Hodel wrote:
On Jan 17, 2008, at 17:57 PM, Phlip wrote:
Eric Hodel wrote:
[#15056] How to use "addr2line" — SASADA Koichi <ko1@...>
Hi,
[#15069] native_mutex_destroy return non-zero: 16 — Sam Ruby <rubys@...>
Yesterday, I got ruby-openid to work with Ruby 1.9, rev 15006
Hi,
[#15083] Why @hash ||= Hash.new in Set#initialize? — "David A. Black" <dblack@...>
Hi --
[#15092] Module/Class definitions cannot take non literal blocks — "Robert Dober" <robert.dober@...>
Hi list
Hi --
On Jan 16, 2008 1:23 PM, David A. Black <dblack@rubypal.com> wrote:
[#15098] Bug in Date::Infinity#<=> — Dirkjan Bussink <d.bussink@...>
Hi all,
[#15102] REXML::Element.write is deprecated. See REXML::Formatters — Phlip <phlip2005@...>
okay, I saw them. Now what?
Phlip wrote:
> Meanwhile try something like the following:
Phlip wrote:
> I guess I'll let Sean take it from here, other than to note that .to_s
[#15131] test/rdoc/test_simple_markup_attribute_manager.rb:2:in `require': no such file to load -- rdoc/markup/simple_markup/inline (LoadError) — Tanaka Akira <akr@...>
test-all failed as follows.
> test-all failed as follows.
[#15143] Build error, revisions 15119-15126 — Sam Ruby <rubys@...>
This change:
[#15147] String initialziation — Marcin Raczkowski <mailing.mr@...>
Mayby strange question but what happens when someone for example types
Marcin Raczkowski pisze:
Gary Wright wrote:
Marcin Raczkowski schrieb:
> What's your use case? Just curious.
[#15155] an example of performance improvements — Martin Duerst <duerst@...>
For those not reading ruby-dev, I just wanted to point to
[#15164] convert rubynode transforms back into source code? — Phlip <phlip2005@...>
Rubiods:
[#15185] Friendlier methods to compare two Time objects — "Jim Cropcho" <jim.cropcho@...>
Hello,
At 05:42 08/01/23, Kornelius Kalnbach wrote:
Hi,
A new thought:
[#15194] Can large scale projects be successful implemented around a dynamic programming language? — Jordi <mumismo@...>
A good article I have found (may have been linked by slashdot, don't know)
On Thu, 24 Jan 2008 23:17:34 +0900, James Gray wrote:
Jay Levitt wrote:
Kurt Stephens wrote:
[#15199] Two build issues — Dave Thomas <dave@...>
1. If the directory pointed to by --prefix is a symbolic link, then
[#15212] case when syntax changed ??? — "Yvon Thoraval" <yvon.thoraval@...>
did the case when syntax changed with 1.9 ???
[#15217] ruby-1.9.0-0 and Tk — "Yvon Thoraval" <yvon.thoraval@...>
I had successfully tested ruby 1.9 (early december 2007) with Tk, but right
[#15234] Gem install error on head — Dave Thomas <dave@...>
I built HEAD into a totally clean destination (so there were no
On 27/01/2008, Dave Thomas <dave@pragprog.com> wrote:
[#15236] Encoding of unicode strings is now ASCII-8BIT? — Sam Ruby <rubys@...>
Before:
[#15238] CI for Ruby core? — Charles Oliver Nutter <charles.nutter@...>
Perhaps it's time to set up a continuous integration server for ruby
Charles Oliver Nutter wrote:
On Jan 27, 2008 4:01 PM, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
[#15248] Symbol#empty? ? — "David A. Black" <dblack@...>
Hi --
Hi,
[#15257] a new kind of assertion — Phlip <phlip2005@...>
Ruby-core:
On Jan 28, 2008 5:45 AM, Phlip <phlip2005@gmail.com> wrote:
Meinrad Recheis wrote:
+1
Jim Cropcho wrote:
[#15288] Circular dependency: revision 15317 — Sam Ruby <rubys@...>
http://intertwingly.net/projects/ruby19/logs/ruby.html
[#15297] Deletion of element sequence in an Array — Wolfgang Nádasi-Donner <ed.odanow@...>
Hi!
[#15303] Core team, I need your help — "Jonas Pfenniger" <zimbatm@...>
Hi,
[#15308] IRHG - TNODE Documentation? — Charles Thornton <ceo@...>
Is there any documentation on the TNODE
On Wed, Jan 30, 2008 at 03:42:29PM +0900, Charles Thornton wrote:
JRuby stdlib updated to 1.8.6, patch to stdlib attached
JRuby has updated to the 1.8.6_111 stdlib. This was done by diffing our copy of 1.8.5 libraries against actual 1.8.5 and applying the same changes to 1.8.6, then copying them over. I've attached the patch here for your perusal; any changes that seem appropriate to add to core stdlib, please go ahead. We also included a patch for the bug described here: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/12107 ...since it's much more likely that JRuby users will run under Tomcat. - Charlie
Attachments (1)
Index: lib/pathname.rb
===================================================================
--- lib/pathname.rb (revision 14877)
+++ lib/pathname.rb (working copy)
@@ -496,7 +496,10 @@
while r = chop_basename(path)
path, basename = r
end
- path == ''
+ # enebo: mild hack for windows drive letters. Any kook trying
+ # to create a relative path that starts like 'c:/' will be in trouble
+ # so it is not the best solution...
+ path == '' && @path !~ /\A[a-zA-Z]:/
end
#
Index: lib/fileutils.rb
===================================================================
--- lib/fileutils.rb (revision 14877)
+++ lib/fileutils.rb (working copy)
@@ -525,7 +525,7 @@
OPT_TABLE['move'] = [:force, :noop, :verbose, :secure]
def rename_cannot_overwrite_file? #:nodoc:
- /djgpp|cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM
+ /djgpp|cygwin|mswin|mingw|bccwin|wince|emx|java/ =~ RUBY_PLATFORM
end
private_module_function :rename_cannot_overwrite_file?
Index: lib/irb/init.rb
===================================================================
--- lib/irb/init.rb (revision 14877)
+++ lib/irb/init.rb (working copy)
@@ -119,6 +119,10 @@
def IRB.init_error
@CONF[:LC_MESSAGES].load("irb/error.rb")
+ rescue LoadError
+ # ignore; when running from within an archive (JRuby's "complete" jar) this won't load
+ rescue
+ # happens with applet TODO: probably should make this more robust
end
FEATURE_IOPT_CHANGE_VERSION = "1.9.0"
Index: lib/thread.rb
===================================================================
--- lib/thread.rb (revision 14877)
+++ lib/thread.rb (working copy)
@@ -32,448 +32,4 @@
end
end
-#
-# Mutex implements a simple semaphore that can be used to coordinate access to
-# shared data from multiple concurrent threads.
-#
-# Example:
-#
-# require 'thread'
-# semaphore = Mutex.new
-#
-# a = Thread.new {
-# semaphore.synchronize {
-# # access shared resource
-# }
-# }
-#
-# b = Thread.new {
-# semaphore.synchronize {
-# # access shared resource
-# }
-# }
-#
-class Mutex
- #
- # Creates a new Mutex
- #
- def initialize
- @waiting = []
- @locked = false;
- @waiting.taint # enable tainted comunication
- self.taint
- end
-
- #
- # Returns +true+ if this lock is currently held by some thread.
- #
- def locked?
- @locked
- end
-
- #
- # Attempts to obtain the lock and returns immediately. Returns +true+ if the
- # lock was granted.
- #
- def try_lock
- result = false
- Thread.critical = true
- unless @locked
- @locked = true
- result = true
- end
- Thread.critical = false
- result
- end
-
- #
- # Attempts to grab the lock and waits if it isn't available.
- #
- def lock
- while (Thread.critical = true; @locked)
- @waiting.push Thread.current
- Thread.stop
- end
- @locked = true
- Thread.critical = false
- self
- end
-
- #
- # Releases the lock. Returns +nil+ if ref wasn't locked.
- #
- def unlock
- return unless @locked
- Thread.critical = true
- @locked = false
- begin
- t = @waiting.shift
- t.wakeup if t
- rescue ThreadError
- retry
- end
- Thread.critical = false
- begin
- t.run if t
- rescue ThreadError
- end
- self
- end
-
- #
- # Obtains a lock, runs the block, and releases the lock when the block
- # completes. See the example under Mutex.
- #
- def synchronize
- lock
- begin
- yield
- ensure
- unlock
- end
- end
-
- #
- # If the mutex is locked, unlocks the mutex, wakes one waiting thread, and
- # yields in a critical section.
- #
- def exclusive_unlock
- return unless @locked
- Thread.exclusive do
- @locked = false
- begin
- t = @waiting.shift
- t.wakeup if t
- rescue ThreadError
- retry
- end
- yield
- end
- self
- end
-end
-
-#
-# ConditionVariable objects augment class Mutex. Using condition variables,
-# it is possible to suspend while in the middle of a critical section until a
-# resource becomes available.
-#
-# Example:
-#
-# require 'thread'
-#
-# mutex = Mutex.new
-# resource = ConditionVariable.new
-#
-# a = Thread.new {
-# mutex.synchronize {
-# # Thread 'a' now needs the resource
-# resource.wait(mutex)
-# # 'a' can now have the resource
-# }
-# }
-#
-# b = Thread.new {
-# mutex.synchronize {
-# # Thread 'b' has finished using the resource
-# resource.signal
-# }
-# }
-#
-class ConditionVariable
- #
- # Creates a new ConditionVariable
- #
- def initialize
- @waiters = []
- end
-
- #
- # Releases the lock held in +mutex+ and waits; reacquires the lock on wakeup.
- #
- def wait(mutex)
- begin
- mutex.exclusive_unlock do
- @waiters.push(Thread.current)
- Thread.stop
- end
- ensure
- mutex.lock
- end
- end
-
- #
- # Wakes up the first thread in line waiting for this lock.
- #
- def signal
- begin
- t = @waiters.shift
- t.run if t
- rescue ThreadError
- retry
- end
- end
-
- #
- # Wakes up all threads waiting for this lock.
- #
- def broadcast
- waiters0 = nil
- Thread.exclusive do
- waiters0 = @waiters.dup
- @waiters.clear
- end
- for t in waiters0
- begin
- t.run
- rescue ThreadError
- end
- end
- end
-end
-
-#
-# This class provides a way to synchronize communication between threads.
-#
-# Example:
-#
-# require 'thread'
-#
-# queue = Queue.new
-#
-# producer = Thread.new do
-# 5.times do |i|
-# sleep rand(i) # simulate expense
-# queue << i
-# puts "#{i} produced"
-# end
-# end
-#
-# consumer = Thread.new do
-# 5.times do |i|
-# value = queue.pop
-# sleep rand(i/2) # simulate expense
-# puts "consumed #{value}"
-# end
-# end
-#
-# consumer.join
-#
-class Queue
- #
- # Creates a new queue.
- #
- def initialize
- @que = []
- @waiting = []
- @que.taint # enable tainted comunication
- @waiting.taint
- self.taint
- end
-
- #
- # Pushes +obj+ to the queue.
- #
- def push(obj)
- Thread.critical = true
- @que.push obj
- begin
- t = @waiting.shift
- t.wakeup if t
- rescue ThreadError
- retry
- ensure
- Thread.critical = false
- end
- begin
- t.run if t
- rescue ThreadError
- end
- end
-
- #
- # Alias of push
- #
- alias << push
-
- #
- # Alias of push
- #
- alias enq push
-
- #
- # Retrieves data from the queue. If the queue is empty, the calling thread is
- # suspended until data is pushed onto the queue. If +non_block+ is true, the
- # thread isn't suspended, and an exception is raised.
- #
- def pop(non_block=false)
- while (Thread.critical = true; @que.empty?)
- raise ThreadError, "queue empty" if non_block
- @waiting.push Thread.current
- Thread.stop
- end
- @que.shift
- ensure
- Thread.critical = false
- end
-
- #
- # Alias of pop
- #
- alias shift pop
-
- #
- # Alias of pop
- #
- alias deq pop
-
- #
- # Returns +true+ is the queue is empty.
- #
- def empty?
- @que.empty?
- end
-
- #
- # Removes all objects from the queue.
- #
- def clear
- @que.clear
- end
-
- #
- # Returns the length of the queue.
- #
- def length
- @que.length
- end
-
- #
- # Alias of length.
- #
- alias size length
-
- #
- # Returns the number of threads waiting on the queue.
- #
- def num_waiting
- @waiting.size
- end
-end
-
-#
-# This class represents queues of specified size capacity. The push operation
-# may be blocked if the capacity is full.
-#
-# See Queue for an example of how a SizedQueue works.
-#
-class SizedQueue<Queue
- #
- # Creates a fixed-length queue with a maximum size of +max+.
- #
- def initialize(max)
- raise ArgumentError, "queue size must be positive" unless max > 0
- @max = max
- @queue_wait = []
- @queue_wait.taint # enable tainted comunication
- super()
- end
-
- #
- # Returns the maximum size of the queue.
- #
- def max
- @max
- end
-
- #
- # Sets the maximum size of the queue.
- #
- def max=(max)
- Thread.critical = true
- if max <= @max
- @max = max
- Thread.critical = false
- else
- diff = max - @max
- @max = max
- Thread.critical = false
- diff.times do
- begin
- t = @queue_wait.shift
- t.run if t
- rescue ThreadError
- retry
- end
- end
- end
- max
- end
-
- #
- # Pushes +obj+ to the queue. If there is no space left in the queue, waits
- # until space becomes available.
- #
- def push(obj)
- Thread.critical = true
- while @que.length >= @max
- @queue_wait.push Thread.current
- Thread.stop
- Thread.critical = true
- end
- super
- end
-
- #
- # Alias of push
- #
- alias << push
-
- #
- # Alias of push
- #
- alias enq push
-
- #
- # Retrieves data from the queue and runs a waiting thread, if any.
- #
- def pop(*args)
- retval = super
- Thread.critical = true
- if @que.length < @max
- begin
- t = @queue_wait.shift
- t.wakeup if t
- rescue ThreadError
- retry
- ensure
- Thread.critical = false
- end
- begin
- t.run if t
- rescue ThreadError
- end
- end
- retval
- end
-
- #
- # Alias of pop
- #
- alias shift pop
-
- #
- # Alias of pop
- #
- alias deq pop
-
- #
- # Returns the number of threads waiting on the queue.
- #
- def num_waiting
- @waiting.size + @queue_wait.size
- end
-end
-
-# Documentation comments:
-# - How do you make RDoc inherit documentation from superclass?
+require 'thread.so'
Index: lib/net/protocol.rb
===================================================================
--- lib/net/protocol.rb (revision 14877)
+++ lib/net/protocol.rb (working copy)
@@ -130,7 +130,7 @@
def rbuf_fill
timeout(@read_timeout) {
- @rbuf << @io.sysread(1024)
+ @rbuf << @io.sysread(8196)
}
end
Index: lib/debug.rb
===================================================================
--- lib/debug.rb (revision 14877)
+++ lib/debug.rb (working copy)
@@ -255,9 +255,10 @@
def debug_command(file, line, id, binding)
MUTEX.lock
- unless defined?($debugger_restart) and $debugger_restart
- callcc{|c| $debugger_restart = c}
- end
+# This is removed, since JRuby doesn't support continuations
+# unless defined?($debugger_restart) and $debugger_restart
+# callcc{|c| $debugger_restart = c}
+# end
set_last_thread(Thread.current)
frame_pos = 0
binding_file = file
@@ -528,7 +529,8 @@
stdout.printf "%s\n", debug_eval($', binding).inspect
when /^\s*r(?:estart)?$/
- $debugger_restart.call
+ stdout.print "JRuby doesn't support the command restart, since it depends on continuations"
+# $debugger_restart.call
when /^\s*h(?:elp)?$/
debug_print_help()
Index: lib/generator.rb
===================================================================
--- lib/generator.rb (revision 14877)
+++ lib/generator.rb (working copy)
@@ -56,115 +56,9 @@
# puts g.next
# end
#
-class Generator
- include Enumerable
- # Creates a new generator either from an Enumerable object or from a
- # block.
- #
- # In the former, block is ignored even if given.
- #
- # In the latter, the given block is called with the generator
- # itself, and expected to call the +yield+ method for each element.
- def initialize(enum = nil, &block)
- if enum
- @block = proc { |g|
- enum.each { |x| g.yield x }
- }
- else
- @block = block
- end
+require 'generator_internal'
- @index = 0
- @queue = []
- @cont_next = @cont_yield = @cont_endp = nil
-
- if @cont_next = callcc { |c| c }
- @block.call(self)
-
- @cont_endp.call(nil) if @cont_endp
- end
-
- self
- end
-
- # Yields an element to the generator.
- def yield(value)
- if @cont_yield = callcc { |c| c }
- @queue << value
- @cont_next.call(nil)
- end
-
- self
- end
-
- # Returns true if the generator has reached the end.
- def end?()
- if @cont_endp = callcc { |c| c }
- @cont_yield.nil? && @queue.empty?
- else
- @queue.empty?
- end
- end
-
- # Returns true if the generator has not reached the end yet.
- def next?()
- !end?
- end
-
- # Returns the current index (position) counting from zero.
- def index()
- @index
- end
-
- # Returns the current index (position) counting from zero.
- def pos()
- @index
- end
-
- # Returns the element at the current position and moves forward.
- def next()
- if end?
- raise EOFError, "no more elements available"
- end
-
- if @cont_next = callcc { |c| c }
- @cont_yield.call(nil) if @cont_yield
- end
-
- @index += 1
-
- @queue.shift
- end
-
- # Returns the element at the current position.
- def current()
- if @queue.empty?
- raise EOFError, "no more elements available"
- end
-
- @queue.first
- end
-
- # Rewinds the generator.
- def rewind()
- initialize(nil, &@block) if @index.nonzero?
-
- self
- end
-
- # Rewinds the generator and enumerates the elements.
- def each
- rewind
-
- until end?
- yield self.next
- end
-
- self
- end
-end
-
#
# SyncEnumerator creates an Enumerable object from multiple Enumerable
# objects and enumerates them synchronously.