Skip to main content

Timeline for answer to How do I import ruby classes into the main file? by Keith Bennett

Current License: CC BY-SA 4.0

Post Revisions

5 events
when toggle format what by license comment
Jul 28, 2019 at 12:22 comment added Keith Bennett There are times when you want to use require for files though. I'd say in general use require unless you have a problem, otherwise use require_relative. You could also use require_relative if you need to make sure where the file is being loaded from, as opposed to having it be loaded from anywhere in the load paths.
S Jul 22, 2019 at 14:03 history suggested iluu CC BY-SA 4.0
Consistent formatting
Jul 22, 2019 at 11:58 review Suggested edits
S Jul 22, 2019 at 14:03
May 31, 2016 at 3:06 comment added 13aal This is more descriptive of the differences than mine is, an easy way to remember which one to use is like how I was taught, require is for gems and require_relative is for files
May 31, 2016 at 3:00 history answered Keith Bennett CC BY-SA 3.0