ruby-nessus icon indicating copy to clipboard operation
ruby-nessus copied to clipboard

Switch 'require' to 'require_relative'?

Open gehrhorn opened this issue 12 years ago • 4 comments

(I don't know what best practice is here.)

I want to extend a portion of the library. In my file that I'm using to test it I do require_relative '../ruby-nessus/lib/nessus.rb' However, internal to the lib/ directory everything uses require. So my script does a 'relative require' which loads files that do a regular 'require', which is using the installed gem (this is my best understanding of what's actually happening). Short of creating a gem and installing it every time I make a change, what is the best way of handing this?

gehrhorn avatar Jun 10 '13 19:06 gehrhorn

I don't have the gem installed where I'm doing the testing work, but this is what I'm using to load the file. Hope this works for you.

$LOAD_PATH << 'lib' require 'nessus'

jamesbcook avatar Sep 04 '15 00:09 jamesbcook

@fwininger has this been fixed with anything added by you recently.

djcas9 avatar Dec 11 '17 17:12 djcas9

I think it's not a good pratices to extend the library with a require relative. I recommand to use a Gemfile and bundle to require the gem in a other project.

fwininger avatar Dec 11 '17 20:12 fwininger

@fwininger cool, agree

djcas9 avatar Jan 04 '18 18:01 djcas9