[#46340] ASR 1.8.7 同梱の exerb で生成したプログラムが enumerator を見つけられない — "(株)ネットフォレスト 植田裕之" <ueda@...>
植田と申します。
10 messages
2009/09/01
[#46344] Re: ASR 1.8.7 同梱の exerb で生成したプログラムが enumerator を見つけられない
— arton <artonx@...>
2009/09/01
artonです。
[#46345] Re: ASR 1.8.7 同梱の exerb で生成したプログラムが enumerator を見つけられない
— "NARUSE, Yui" <naruse@...>
2009/09/01
成瀬です。
[#46346] Re: ASR 1.8.7 同梱の exerb で生成したプログラムが enumerator を見つけられない
— "(株)ネットフォレスト 植田裕之" <ueda@...>
2009/09/02
植田です。こんにちは。
[#46347] requireが失敗することについて — 北村寛 <kitayuta@...>
北村と申します。最近Rubyを始めた初心者です。
6 messages
2009/09/02
[#46378] 最も低コストの方法は? — 大田黒俊夫 <toshio.otaguro@...>
質問です.
8 messages
2009/09/11
[#46380] Re: 最も低コストの方法は?
— rubikitch@...
2009/09/11
From: 大田黒俊夫 <toshio.otaguro@gmail.com>
[#46386] Rubyの演習問題 — "Tetsuya Kamisawa" <kami@...2000.net>
はじめて投稿させていただきます、神沢と申します。
6 messages
2009/09/12
[#46403] moodle と連携した eラーニング教材開発について — "Hideo Konami" <konami@...>
京都女子大の小波です。
3 messages
2009/09/21
[#46408] html→csv変換|tableのセル結合に対応したものは? — YOSHIIZUMI <t-yoshiizumi@...>
吉泉といいます。
7 messages
2009/09/23
[#46410] 再送;;ruby1.8.7と1.9.2の文字処理について — eiichi_maekawa@...
6 messages
2009/09/24
[#46426] DateTime#to_time — "T.Soejima" <clev@...2.so-net.ne.jp>
相変わらず ruby 勉強中のそえじまです。
11 messages
2009/09/30
[#46432] Re: DateTime#to_time
— masayoshi takahashi <maki@...>
2009/09/30
高橋征義です。『たのしいRuby』の方から来ました。
[#46427] Re: DateTime#to_time
— "NARUSE, Yui" <naruse@...>
2009/09/30
成瀬です。
[#46429] Re: DateTime#to_time
— "T.Soejima" <clev@...2.so-net.ne.jp>
2009/09/30
成瀬さん、ありがとうございます。
[ruby-list:46362] Re: 自前コンパイルしたruby1.9の$LOAD_PATHに"."が入っていない
From:
rubikitch@...
Date:
2009-09-06 07:52:48 UTC
List:
ruby-list #46362
From: KURODA Hiraku <hiraku@sapporo.email.ne.jp>
Subject: [ruby-list:46359] Re: 自前コンパイルしたruby1.9の$LOAD_PATHに"."が入っていない
Date: Sat, 5 Sep 2009 17:16:31 +0900
> 自作ライブラリのテストを"."が含まれている前提で書いていてこの問題に引っかかったのですが、
> やはり仕様だったようです。
>
> ただ、何か理由(セキュリティ上のもの?)があって外された様なので、"."ではなく__FILE__を使う方が
> 良いのかもしれません。
Kernel#require_relative を使えということでしょうね。
------------------------------------ Kernel#require_relative
require_relative(path)
------------------------------------------------------------
require_relative complements the builtin method
require by allowing you to load a file that is
relative to the file containing the require_relative
statement.
When you use require to load a file, you are usually
accessing functionality that has been properly
installed, and made accessible, in your system.
require does not offer a good solution for loading
files within the project's code. This may be useful
during a development phase, for accessing test data,
or even for accessing files that are "locked" away
inside a project, not intended for outside use.
For example, if you have unit test classes in the
"test" directory, and data for them under the test
"test/data" directory, then you might use a line like
this in a test case:
require_relative "data/customer_data_1"
Since neither "test" nor "test/data" are likely to be
in Ruby's library path (and for good reason), a normal
require won't find them. require_relative is a good
solution for this particular problem.
You may include or omit the extension (.rb or .so) of
the file you are loading.
path must respond to to_str.
--
rubikitch
Blog: http://d.hatena.ne.jp/rubikitch/
Site: http://www.rubyist.net/~rubikitch/
Twit: http://twitter.com/rubikitch/
『Ruby逆引きハンドブック』 http://d.hatena.ne.jp/rubikitch/20090525/rubybook