kadewe (2) [Avatar] Offline
#1
OK, I admit, I was puzzled first because *.bat is a very windowish style to name a shell script.
Still, I don't get why it is necessary to run newdb.bat every iteration. Why not create the database once and from then on, just use migrations? Why do you introduce this *.bat-stuff?

Anyway - I love the book, great work in one of the most important directions of ruby/rails right now. And congratulations, that you are publishing with Manning Pubs - I think, that "Ruby for Rails" from Manning is the best book on Ruby AND Rails out there!

cheers,
karsten
ps: … and puzzled, see above smilie
peterarmstrong (94) [Avatar] Offline
#2
Re: Still puzzled about the need for newdb.bat
Hi Karsten,

In the Mac section of iteration 2 (section 2.4.3, page 46) I create a newdb.sh script for Mac users:

#!/bin/sh
mysql -h localhost -u root -p <db/create.sql >
rake db:migrate

On page 29 I added a "tip" for OS X users about how to create the equivalent shell script to newdb.bat. I suppose I could have listed the newdb.sh script as well, or else pointed to the newdb.sh script.

So you understand what I was trying to do: I was trying to save a few trees in iteration 2 by factoring out the common explanation in section 2.1 and then having you read one of section 2.2, 2.3 or 2.4. I figured the OS X and Windows instructions were similar enough when using Flex Builder that I could write only one section for using Flex Builder 3 (2.2), instead of doing a Windows + Flex Builder and a Mac + Flex Builder section.

Regarding why use the scripts instead of just migrations, you're right that it's not necessary. I could just run the migrations. However, since this tutorial is so long and since some people will skip or skim chapters, I wanted there to be the equivalent of "savepoints" in a video game. So, running the newdb script accomplishes this. This way you can dive right in following along with ch. 7, for example, by taking ch06 and running newdb.bat or newdb.sh.

Thanks,
Peter
kadewe (2) [Avatar] Offline
#3
Re: Still puzzled about the need for newdb.bat
Hi Peter,
oh, right, I've overlooked the newdb.sh script because I was only reading the Flex Builder section.

Now that you've explained the newdb.sh script as a kind of savepoint, I understand smilie
And good that it is all doable with migrations, I started to wonder if I had missed some point of the script.

Thanks,
karsten