ruby-dev summary: 22688-22826

  • Thread starter Masayoshi Takahashi
  • Start date
M

Masayoshi Takahashi

Hello all,

This is a summry of ruby-dev ML in these days.


[ruby-dev:22688] output directory for extensions

Nobu Nakada pointed out that some applications and libraries,
such as bin/rdoc and test/runner.rb, need external library
and they can not be executed before install.
So Nobu made a patch to make temporary directories
which has the same hierarchy as one after install.


[ruby-dev:22691] new standard library in the next release

Shinya Kawaji asked a plan of new standard library for the next
release(1.8.2 or 1.9.0).

Matz mentioned three points to decide to add as standard with:

* need
* maturity
* maintainer

and we should review the candidates enough.

Kawaji recommended rss library made by Kouhei Sutou, and
Sutou agreed to be a mainteiner.

Kawaji also recommended ruby-dbi and o_dbm, and Keiju Ishitsuka,
the author of o_dbm, agreed to be a mainteiner, but he was afraid
of lack of documents in English.

Masahiro Tomita proposed to add Ruby/MySQL, MySQL client library
written in Ruby, in the standard distribution with ruby-dbi.


[ruby-dev:22763] $: trick in test/*
[ruby-dev:22788] relative load/require (Re: Re: $: trick in test/*)

NaHi pointed out that some test cases in src/ruby/test/*
changed the value of $: and load files in current directories.
But he didn't think it smart because the value of $: were
shared with all test cases, so he proposed to delete
this $: trick.

But Tanaka Akira had a different opinion. He suggests
to solve this problem generally; to add a new method
to load with relative path.
Matz disagree to make the require method load libraries
with relative path, but he allowed other method to do it.
Some details are not determined yet:

* name
* handling of symbolic link

In addition, Tanaka made an advice to record the full path
in $:. Matz agreed and promised to implement it when
he has a time to do.


[ruby-dev:22790] avoid duplicate load/require in Win32

In relation to the previous topic, take_tk made a request to ignore
cases of library path in the file system which didn't distinguish
cases. But Matz felt he should take case of case of path when
he uses case-insensitive platform, and rejected the request.


[ruby-dev:22802] [Oniguruma] Version 2.1.0

Kosako announced that Oniguruma 2.1.0 is released.

Changes:
1. change prefix of API (REG_ --> ONIG_, regex_ --> onig_)
2. fix some bugs
3. add to support character set
EUC-TW, EUC-KR, EUC-CN, KOI8, KOI8-R,
ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,
ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-11


Regards,

TAKAHASHI 'Maki' Masayoshi E-mail: (e-mail address removed)
 
P

Paul Brannan

But Tanaka Akira had a different opinion. He suggests
to solve this problem generally; to add a new method
to load with relative path.
Matz disagree to make the require method load libraries
with relative path, but he allowed other method to do it.
Some details are not determined yet:

* name
* handling of symbolic link

In addition, Tanaka made an advice to record the full path
in $:. Matz agreed and promised to implement it when
he has a time to do.

For the record, I really like both of these ideas; they would completely
eliminate the use I have for requirelocal/loadlocal in RubyTreasures.
[ruby-dev:22790] avoid duplicate load/require in Win32

In relation to the previous topic, take_tk made a request to ignore
cases of library path in the file system which didn't distinguish
cases. But Matz felt he should take case of case of path when
he uses case-insensitive platform, and rejected the request.

What is "case of case of path"?

It seems to me the right way to handle this problem is to use a
case-sensitive require (if the case of the require doesn't match the
case of the file being required, then raise an exception). The reason
is that code that assumes case doesn't matter will break when it is
ported to a system where case does matter.

Paul
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: ruby-dev summary: 22688-22826"

|> Matz disagree to make the require method load libraries
|> with relative path, but he allowed other method to do it.
|> Some details are not determined yet:
|>
|> * name
|> * handling of symbolic link
|>
|> In addition, Tanaka made an advice to record the full path
|> in $:. Matz agreed and promised to implement it when
|> he has a time to do.
|
|For the record, I really like both of these ideas; they would completely
|eliminate the use I have for requirelocal/loadlocal in RubyTreasures.

Any name suggestion?

|> [ruby-dev:22790] avoid duplicate load/require in Win32
|>
|> In relation to the previous topic, take_tk made a request to ignore
|> cases of library path in the file system which didn't distinguish
|> cases. But Matz felt he should take case of case of path when
|> he uses case-insensitive platform, and rejected the request.
|
|What is "case of case of path"?

Read "Matz felt one should care about case of path even when he/she
uses case-insensitive platform".

matz.
 
A

Ara.T.Howard

Date: Thu, 12 Feb 2004 08:36:03 +0900
From: Yukihiro Matsumoto <[email protected]>
Newsgroups: comp.lang.ruby
Subject: Re: ruby-dev summary: 22688-22826

Hi,

In message "Re: ruby-dev summary: 22688-22826"

|> Matz disagree to make the require method load libraries
|> with relative path, but he allowed other method to do it.
|> Some details are not determined yet:
|>
|> * name
|> * handling of symbolic link
|>
|> In addition, Tanaka made an advice to record the full path
|> in $:. Matz agreed and promised to implement it when
|> he has a time to do.
|
|For the record, I really like both of these ideas; they would completely
|eliminate the use I have for requirelocal/loadlocal in RubyTreasures.

Any name suggestion?


* link

as in ld. i say this because it would be used primarily with
packages/libraires trying to 'link' to dependancies...

the sematics of link would be

- first try relative
- then try $:

a notion of version could be added if that could ever be agreed upon, eg

link 'foobar-1.0.0'

mighit load foobar-2.1.1 if it were available (using libtool style
versioning => interface.age.impl)

* relative

a keyword/method to transform a path into a relative one

def this path
require 'pathname'
File.join(Pathname.new(File.dirname(File.expand_path(__FILE__))).realpath, path)
end

require relative 'sub-package'

* include

effectively 'require relative'

-a
--

ATTN: please update your address books with address below!

===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP :: http://www.ngdc.noaa.gov/stp/
| NGDC :: http://www.ngdc.noaa.gov/
| NESDIS :: http://www.nesdis.noaa.gov/
| NOAA :: http://www.noaa.gov/
| US DOC :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.
| Art is everything else.
| -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
===============================================================================
 
N

NAKAMURA, Hiroshi

Hi,
From: "Masayoshi Takahashi" <[email protected]>
Sent: Thursday, February 12, 2004 3:45 AM
This is a summry of ruby-dev ML in these days.

My thanks go as well to ruby-dev summary team.
[ruby-dev:22763] $: trick in test/*
[ruby-dev:22788] relative load/require (Re: Re: $: trick in test/*)

NaHi pointed out that some test cases in src/ruby/test/*
changed the value of $: and load files in current directories.
But he didn't think it smart because the value of $: were
shared with all test cases, so he proposed to delete
this $: trick.

Note: all tricks are removed from testcases. Run test through
test/runner.rb even if you run a test separately. test/runner.rb do
the trick instead. e.g.
$ ruby test/runner.rb test/soap/helloworld/test_helloworld.rb

Regards,
// NaHi
 
T

Tanaka Akira

Ara.T.Howard said:
* link

as in ld. i say this because it would be used primarily with
packages/libraires trying to 'link' to dependancies...

the sematics of link would be

- first try relative
- then try $:

I can't imagine a situation that needs relative path and $: in single
method because I know a file which pointed by the relative path is
exist or not when I write link '...'. If the file exists, $: is never
used. If not, 'require' can be used instead.
* relative

a keyword/method to transform a path into a relative one

The relative keyword needs language change. It's too drastic to this issue.

I feel the relative method is too tricky.
* include

It is already used as Module#include.
 
T

Tim Sutherland

[...]
Masahiro Tomita proposed to add Ruby/MySQL, MySQL client library
written in Ruby, in the standard distribution with ruby-dbi.

Great. This would save the headaches some win32 users have been having with
the other mysql library. (And also help license-wise.)
[ruby-dev:22763] $: trick in test/*
[ruby-dev:22788] relative load/require (Re: Re: $: trick in test/*)

NaHi pointed out that some test cases in src/ruby/test/*
changed the value of $: and load files in current directories.
But he didn't think it smart because the value of $: were
shared with all test cases, so he proposed to delete
this $: trick.

But Tanaka Akira had a different opinion. He suggests
to solve this problem generally; to add a new method
to load with relative path.
Matz disagree to make the require method load libraries
with relative path, but he allowed other method to do it.
Some details are not determined yet:

* name
* handling of symbolic link
[...]

I use a method I wrote called `File.relative'. For example

/home/tim/work/relative/main.rb:

class << File
def relative(base, restpath)
File.join(File.dirname(base), restpath)
end
end

# Loads /home/tim/work/relative/foo/bar.rb
require File.relative(__FILE__, 'foo/bar')

One thing I like about this solution is that it can be used for more than
just `require'.
 
P

Paul Brannan

|For the record, I really like both of these ideas; they would completely
|eliminate the use I have for requirelocal/loadlocal in RubyTreasures.

Any name suggestion?

Well obviously I've been using "requirelocal" to mean "require a file
with a path relative to the currently executing file". I have a lot of
code that uses that method, but I've never liked the name.

I do like the "require relative" idea proposed in [ruby-talk:92655].

Whatever method name is used, IMO it should indicate that the operation
is similar in function to a require (so "import" and "include" are
out -- though "include" is out for other reasons).

Paul
 
A

Ara.T.Howard

Date: Thu, 12 Feb 2004 13:50:54 +0900
From: Tanaka Akira <[email protected]>
Newsgroups: comp.lang.ruby
Subject: Re: ruby-dev summary: 22688-22826



I can't imagine a situation that needs relative path and $: in single method
because I know a file which pointed by the relative path is exist or not
when I write link '...'. If the file exists, $: is never used. If not,
'require' can be used instead.

the situation is the one where you include a module, say strinio or yaml, with
your distribution because it is not yet part of ruby. you would like,
however, for your 'require' line to pick up the system one if it is installed
locally - i've been here before...
The relative keyword needs language change. It's too drastic to this issue.

I feel the relative method is too tricky.

how so? wouldn't a simple method to transform a path suffice?

~/eg/ruby > cat relative.rb
require 'pathname'

module Kernel
def relative path
File.join(
Pathname.new(File.dirname(File.expand_path(__FILE__))).realpath.to_s,
path
)
end
end

p(relative('foo'))
p(relative('foo.rb'))
p(relative('foo/bar'))

#require relative 'foo'

~/eg/ruby > ruby relative.rb
"/home/ahoward/eg/ruby/foo"
"/home/ahoward/eg/ruby/foo.rb"
"/home/ahoward/eg/ruby/foo/bar"

am i missing something?
It is already used as Module#include.

yes - meant to delete that before sending.


regards.

-a
--

ATTN: please update your address books with address below!

===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP :: http://www.ngdc.noaa.gov/stp/
| NGDC :: http://www.ngdc.noaa.gov/
| NESDIS :: http://www.nesdis.noaa.gov/
| NOAA :: http://www.noaa.gov/
| US DOC :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.
| Art is everything else.
| -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
===============================================================================
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: ruby-dev summary: 22688-22826"

|> > * relative
|> >
|> > a keyword/method to transform a path into a relative one
|>
|> The relative keyword needs language change. It's too drastic to this issue.
|>
|> I feel the relative method is too tricky.
|
|how so? wouldn't a simple method to transform a path suffice?

The point is the word "relative" itself is not specifically related to
file path.

matz.
 
A

Ara.T.Howard

Date: Fri, 13 Feb 2004 01:07:25 +0900
From: Yukihiro Matsumoto <[email protected]>
Newsgroups: comp.lang.ruby
Subject: Re: ruby-dev summary: 22688-22826

Hi,

In message "Re: ruby-dev summary: 22688-22826"

|> > * relative
|> >
|> > a keyword/method to transform a path into a relative one
|>
|> The relative keyword needs language change. It's too drastic to this issue.
|>
|> I feel the relative method is too tricky.
|
|how so? wouldn't a simple method to transform a path suffice?

The point is the word "relative" itself is not specifically related to
file path.

matz.

at least it's better than cousin or uncle! ;-)

i see your point... how about 'Kernel.relpath'

module Kernel
def relpath path, origin = __FILE__
File.join(
Pathname.new(File.dirname(File.expand_path(origin))).realpath.to_s,
*(File.split(path))
)
end
end

tho perhaps that should belong in File instead of Kernel it nicer to see

require relpath 'foo/bar'

than

require File.relpath 'foo/bar'


maybe both...

-a
 
T

TAKAHASHI Masayoshi

|> [ruby-dev:22790] avoid duplicate load/require in Win32
|>
|> In relation to the previous topic, take_tk made a request to ignore
|> cases of library path in the file system which didn't distinguish
|> cases. But Matz felt he should take case of case of path when
|> he uses case-insensitive platform, and rejected the request.
|
|What is "case of case of path"?

Read "Matz felt one should care about case of path even when he/she
uses case-insensitive platform".

Oops, sorry. I always thank for (a lot of) your patience.


Lyle Johnson said:

Yes. He said he had a plan to improve it, but he wouldn't
change the API ([ruby-dev:22726]).


Regards,

Masayoshi Takahashi ([email protected])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top