Check and update ruby code via another ruby script?

I’m trying to find a way to update a ruby script with another one.
I’m especially not good with networking though.

How to check for an update?
I need a piece of code that can check if an update is available
Example code (may not be correct)
go www.example.com
check update
if update = available
download program
else systemisupdtodate
end

Installing the code
#after update downloads
#add codes
#fix bugs

etc.

Thanks.

It’s okay if my question does not meet the requirements of this forum.
:slight_smile:

Dear “cynic limbu”,

If your code is on a remote git repository (Ex: GitHub, BitBucket), a
“git pull” would be enough for the first part of your requirements.

Most Ruby projects that I know are on GitHub (https://github.com/)
BitBucket provides private repo for free (https://bitbucket.org/)

I didn’t understand the second part of the requirement (bellow).

Installing the code
#after update downloads
#add codes
#fix bugs

Abinoam Jr.

Your package manager which is largely dependent on your system and
administrator’s policy.

I didn’t understand the second part of the requirement (bellow).

Hello Abinoam!
The second part asks how to install the downloaded file

Let’s say there was a bug
if example
else example
#run the code
Error expecting end

Now to patch that bug I’d have to release an update and after the update
is installed into the users computer

example
#previous code
if example
else example
output = error
#updated code
if example
else example
end
output = success

Hi “Cynic Limbu”,

I’m not a native english speaker, so sometimes I get confused by other
people’s emails.
I’m really not understanding what you willing, and I think I’m not
able to help you.
But I’ll give it a try…

There’s several development workflow.
What you are trying to describe for me (I don’t know if I’m
understanding correctly) seems pretty much as somebody making a
“patch” and sending it for other to apply it.

In the Ruby community, as far as I know, the most prevalent tool for
this job is GIT.
People usually have a local git repository.
Push it to a remote one (mainly GitHub afaik).
Other people can pull this remote locally.
You may also push it to the place where it’ll be “deployed” and will
run in production (for example, Heroku).

When you have to fix something, you just edit the file, make a new
commit and push it again to the remote repo.

Sorry if I completely misunderstood your question.

I hope someone else can help you more than I can.

Best regards,
Abinoam Jr.