[#31589] [Bug #3457] URI.encode does not escape square brackets — Shyouhei Urabe <redmine@...>
Issue #3457 has been updated by Shyouhei Urabe.
2010/8/2 Shyouhei Urabe <redmine@ruby-lang.org>:
[#31614] Release engineering status of 1.9.2-p0 — Yusuke ENDOH <mame@...>
Hi,
[#31666] [Bug #3677] unable to run certain gem binaries' in windows 7 — Roger Pack <redmine@...>
Bug #3677: unable to run certain gem binaries' in windows 7
Issue #3677 has been updated by Roger Pack.
[#31681] [Bug #3683] getgrnam on computer with NIS group (+)? — Rocky Bernstein <redmine@...>
Bug #3683: getgrnam on computer with NIS group (+)?
Issue #3683 has been updated by Rocky Bernstein.
Hi,
[#31706] [Bug #3690] method_missing in a BasicObject's singleton class - infinite recursion segfaults — Jan Lelis <redmine@...>
Bug #3690: method_missing in a BasicObject's singleton class - infinite recursion segfaults
[#31730] [Bug #3701] Gem.find_files returns empty array — Yusuke Endoh <redmine@...>
Bug #3701: Gem.find_files returns empty array
[#31739] [Backport #3702] segmentation fault while compiling 1.9.1-p430 on debian squeeze — Tomasz Pajor <redmine@...>
Backport #3702: segmentation fault while compiling 1.9.1-p430 on debian squeeze
[#31757] [Bug #3712] SEGV fails to produce stack dump / backtrace in debug build — Peter Weldon <redmine@...>
Bug #3712: SEGV fails to produce stack dump / backtrace in debug build
[#31761] [Feature #3714] Add getters for Enumerator — Marc-Andre Lafortune <redmine@...>
Feature #3714: Add getters for Enumerator
[#31762] [Backport #3715] Enumerator#size and #size= — Marc-Andre Lafortune <redmine@...>
Backport #3715: Enumerator#size and #size=
[#31798] [Bug #3726] require degradation from 1.9.1 — Yura Sokolov <redmine@...>
Bug #3726: require degradation from 1.9.1
[#31805] [Backport #3728] IO.select is not documented. — Mike Perham <redmine@...>
Backport #3728: IO.select is not documented.
[#31806] 1.9.1 has marshal bugs in everything but p129 — Ryan Davis <ryand-ruby@...>
Is there any chance we can release a 1.9.1 that fixes the current marshal bugs? It is fixed in 1.9.2, so I know the patch exists somewhere and could be merged over. Otherwise I think I'm going to have to drop support for 1.9.1 early.
[#31843] Garbage Collection Question — Asher <asher@...>
This question is no doubt a function of my own lack of understanding, but I think that asking it will at least help some other folks see what's going on with the internals during garbage collection.
> The question in short: when an object goes out of scope and has no
Right - so how does a pointer ever get off the stack?
On 8/26/10 11:51 AM, Asher wrote:
I very much appreciate the response, and this is helpful in describing the narrative, but it's still a few steps behind my question - but it may very well have clarified some points that help us get there.
You have introduced something called a "root node" without defining it. What do you mean by this?
[#31851] [Bug #3747] Possible bug of String#count? — Ruohao Li <redmine@...>
Bug #3747: Possible bug of String#count?
[#31868] [Bug #3750] SEGV: ruby -rprofile test/ruby/test_assignment.rb — Peter Weldon <redmine@...>
Bug #3750: SEGV: ruby -rprofile test/ruby/test_assignment.rb
[#31885] Avoiding $LOAD_PATH pollution — Eric Hodel <drbrain@...7.net>
Last year Nobu asked me to propose an API for adding an object to
Hi Eric,
On Jan 8, 2011, at 12:08, zimbatm ... wrote:
Just a note for future references. While playing with require, I found
> The lookup object pushed onto $LOAD_PATH must respond to #path_for. The
On Aug 28, 2010, at 19:30, Run Paint Run Run wrote:
>> How confident are we that this API would be sufficient for replacing the
[#31914] [Ruby 1.8.7-RubySpec#3757][Open] GC bug after loading gem — Joel VanderWerf <redmine@...>
RubySpec #3757: GC bug after loading gem
[#31929] Proposal: Autoload with block — Magnus Holm <judofyr@...>
= A proposal for autoload w/block:
Sorry to plug my own stuff, but you might find subload of some interest here. It's unfinished, but provides some flexibility in these matters that might be of interest. I also have a fair amount of notes about possible other use cases that aren't covered yet in the subload code. Whilst on the topic, some consideration for thread safety might be worth the time - not that I'm proposing it can be 'fixed', merely considered to avoid worst cases.
Magnus, have you seen http://redmine.ruby-lang.org/issues/show/462 ?
That's interesting, but I don't buy matz' argument:
[#31947] not use system for default encoding — Roger Pack <rogerdpack2@...>
It strikes me as a bit "scary" to use system locale settings to
> It strikes me as a bit "scary" to use system locale settings to *arbitrarily*
NARUSE, Yui wrote on 2010-11-15 11:07:
[#31969] [Ruby 1.9-Feature#3773][Open] Module#parent — Thomas Sawyer <redmine@...>
Feature #3773: Module#parent
[#31971] Change Ruby's License to BSDL + Ruby's dual license — "NARUSE, Yui" <naruse@...>
Ruby's License will change to BSDL + Ruby's dual license
On 01/09/10 at 01:30 +0900, NARUSE, Yui wrote:
(2010/09/01 2:36), Lucas Nussbaum wrote:
I wrote a concrete patch.
(2010/09/01 1:30), NARUSE, Yui wrote:
On Aug 31, 2010, at 9:50 AM, NARUSE, Yui wrote:
[ruby-core:31929] Proposal: Autoload with block
= A proposal for autoload w/block:
== autoload(:Constant, &blk)
== autoload(&blk)
When Constant is accessed, the following happens:
1. The block is called with the constant name as a parameter and the scope
where it's looking for the constant as self:
scope.instance_exec(:Constant, &blk)
2. If the block raises an error, the error isn't rescued
3. If the block raises a specific error or throws something specific,
it signals that the constant is missing unless it has been set earlier
in the block:
3a. It checks if the constant is defined now
3b. If not, the constant doesn't exists and it'll continue searching for
the constant in the constant chain.
4. If the block succeeds:
4a. It sets the constant to result of the block
If you don't specify a constant name to autoload, it will catch all
missing constants, but otherwise it works exactly the same as above.
There should also be a way to specify an autoload which triggers on all
scopes. So with the given code:
# Not sure about how we should specify it though:
autoload(true) do
throw :stop
end
module Foo::Bar
p Hello
end
It will run the autoload block with respectivly Foo::Bar and Object as
scope (as opposed to Foo::Bar, Foo and Object which it'll search through
if you hack it up with const_missing).
There are basically two scenarios which this API covers:
- Easily use autoload without using #const_set:
autoload(:C) { generate_C }
- Run code which might set the constant:
autoload(:C) { set_C; throw :stop }
- The two scenarios above with an unspecified constant name.
None of these changes previous behaviour and you can also create a Ruby
monkey-patch which sort-of works similar through #const_missing (which you
can use where this proposal isn't implemented).
= Example of uses
== Camping
In Camping (http://whywentcamping.com) we use autoload to load optional
features which requires dependencies. Example:
# in camping.rb
module Camping
autoload :Template, "camping/template"
end
# in camping/template.rb
require 'tilt'
module Camping
Template = Tilt
end
With the proposed changes to autoload, this could be written as:
# in camping.rb
module Camping
autoload(:Template) { require 'tilt'; Tilt }
end
Which is way easier to maintain and understand for everyone.
=== Rails
Rails overwrites const_missing in order to automagically load files
(from different locations) when a constant is accessed. Example of how
this could be implemented with the proposed autoload:
autoload do |constant|
# Convert FooBar to foo_bar.rb
file = constant.to_s.underscore + '.rb'
# Search through the list of directores:
Rails.autoload_paths.each do |dir|
full_path = File.join(dir, file)
# Load the file and stop searching:
File.exists?(full_path) && load(full_path) && break
end
throw :stop
end
This is also more correct than Rails' version, which can't use the proper
cref because it uses const_missing:
module Foo::Bar
p Hello
end
Rails will search through Foo::Bar, Foo and Object instead of Foo::Bar and
Object. This is really impossible to properly implement with
const_missing, but is doable with autoload with blocks.
=== Implementing regular autoload in Ruby
Just to show that this implementation is the general case of autoloading,
implementing regular autoloading is really simple with this API:
autoload(:Constant) { load(file); throw :stop }
= Thoughts?
What are your thoughts on:
- A more general autoload solution?
- This proposal?
- Other ways to solve this "problem"?
// Magnus Holm