HotCocoa / hotcocoa

MacRuby HotCocoa UI library
120 stars 8 forks source link

Refactor Application::Builder API #18

Closed isaac closed 13 years ago

isaac commented 13 years ago

This is another variation on my last pull request that cleans up the generated rake file by changing the Application::Builder API.

ferrous26 commented 13 years ago

I prefer this set of changes, I'd rather not introduce a new class but adding Builder#run seems out of place...hmm

isaac commented 13 years ago

Yeah I know, it seems a bit weird. What about a Commands class that handled running all these commands?

Commands could also handle the most of the logic that currently lives in /bin/hotcocoa. I was also thinking today that maybe we don't need to use rake tasks for these operations at all - Commands could run everything through a CLI like rubygems.

I was also wondering whether we need to name the appspec file after the app itself. Maybe we could go with convention over configuration and make it more like a Gemfile or Rakefile.

ferrous26 commented 13 years ago

I have been thinking about a command structure for bin/hotcocoa, as it means there can be less logic in that file specifically and hopefully that makes it easier to test (and extend). At the same time, there are a couple of other things in HotCocoa that I want to clean up soon and then get gem ownership, so I won't be focusing on that in the next little while.

I am not too sure about ditching rake, perhaps it would be better to go back to hiding a lot of the logic and just requiring it in an almost empty Rakefile.

I'm also not sure that a file named Appfile, or whatever sounds better than that, would be a better convention than a file with the same name as the app. That is, I think that "APPNAME.appspec" is a convention, and it is setup for you in that opinionated sort of way and should be obvious enough. Something like Appfile would be more canonical, but I think it also makes me feel like it is something different enough from a rakefile to be its own thing. Perhaps a better canonical name for the appspec could be Rakefile :P, and we could put the spec back in there.

isaac commented 13 years ago

I've opened a new issue for the bin/hotcocoa changes and closed the other variant of this pull request.

I'll leave it up to you to decide whether or not to merge these changes - I'm not entirely sure what is useful here and what is just me having OCD :)

ferrous26 commented 13 years ago

This is good for the time being. Thanks for working on it.