Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Switch 'require' to 'require_relative'? #10

Open
gehrhorn opened this issue Jun 10, 2013 · 4 comments
Open

Switch 'require' to 'require_relative'? #10

gehrhorn opened this issue Jun 10, 2013 · 4 comments
Labels

Comments

@gehrhorn
Copy link
Contributor

(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?

@jamesbcook
Copy link
Contributor

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'

fwininger added a commit to fwininger/ruby-nessus that referenced this issue Dec 5, 2017
@djcas9
Copy link
Owner

djcas9 commented Dec 11, 2017

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

@fwininger
Copy link
Collaborator

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.

@djcas9
Copy link
Owner

djcas9 commented Jan 4, 2018

@fwininger cool, agree

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants