Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated the bio-table to use require_relative #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

updated the bio-table to use require_relative #24

wants to merge 2 commits into from

Conversation

vpereira
Copy link

@vpereira vpereira commented Mar 1, 2013

to make it easier to load from irb if you are developing the lib and it isn't in your path.

now you can:

cd bioruby-table
irb

require './lib/bio-table'
=> true
include BioTable
=> true

@pjotrp
Copy link
Owner

pjotrp commented Mar 1, 2013

Please pass in multiple patches. So I can accept/reject them one at a time.

Leave it like it is for now - I'll look into the components.

@vpereira
Copy link
Author

vpereira commented Mar 1, 2013

hm. I don't know, but github merge everything in one commit and i cannot open another one while this one isn't accepted/denied. Maybe the best approach would be fork, create a repository and do a pull request for this repository.

btw without the require_relative, for development (without install the gem), how do you require it? messing with the load path as:

rootpath = File.dirname(File.dirname(__FILE__))
$: << File.join(rootpath,'lib')

@pjotrp
Copy link
Owner

pjotrp commented Mar 1, 2013

On Fri, Mar 01, 2013 at 03:01:59AM -0800, vpereira wrote:

hm. I don't know, but github merge everything in one commit and i cannot open
another one while this one isn't accepted/denied. Maybe the best approach would
be fork, create a repository and do a pull request for this repository.

Looks like a github representation of multiple patches, indeed. Still,
should have been 3 commits instead of 2 anyway. I'll deal with these.

No need to fork multiple times.

btw without the require_relative, for development (without install the gem),
how do you require it? messing with the load path as:

rootpath = File.dirname(File.dirname(FILE))
$: << File.join(rootpath,'lib')

Yes, that appears to be the consensus - unless you can find
information that has it otherwise.

@vpereira
Copy link
Author

vpereira commented Mar 1, 2013

well, AFAIK, for ruby >= 1.9, consensus is to use the require_relative.

I didn't search extensively, to find a "real" explanation but here is well pointed: http://stackoverflow.com/questions/2900370/why-does-ruby-1-9-2-remove-from-load-path-and-whats-the-alternative

I sometimes mess with the variable $: sometimes, but I don't see it as best practice. Anyway I won't be sad if you don't merge it. I see it more as matter of taste :-)

@pjotrp
Copy link
Owner

pjotrp commented Mar 1, 2013

On Fri, Mar 01, 2013 at 05:35:27AM -0800, vpereira wrote:

well, AFAIK, for ruby >= 1.9, consensus is to use the require_relative.

There is no such thing as consensus in the Ruby world ;)

I didn't search extensively, to find a "real" explanation but here is well
pointed: http://stackoverflow.com/questions/2900370/
why-does-ruby-1-9-2-remove-from-load-path-and-whats-the-alternative

I sometimes mess with the variable $: sometimes, but I don't see it as best
practice. Anyway I won't be sad if you don't merge it. I see it more as matter
of taste :-)

I'll look into it. Just think we should always pursue the 'right'
thing. Thanks for the suggestion.

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

Successfully merging this pull request may close these issues.

2 participants