`
liano
  • 浏览: 25859 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

LOAD_PATH and CLASS_PATH

阅读更多
$LOAD_PATH in ruby.

$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.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics