开发者

Organising Rails source files

开发者 https://www.devze.com 2023-02-18 04:41 出处:网络
If i want to move /lib/foo_bar.rb to /lib/tidy/foo_bar.rb or even /lib/tidy/somestuff/foo_bar.rb must i declare FooBar to be module Tidy or module Tidy::Som开发者_运维技巧estuff

If i want to move /lib/foo_bar.rb to /lib/tidy/foo_bar.rb or even /lib/tidy/somestuff/foo_bar.rb

must i declare FooBar to be module Tidy or module Tidy::Som开发者_运维技巧estuff

in other words must the modules match the directory structure?


Yes, if you don't want to specify the load path. You can add lib/tidy to the LOAD_PATH and then Rails will find it, but it's easier to just stick with the conventions

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号