/goaloc

Generate On A Lot Of Crack is a repl-based generator, intended to speed up the start of the rails dev process

Primary LanguageJavaScriptMIT LicenseMIT

= goaloc

* http://github.com/mattknox/goaloc/tree

== DESCRIPTION:

This is Generate on a Lot of Crack, which started its life as a more powerful script/generate for rails, and may evolve into a multi-framework webapp scaffolder

== FEATURES/PROBLEMS:

it should:
-be easier to remove, rename, etc., attributes.
-support using a rails app specifier like Jeremy McAnally's rg
-have high-level datatypes, like email, url, ssn, etc..
-support acts-as-tree things
-handle enums, so you can do some of the constraint stuff from PicoLisp
-do haml for views (maybe?)
-make it serve goaloc directly (this is maybe really hard)
-include a javascripty interface, so that one can go up the post-comment-rating chain in one page.
-write backend for datamapper
-write backend for haml
-write a merb target
-write an erlyweb target
-support singular resources
-write the plugin architecture
-extend goals such that they can be told not to make a controller, or view, or model.
-must make it serve apps next
-add cucumber features as high-level specs
-support polymorphic resources (has_many :polymorphs type stuff)
-add syntax for guaranteeing that something is in-session(so that you can specify that the user is logged in, eg.)
-look at cloudkit: http://getcloudkit.com/  it exposes RESTful json apis really easily
-shoulda will now support rspec, so maybe I should generate RSpec/shoulda and Test::Unit/shoulda?
-need to rename/split/join models.
-steal the rails code generator framework, or make my own.  

==DONE:
-include jquery for js
-include bluetrip css framework
-some rdoc

== SYNOPSIS:

Goaloc was motivated by the fact that to make a nested resource (ie, to get  /posts/1/comments to resolve), one must specify the relation between post and comment in 4 places:  the routes, the migration, and in both models.  That's silly, and not so DRY.  Enter GoaLoC, and the "blog in 15 minutes" talk essentially reduces to:

goaloc
>> @app.name = "myblog"
>> route [:posts, :comments]
>> add_attrs :posts => "body:text title:string", :comments => "body:text"
>> generate

generate presently only knows how to make rails apps, and part of merb apps, but in principle, any REST-centric MVC app could be targeted comfortably, and even PHP apps could be done.

route [:causes, { :class => :users, :through => :memberships }, :tasks ]

will set up causes has many users through memberships

Possible rewrite:
People keep joking that I should just be able to say "goaloc blog" and get an app.  Is that actually a bad idea?  I'm not sure.  It seems like it would be a great idea to be able to say, for instance, that at any given point, you should be able to include an entire app rooted at the spot in the routes you currently occupy.  Something like this:

route [:users, blog, photogallery]

could make a blog that is accessible through the user object.  Each goal-generating function could come with a bunch of options, like setting authentication, etc.  

This would allow people to make individual web components, possibly including views.

This almost suggests a need for a gem-like system for "goals" (might need a better name for it and for the project as a whole), and really points up the importance of making this servable on its own-it would be great to be able to toss in a component, look at the resulting app, and then change it.

need to be able to specify that things belong to the current user, and to specify that there must be a current user in scope for some set of routes.

So the blog should be 
route [authenticated_user, [:posts, :comments]]
...




== REQUIREMENTS:

shoulda to run tests, possibly ruby2ruby in the future.

== INSTALL:

sudo gem install -s http://gems.github.com mattknox-goaloc

== LICENSE:

(The MIT License)

Copyright (c) 2008 FIX

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.