Wheresmystuff 0.6r
Jul. 1st, 2011 02:40 pmWheresMyStuff version 0.6r is at wheresmystuff.heroku.com.
You can log in, and add and remove loans.
The major feature still missing is any authentication of the login -- anyone can log in as "Jack" or as "jack.dreamwidth.org" simply by typing it in the box and hitting return.
(But it's almost better for testing, as the main feature of creating a loan to "John" and then logging in as "John" and seeing the same loan works and is easier to test when it's easy to log in as different people.)
Don't use the site for real data yet -- there's no authentication, so anyone can edit it, and there's no independent backups, and the next step involves some changes to the database which may end up nuking the data. But if you're curious to see how it works, I'd be very curious to know if it works for you.
There's a lot of features (and design) I really wanted to add, but authentication is the only thing I that's absolutely necessary before it's possible to use it.
You can log in, and add and remove loans.
The major feature still missing is any authentication of the login -- anyone can log in as "Jack" or as "jack.dreamwidth.org" simply by typing it in the box and hitting return.
(But it's almost better for testing, as the main feature of creating a loan to "John" and then logging in as "John" and seeing the same loan works and is easier to test when it's easy to log in as different people.)
Don't use the site for real data yet -- there's no authentication, so anyone can edit it, and there's no independent backups, and the next step involves some changes to the database which may end up nuking the data. But if you're curious to see how it works, I'd be very curious to know if it works for you.
There's a lot of features (and design) I really wanted to add, but authentication is the only thing I that's absolutely necessary before it's possible to use it.
WheresMyStuff 0.5r
Jun. 15th, 2011 11:42 pmhttp://wheresmystuff-0-4.heroku.com/
Yay for heroku. The app seems to run correctly. It's not in a usable state -- there's no login, and the database will probably still be wiped with each update, but I'm pleased to see that rails makes even a basic "add this, delete that" elegant.
Yay for heroku. The app seems to run correctly. It's not in a usable state -- there's no login, and the database will probably still be wiped with each update, but I'm pleased to see that rails makes even a basic "add this, delete that" elegant.
WheresMyStuff 0.4.1r
Jun. 15th, 2011 01:02 amAfter an evening of hacking with ruby on rails, the skeleton version:
* allows you to create and delete loans
* remembers you (there's no login, you can login as any name just by going to the right url)
* is deployed to heroku.com
But doesn't:
* Do any authentication on login, or log out, or anything
* Store loans immutably (the original version didn't delete loan records, but had a "transaction" table which tracked "loan created" and "loan returned" events, and the default view only shows loans which had one but not the other, which I will redo -- the current version just deletes a record)
* Allow you to distinguish between users with the same name
* Allow you to link someone else's version of your name to your account
* Run on Heroku without crashing (none of the interactive pages display correctly yet, although the static home page displays)
* allows you to create and delete loans
* remembers you (there's no login, you can login as any name just by going to the right url)
* is deployed to heroku.com
But doesn't:
* Do any authentication on login, or log out, or anything
* Store loans immutably (the original version didn't delete loan records, but had a "transaction" table which tracked "loan created" and "loan returned" events, and the default view only shows loans which had one but not the other, which I will redo -- the current version just deletes a record)
* Allow you to distinguish between users with the same name
* Allow you to link someone else's version of your name to your account
* Run on Heroku without crashing (none of the interactive pages display correctly yet, although the static home page displays)
WheresMyStuff 0.2r
Jun. 14th, 2011 07:03 pm* It's always nice to read someone saying "Wow, I was glad I wrote those comments all those years ago, that just saved me days of work. Thank you, five years ago me!" rather than "Agh! From NOW ON, I'm going to write enough comments. I swear it!" (http://www.shamusyoung.com/twentysidedtale/?p=11991)
* I've been learning Ruby on Rails in a few spare half-hours here and there. I was initially frustrated from the way things are swept under the rug ("Where the fuck is this function defined? 'Just works' is great until you need to change it"). But it is seeming on balance, that it's easy to do what you want to do as well as easy to do easy things, you just need to not be misled by the former. Lots of things ARE really, really easy :)
* I pondered over version numbers. I decided to reset the version numbers (which were never very official to start with) with a 'r' suffix for "rewrite" or "ruby/rails"
* I'm at about 0.2r, which is "you can see a list of loans based on user, but there's no interactivity". This is quite impressive for (to a first approximation) some config files and zero lines of code :) It's not online yet. I think 0.5r will be "able to change user and add/remove loans"; 0.9r will be "has a login system and basic functionality is usable." and 1.0r will be "0.9r with the bugs fixed" :)
* I dread doing stuff I've done before, like login stuff and site design, it just doesn't seem that interesting, but I think it's still worth it. Version 0.5r will likely have an authentication by a "scout's honour" button.
ETA: Should I stick with "wheresmystuff" or go with Heroku's randomly generated name "gentle-river-xxx"? :)
* I've been learning Ruby on Rails in a few spare half-hours here and there. I was initially frustrated from the way things are swept under the rug ("Where the fuck is this function defined? 'Just works' is great until you need to change it"). But it is seeming on balance, that it's easy to do what you want to do as well as easy to do easy things, you just need to not be misled by the former. Lots of things ARE really, really easy :)
* I pondered over version numbers. I decided to reset the version numbers (which were never very official to start with) with a 'r' suffix for "rewrite" or "ruby/rails"
* I'm at about 0.2r, which is "you can see a list of loans based on user, but there's no interactivity". This is quite impressive for (to a first approximation) some config files and zero lines of code :) It's not online yet. I think 0.5r will be "able to change user and add/remove loans"; 0.9r will be "has a login system and basic functionality is usable." and 1.0r will be "0.9r with the bugs fixed" :)
* I dread doing stuff I've done before, like login stuff and site design, it just doesn't seem that interesting, but I think it's still worth it. Version 0.5r will likely have an authentication by a "scout's honour" button.
ETA: Should I stick with "wheresmystuff" or go with Heroku's randomly generated name "gentle-river-xxx"? :)
Makefile command
Jan. 5th, 2009 09:04 pmSuppose, hypothetically, I have a program "foo" which produces either or both of "apple.out" or "berry.out" from "apple.in" and "berry.in", and I wish to include an instruction in a makefile something like:
Is there any way to do so with a makefile?
I thoguht of two ways. Firstly, using conditionals and text-processing in the makefile to scan the targets requested on the command line, and if both "apple.out" and "berry.out" are requested, replace them with a phony target, something like "both.out", and then have separate rules for each of three possible targets. But does that work if one of the output files is not requested, but is a dependency of something else?
Secondly, using a temporary files to request invocation of "foo", say have a phony dependency of "apple.out" that creates a file "wantapple", and then a little fiddling to invoke "foo" with the names of those temporary "want" files, and then delete them. And an order-only dependency to ensure the temporary files are created before "foo" is invoked (if it is invoked at all).
But neither solution is at all elegant. Is there an approved way of doing so? Or is the approved way to stop being stubborn and use a program rather than make to do the decision making? A quick bit of research online produced no definitive answers, though several people asked about programs which always produced both outputs.
Edit: Yes, I wasted too long wondering about this when I ought to have just ignored it, rebuilt both every time, and got on with things :)
apple.out berry.out : apple.in berry.in foo apple.foo berry.fooHowever, there's significant processing involved in running foo at all, and also in using an additional input file, so we wish to invoke foo once, with only the command line options necessary.
Is there any way to do so with a makefile?
I thoguht of two ways. Firstly, using conditionals and text-processing in the makefile to scan the targets requested on the command line, and if both "apple.out" and "berry.out" are requested, replace them with a phony target, something like "both.out", and then have separate rules for each of three possible targets. But does that work if one of the output files is not requested, but is a dependency of something else?
Secondly, using a temporary files to request invocation of "foo", say have a phony dependency of "apple.out" that creates a file "wantapple", and then a little fiddling to invoke "foo" with the names of those temporary "want" files, and then delete them. And an order-only dependency to ensure the temporary files are created before "foo" is invoked (if it is invoked at all).
But neither solution is at all elegant. Is there an approved way of doing so? Or is the approved way to stop being stubborn and use a program rather than make to do the decision making? A quick bit of research online produced no definitive answers, though several people asked about programs which always produced both outputs.
Edit: Yes, I wasted too long wondering about this when I ought to have just ignored it, rebuilt both every time, and got on with things :)