hi, i'm new to ruby and to learn it i try to solve problems from project euler
i wrote some 'extension' for integer and fibbonaci generator. for now i used require_local to include other files but it doesn't look well and i will create some other files.
What are the options to write some kind of local libraries and write one require?
local code organisation
Page 1 of 11 Replies - 857 Views - Last Post: 12 November 2011 - 12:23 PM
Topic Sponsor:
Replies To: local code organisation
#2
Re: local code organisation
Posted 12 November 2011 - 12:23 PM
You can use the keywords require and require_relative to require external files. Though, if you're looking at a way of including a whole collection of code files (like a code library) then one way of accomplishing this is to create what's called a Ruby gem. A gem is essentially packaged Ruby code that you can require into your application and utilize its classes and methods. One place to start is the RubyGems documentation.
What is a Gem?
Creating Your Own Gem
Gem Sawyer, Modern Day Ruby Warrior
What is a Gem?
Creating Your Own Gem
Gem Sawyer, Modern Day Ruby Warrior
This post has been edited by Skaggles: 12 November 2011 - 12:27 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|