浏览 2209 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (8)
|
|
---|---|
作者 | 正文 |
发表时间:2008-09-12
$LOAD_PATH in ruby is similar to class_path in java. class_path contains many jar position. every jar has its own structure leading to a java File. $LOAD_PATH contains many ruby lib position. usually, in lib directory, a directory containing different ruby Files can be found. for example: ../lib/spec/ ../lib/spec.rb $LOAD_PATH can be set up like : $LOAD_PATH << ..../lib and then we can require what we need like : require "spec", this way, the spec.rb file is required. we don't need to specify the entire path in require command. how does it work in rails? in rails, the gem libary is included in enviroment.rb usually. rspec plugin is include in spec.rake, because rspec is runned always by rake. 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |