@myhand said:
@dan rathbun said:
(1) I said inside your module (not your directory!) ...
Sorry Dan, I am being really thick here π. Are you saying I should cut and paste the code in common.rb into MyPlugin.rb file...?
It is what I told Chris to do (in case he didn't wish to have users of his code do a full Ruby install.)
%(#8000FF)[An aside rant to any reader who won't read a book, and learn the basics,
before diving in and attempting to write complex projects:]
If you don't know what I meant by "inside your module" you likely did not follow the advice in my Newbie Guide, and have skipped over learning the nitty-gritty basics of Ruby. Yes it can be boring, but your just running into frustrations because you don't know the simple things.
Really .. print out a chapter a day from the ol' "Pick-Axe" book, and put it next to toilet. Don't waste the time when your sitting on the pot.
In a nutshell... you need to be writing all your code within YOUR unique top-level namespace (which is a module in Ruby.)
Unwrapped code runs within the TOPLEVEL_BINDING, which is the global instance of Object ... and everything is a descendant of Object, so everything inherits whatever is defined in Object.
Other authors do not want your objects, variables etc, propagating into their plugins.
OK ... back on subject, ... "uri/common.rb" ... for now just leave it in the Ruby lib directory, where it belongs, and use a script similar to the one posted to push paths for a full Ruby install.
See: Ruby LOAD PATHs script (Win32)
π