From: serialhex Date: 2011-06-06T11:47:07+09:00 Subject: Re: Created a simple module; can't access it --0016e6db295a5ffa2104a5021e97 Content-Type: text/plain; charset=ISO-8859-1 before one can include a module into a program, one must first have said module available... so in this case, you should: ## require 'SimpleMod' include MyMod # to bring all of MyMod's methods into the current object ## hex On Sun, Jun 5, 2011 at 10:25 PM, RichardOnRails < RichardDummyMailbox58407@uscomputergurus.com> wrote: > Hi, > > I posted my simple module and test file at http://www.pastie.org/2025300. > When I run my test under SciTE 1.74 with WinXP-Pro/SP3, I get the > results shown below. In short, I fail trying to include the module > using the name of the module or the name of the file hosting the > module. > > Any correction to my misunderstanding would be most appreciated. > > Thanks in Advance, > Richard > > >ruby TestMyMod.rb > RUBY_VERSION = 1.9.2 > RUBYLIB = K:\_Projects\Ruby\_Ruby__KeyModules > > Attempt to load MyMod > ========== > uninitialized constant Object::MyMod > ========== > > Attempt to load SimpleMod > ========== > uninitialized constant Object::SimpleMod > ========== > > List MyMod container, SimpleMod.rb > Path = K:\_Projects\Ruby\_Ruby__KeyModules\SimpleMod.rb > # SimpleMod.rb > # K:\_Projects\Ruby\_Ruby__KeyModules > > module MyMod > def say_hello > puts "Hello from say_hello in MyMod" > end > end > > >Exit code: 0 > > -- > > Other than the fact Linux has a cool name, could someone explain why I > > should use Linux over BSD? > > No. That's it. The cool name, that is. We worked very hard on > creating a name that would appeal to the majority of people, and it > certainly paid off: thousands of people are using linux just to be able > to say "OS/2? Hah. I've got Linux. What a cool name". 386BSD made the > mistake of putting a lot of numbers and weird abbreviations into the > name, and is scaring away a lot of people just because it sounds too > technical. -- Linus Torvalds' follow-up to a question about Linux --0016e6db295a5ffa2104a5021e97--