Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8080859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:32:41+00:00 2026-06-05T16:32:41+00:00

I am currently editing a file, and I’m using irb to test the api:

  • 0

I am currently editing a file, and I’m using irb to test the api:

> require './file.rb'
> o = Object.new
> o.method

I then want to be able to edit the file.rb, and be able to see changes immediately. Example: assume new_method did not exist when I first required file.rb:

> o.new_method

Which will return an error. Is there a sandbox/developer mode or a method whereby I can achieve the above without having to reload the file every time? Require will not work after the first require, regardless. I assume worst case I’d have to use load instead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:32:42+00:00Added an answer on June 5, 2026 at 4:32 pm

    I usually create a simple function like this:

    def reload
        load 'myscript.rb'
        # Load any other necessary files here ...
    end
    

    With that, a simple reload will re-import all of the scripts that I’m working on. It’s not automatic, but it’s the closest thing that I’ve been able to come up with.

    You may be able to override method_missing to call this function automatically when your object is invoked with a method that doesn’t exist. I’ve never tried it myself, though, so I can’t give any specific advice. It also wouldn’t help if you’re calling a method that already exists but has simply been modified.

    In my own laziness, I’ve gone as far as mapping one of the programmable buttons on my mouse to the key sequence “reload<enter>”. When I’m using irb, all it takes is the twitch of a pinky finger to reload everything. Consequently when I’m not using irb, I end up with the string “reload” inserted in documents unintentionally (but that’s a different problem entirely).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently editing a c++ application (only using plain api ),When i compiled
I'm having trouble editing an XML file. I'm currently trying to use Nokogiri ,
I'm new to Rails and currently using Rails 3, so please bear with me.
I am currently editing a C++ file with twp function similar to int func_name_1(int
How do I sync my project explorer tree-view with the file I'm currently editing?
I'm using latexsuite with vim and I am currently editing files that have the
What would be the most practical way to rename the file you're currently editing
I am editing a file like /path/to/file.txt with vim, hence the current directory is
I am currently editing a WordPress plugin, which allows you to filter posts by
Currently, I am editing my production server's crons by typing crontab -e . I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.