Forum: Ruby check and update ruby code via another ruby script?

B108916be03f8a27b45bb94ca26648d2?d=identicon&s=25 cynic limbu (cyniclimbu)
on 2014-02-17 22:17
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.
:)
09a32175057418748822c587ac08c429?d=identicon&s=25 Abinoam Jr. (abinoampraxedes_m)
on 2014-02-17 22:46
(Received via mailing list)
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.
9a45896e48a382fe5c656b8873e0dfcb?d=identicon&s=25 Stu (Guest)
on 2014-02-18 00:08
(Received via mailing list)
Your package manager which is largely dependent on your system and
administrator's policy.
B108916be03f8a27b45bb94ca26648d2?d=identicon&s=25 cynic limbu (cyniclimbu)
on 2014-02-18 01:57
> 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
09a32175057418748822c587ac08c429?d=identicon&s=25 Abinoam Jr. (abinoampraxedes_m)
on 2014-02-19 04:01
(Received via mailing list)
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.