Crazy Idea

Okay, so I have a laptop now, but I've been doing most of my RoR
development on my home computer system. Both are Windows XP. Now, I
have this crazy idea about using both to develop the same program
(*gasp*). Although I've been doing programming for a few years, I have
NO idea how to do this. I'm using Aptana RadRails right now... is
there perhaps something built-in that I can use? I understand that
what I'm trying to do is called CVS maybe? Any help? :slight_smile: Thanks!!

-Ryan

Read up on source control. You have a few options, but avoid CVS if you can. :slight_smile:

Subversion is the easiest one to setup and get going.
http://subversion.tigris.org/

A lot of cheap web hosts (e.g., Dreamhost) offer Subversion support
with their web packages. So basically you'd sync the source to your
web account then pull it down on the other computer, push your changes
back to the server, pull them down on the other computer, rinse
repeat. :slight_smile:

Wikipedia probably has a good article on it and there's a book about
Subversion on their website that's free.

--Jeremy

not sure what you'll find built in, but have a look at subversion.
It's more or less the standard in the rails community, and I
understand TortoiseSVN is a very good windows client (though I've
never tried it out, since I'm on another platform).

- Martin

Have a look at git. Google for it.

  For Rails, you could also use Capistrano.

  Best regards,

  Davi Vidal

Yup, as everyone else pretty much said: SVN or Git. Pretty much the
standard and not so crazy an idea after all :slight_smile:

TortoiseSVN is the way to go with Windows

Right... subversion, I've read about it.

But is there a solution that's... umm... simple? For example, I don't
care much about being able to revert to previous versions and things
like that. I just want to change it on one system and be able to get
the changes on the new system. Something like when I'm done at home I
can click "Update Server" or use a command line prompt like "update
server /rails/program/path/" and have the files uploaded. Then on my
laptop I want to click or type "Update Computer" to download all the
files and update the ones that have been edited.

Has anyone done something this simple for me yet? I don't want those
extra features if I'm not going to be using them (k.i.s.s. standard).

:slight_smile:

-Ryan

Once you've got svn installed on WinXP, and once you've got Tortoise
SVN installed on WinXP, and once you figure out the url for the svn
repository on your server, you then can do what you said.

You might prefer to skip the windows gui (Tortoise) and write a
command line call svn in a .cmd file. You can then set up an icon to
run the command .cmd scripts, one to get and one to upload. And then
just click on them as needed. But this sounds like more trouble than
using the GUI for Tortoise.

Just remember that the 'update' icon in Tortoise means download, and
'commit' icon means upload to the server.

The other gotcha is that you first set up a directory with your stuff,
and then put it into the repository. Then you check it out, but to a
different directory. Then that second directory is your working
directory and the first directory is an orphan, never to be touched
again. Why they do this, I don't know.

A completely different approach would use WinSCP and/or ftp to upload
and download to the directory structure on your server.

f

But is there a solution that's... umm... simple? For example, I don't
care much about being able to revert to previous versions and things
like that. I just want to change it on one system and be able to get
the changes on the new system. Something like when I'm done at home I
can click "Update Server" or use a command line prompt like "update
server /rails/program/path/" and have the files uploaded. Then on my
laptop I want to click or type "Update Computer" to download all the
files and update the ones that have been edited.

Ryan - this is all I use subversion for! It seems really hard at
first, but once you have set up your repositroy (preferably online,
with your web hosts) all you do is checkout a version to each
computer. After doing some updates you 'commit' these back to the
central online subversion repository. A simple 'update' command will
then update all the other copies to take account of the changes. I
don't use any of the stuff about rolling back and branches, but figure
that I might use it in the future.

DAZ

Once you used source control you'll never want to go back. Have you never been in situations along the lines off 'Damn, this was working fine yesterday, what have I changed?', or scrummaged through backups to find the code from 6 months ago which has something you need (or because someone running an older version has found a problem etc..) ?

At a basically level with subversion you can just do svn commmit to push changes to the repository and svn update to pull them down.
There are a number of places which will host your repository (normally for a fee, but it's not an awful lot) which means you don't have to setup the server yourself it's accessible from anywhere in the world and (most importantly as far as I'm concerned) your data is safe in a datacenter, on properly backed up hardware where you don't have to worry about a toddler feeding its porridge through the vents on the computer hosting your repository.

Fred

Hi guys

I use NetBeans for Ruby as my IDE and it integrates really well with
SVN - have Tortoise installed but really only use it when I have to go
out into PHP land.

NetBeans has a very cool feature once it knows about your repository -
you can turn on the diff sidebar and it shows you in the margins where
you have made changes, when you mouse over the marks it tells you want
the changes were and allows you to undo just that change, rather than
the whole file.

If you're using one of the Eclipse based IDE's it's probably got very
similar functionality.

HTH

I would definetely use SVN with Tortoise.

But if you just want the files synchronized between desktop and
laptop, you can always use some sync utility, like GoodSync...

Cheers, Sazima

Right... subversion, I've read about it.

But is there a solution that's... umm... simple?

Don't let the Subversion book discourage you. In a normal day you
would only use a few of those commands and the online book is always
there to help you when you need one of the more exotic commands.
Knowing every single Subversion command or command line option is not
required to use Subversion.

For example, I don't
care much about being able to revert to previous versions and things
like that. I just want to change it on one system and be able to get
the changes on the new system. Something like when I'm done at home I
can click "Update Server" or use a command line prompt like "update
server /rails/program/path/" and have the files uploaded. Then on my
laptop I want to click or type "Update Computer" to download all the
files and update the ones that have been edited.

Has anyone done something this simple for me yet? I don't want those
extra features if I'm not going to be using them (k.i.s.s. standard).

There are indeed features in Subverion and Capastrano that you will
not need, but that's true with most anything. Dismissing the
applications themselves simply because of those extra features is very
poor logic in my opinion.

Learning Subversion is not a waste of time. I almost want ask who
_isn't_ using it by now? And running `cap deploy` to redeploy any one
of my Rails apps, instantly, on a whim, seems about as simple as it
gets.

Right, but I also don't have a host that supports Subversion easily
(although I've heard of some free places).

Also, as for just synchronizing the folders, I should note that the
two computers are never on the same network. They use two differnt
ISPs, always. Pretend my laptop is in florida while my home computer
is in california. (or Sydney and New York, lol).

I've heard of WinSCP... might that work just to keep the folders
synchronized? I think the subversion idea is almost giving me a
headache... it took me weeks just to get GoDaddy and RoR to work, lol.
I don't want to have to learn something new so soon after that
headache.

-Ryan

Another possibility, though not as good as source control, is a simple ftp server. Run it on your desktop then get or put as the case may be.

One question, though:

Do you ever expect to have changes on one that you don't have on the other? If you will need to do any type of merging, you really need to figure out a way to use source control. I'd recommend git or mercurial. They are both distributed source control managers and you can push/pull from your notebook to your desktop. Merging is easy. It's all pretty fast. And it's not that hard to learn.

Google for them.

Peace,
Phillip

Right, but I also don't have a host that supports Subversion easily
(although I've heard of some free places).

Apropos of which, this was just recommended to me:

  <http://www.beanstalkapp.com/>

The price is right (free for <4 users), so it may be worth a look.

Also, as for just synchronizing the folders, I should note that the
two computers are never on the same network.

Irrelevant. I agree with the recommendation to just go ahead and
learn subversion, but if you really can't deal with it, there's always
carrying around a USB drive with your project :slight_smile:

FWIW,

Well, that's just the thing... I'm never going to be using both for
anything different. I have one application, chronorails, which will
one day control all my websites (mwahahahah so much to do, so little
time). But for now, I don't even have my own server, just really
inexpensive shared hosting.

I'll never edit on one location without wanting the changes in the
other place, so no merging required ever. Basically, I'm going to sit
at home and code my program. Then, I'm going to get thirsty and tired,
so I'll save it, then take my laptop to Starbucks and continue my work
there. Nothing fancy at all...

Granted one day I'll want to learn subversion for all the features and
because jobs will want it... but I don't want to start anything new so
soon, lol.

-Ryan

I don't think I phrased my question properly. If there's a chance that the code will ever get out of sync, you'll want merge. Think of a scenario in which you do some coding on your home computer, then get thirsty (as you say) and move it all over to your notebook. After a couple of hours at Starbucks, you come home, but for one reason or another, you forget to put the code back on your home computer. A while later, you sit down and make some changes at your home computer. Now you're out of sync. If you upload your notebook's copy to your home computer, you'll lose what you just did. You now need to make the same changes on your notebook before you can upload the source again. Or, if you use mercurial or git, you could so something as easy as

pull
merge
commit
push

and be done with it.

Peace,
Phillip

Still sounds painful. Although I've heard of a good free svn host...
maybe I'll try it. *sigh*. I just hope this goes better than my other
new things...

Everytime I try to get something new working, I run into a years worth
of problems.

-Ryan

google code is a good free svn host!