IT Community - Software Programming, Web Development and Technical Support

What is the use of load and require in Ruby?

This is a discussion on What is the use of load and require in Ruby? within the Ruby forums, part of the Web Development category; What is the use of load and require in Ruby?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Ruby

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-16-2007, 03:04 AM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Question What is the use of load and require in Ruby?

What is the use of load and require in Ruby?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-27-2007, 11:37 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Thumbs up Re: What is the use of load and require in Ruby?

The require method is used to run one Ruby program from another. The following sample simulates a short conversation between my first son and myself. Here, I have created a file named "me.rb", which represents me initiating and keeping the conversation going.

# I have to start the conversation
puts '[me] Hey A, how was your day?'
require 'son1.rb'


Use load when you expect a different result. This can be useful when your program is always running and you would like to update some code without having to shut it down. For example, when you are developing a Rails application, you want to run the Rails server then test some functionality, make some updates, test the updates, and repeat the test-update process all without restarting the server each time.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the use of Load Analyser in load runner? sundarraja Testing Tools 1 09-14-2007 08:10 AM
Explain the difference between use and require. vadivelanvaidyanathan Perl 1 07-30-2007 07:39 AM
What is the difference between require_once(), require(), include()? devarajan.v PHP Programming 2 07-30-2007 05:57 AM
require_once(), require(), include() sivakumar PHP Programming 1 07-16-2007 07:39 AM
PHP: include & require, what is different? montyauto PHP Programming 2 06-30-2007 01:17 AM


All times are GMT -7. The time now is 01:45 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0