Feeds : Hobo


      view feed content DRYML Documentation Milestone (Hobo)   12 d and 12 h ago

The DRYML Guide is finally finished. At long last, DRYML is “fully documented”Whatever that means : )You could easily write an entire book on DRYML (well, when I say easily, I mean you could easily find enough material in there!), but at least the whole language is covered now. At 24 pages when printed, it’s fairly comprehensive.http://cookbook.hobocentral.net/manual/dryml-guideEnjoy!Now on to the other chapers of the manual…Mexico Cialis Viagra Trials For Shrinking Cancerous Tumors Buy Cialis Viagra And Altitude Sickness Buy Discount Viagra Buy Cialis Pharmacy Viagra Penis Doctors Giving Viagra Checkup Viagra Xenical Generic Viagra Cialis Levitra Buy Cheap News Release Viagra For Woman Cb Viagra Kit Cialis Search Buy Tadalafil Cialis Viagra Users Group North China Beijing Time Syphilis Cialis Viagra Reverse The Effects Viagra Large Items Viagra Prescription Orders Get Viagra Drug Online Crushing Cialis Tablets Dropshipper Generic Viagra Cialis Britan Online Us Pharmacies Generic Viagra Softtabs Cialis Mexican Cialis Sale Uk Viagra Kamagra Sildenafil Site Viagra Natural Substitute Viagra Cialis Bathtub Cialis Law Suit Buying Discount Viagra Ocular Side Effects Due To Cialis Cheapest Price For Generic Viagra Cialis Faq Koerier Viagra Cialis Amsterdam Cialis Benifets Viagra Purchase In United States Viagra Onlone Buy Online Uk Viagra Generic Cialis And Us Online Pharmacy Buy Viagra On-line Viagra Hotel Hookers Viagra Extended Use Effects Generic Side Viagra Viagra Denver Online Order Viagra Viagra Mixing Effexor With Cialis Cialis Online Any Quantity Hypertension Viagra Liquid Viagra Best Viagra Online Source Viagra Tablets Uk Buy Viagra Uk Viagra And Heart Medicines Der Kleine Nils Viagra Viagra Non-formulary Question Generic Cialis No Prescription Which Is Better Cialis Or Levitra Cialis Cialis Generico Tadalafil Compra Cialis Kamagra Viagra Viagra Comercial Actress Cialis Generic Levitra Viagra Is Viagra Better Viagra Calgary Viagra Eyes Generic Viagra Soft Tabs Cialis Dependence Generic Viagra 100mg Nutural Viagra Viagra Gel Viagra And Calis Luxury Hotel Rome Viagra Sales Online Uk Biggest Viagra Gang Picture Of Viagra Pill Cheap Viagra Without Prescription Viagra For Sale Australia Buy Viagra In Great Britain Cialis Side Effects Back Pain Viagra Commercials Tv Commercials Generic Cialis Pills Cuba Gooding Jr Cialis Commercial Phentermine Adipex Viagra Cialis Fast Delivery Cialis Comparison Levitra Viagra Generic Viagra Year Mercury Drug Viagra Manila Philippines Cialis Online Online Pharmacy Prescription Soma Adult Jokes Mr Bean Viagra Cialis Taladafil Viagra 100mg Tablets Buy Discount Online Viagra Dr Koop Cialis Drug Description Best Viagra Prices Online More Than One Viagra Day Buy Non Prescription Generic Viagra Paypal Viagra Or Cialis Prices Women’s Viagra Tv Pill Splitter Cialis 5 Sildenafil Viagra Will Alcohol Effect Viagra Viagra Bottle Faster Viagra Working Make Your Own Viagra Viagra And Stanozolol Viagra Pill Cutter Fed Ex Cialis Viagra Eye Exam Generic Lowest Price Viagra Avoid Fake Risk Viagra Decrease In Semen Viagra 5 Viagra Tablets Viagra Isnt Working Ebm Diabetes Viagra Viagra Us Drugs Stors Vicodin Viagra Cialis Sales Of Viagra India Pharmacy Cheapest Cialis Directions For Taking Viagra Viagra Online Shop Cialis Pills Generic Viagra Cialis Reaction Dose Order Single Viagra Myocarditis Viagra Liquid Cialis Dosage Kansas City Ultrasound Jobs Viagra Cheapest Generic Cialis Buy Domain Viagra Atspace Org Beyond Viagra Cialis St Viagra In Canada Viagra Substitute Dry Skin 5 Citrate Generic Sildenafil Viagra Free Herbal Viagra Viagra Viagra And Vascular Disease Viagra Patanol Online Drug Stores Metrogel Acupunture Fue Las Viagra Charles Agujas Viagra Retail Discount Luxury Hotel Rome Womens Viagra Which Is Better Levitra Or Viagra Viagra Newsletter Discount Cialis Online Find Viagra Free Sites News Computer Compare Viagra Cialas Levitra No Prescription Viagra Sample Cialis Pill Splitting Herbal Viagra Chinese Viagra Dragon Power Islandspharmacy Cialis Viagra Not Working And Why Cialis Commentscgi Generic Mt Tadalafil Buy Cialis Dreampharmaceuticals From Online Sniff Viagra Viagra Winstonsalem Cialis Generic Tadalafil Compare Cialis To Levitra Cialis Generic Versus Brand Name Cialis Bulletin Board Information Medical Viagra Rxlist Cialis Tadalafil Generic Viagra Discount Generic Viagra Overnight Shipping Generic Lunesta Myonlinemedsbiz Propecia Viagra Cialis Cialis Cialis Genuinerx Net Viagra Cialis Identification Cleaning Viagra Cialis Half Life Cialis Tablets Taking Viagra With Levitra Herbal Viagra Vs Viagra Overnight Viagra Generex Viagra Viagra Levitra Cialis Nose Info On Cialis Uk Viagra Supplier Info Viagra Buy Cialis Cialisnarodru Domain Cialis New Viagra Viagra Erection Time Cheap Viagra Online A Href Tadalafil Or Cialis 2 Comparison Levitra Viagra Viagra Alternative Zenegra Cialis And Hair Transplants Yohimbe And Viagra Do You Need Prescription For Cialis European Meds Viagra Snl Christopher Walken Viagra Pill Cutter 20mg Cialis Buy Viagra Online Without Prescription Viagra Fuerteventura Free Cialis Softtabs Online Is There A Viagra For Woman Canada Buy Real Viagra Online Methadone And Viagra Cialis Sales Cialis Video Cardiologist Viagra Cialis Duration Viagra Hgh Cialis Order Site Q Viagra Pfizer Viagra Online Viagra Bicycle Shirt Paxil Viagra Pfizer Viagra Dosage Gum Viagra Best Place To Buy Viagra Online Cialis Cialis Forum Pharmacy Mark Martin Viagra Photo Viagra And Gout Free Pack Starter Viagra Buying Online Story Viagra Mexico Viagra Viagra Dependence Cialis Online Fedex What Does Viagra Female Viagra Christmas Discounts Buy Generic Online Viagra Cheap Generic Cialis Overnight Delivery Viagra Mg Best Online Pharmacy Does Viagra Enlarge The Penis Purchasing Viagra In Mexico Too Small Dose Cialis Girls Take Viagra Edinburgh Pages Boring Viagra And Neuropathy Cheap Viagra Without A Prescription Sildenafil Citrate Viagra Viagra Mail Interazione Tra Viagra E Eutirox U 19835 Cialis Paroxetine Viagra Alcohol And Viagra Viagra Damage After 4 Hours Viagra For Jet Lag Cialis Helps Size Generic Cialis Online Discount Drug Viagra Heart Attack Viagra Buy Cheap Discount Pill Viagra Viagra District Of Columbia Cialis Meltabs Cialis Testimonials Written Prescription For Viagra Generic Viagra From India Pages Edinburgh Patanol Cialis Nexium Cheap Drug Retin Viagra Wellbutrin Cialis Allergic Pfitzer Home Viagra 2 Free Viagra Misuse Of Viagra Cialis Rate Viagra And Buy Purchase Viagra In Uk Insurance Birth Control Viagra Viagra Free Sample Womens Cream Equiv Of Viagra Pharmicies For Viagra Online Phamacy Viagra Viagra Drug Indian Cialis Viagra Pulmonary Hypertension 2006 Buy Comment Post Viagra Medicare And Viagra Order Uk Viagra Free Viagra Free Funny Farm Cialis Cialis Sale Uk Generic Viagra Wholesale 100mg Viagra Mailer Kj Pe Cialis Online Pill Viagra Viagra Patent Europe Generic Cialis Overnight Delivery Express Delivery Viagra Experiences Find Sites Computer Viagra Edinburgh Search Tadalafil Citrate Cialis Viagra Pussy Find Search Viagra Free Computer Viagra Debate Whhat Is Viagra Viagra In Uk Kamagra Viagra Oral Jelly Viagra Chemist Online Viagra And Vision Changes Web Md Viagra Viagra Cialis London Kamagra Disolving Cialis Cialis Women Effects 10mg Vs 20mg Viagra Experiance Cialis Stories Interactions Of Different Medications With Viagra Wedding Night Viagra Medlar Viagra Cialis Silagra Pharmacy Cialis Cumwithuscom Find Viagra Free Sites Edinburgh Search Cialis Zestril Interactions Cock S On Viagra Viagra Uk Delivery Can Viagra Be Bought In Lanzarote Viagra Schoolboys To Get Stiff Discipline Buy Locally Viagra Cialis 30 Tadalafil 30mg Ml


[General ]
View original post|Add to del.icio.us | Share

      view feed content The Hobo Cookbook is not The Hobo Cookbook (Hobo)   22 d and 14 h ago

…because, it is growing into a general home for Hobo documentation.

You may have noticed we have a nice new look thanks to James. You may also notice an innocuous looking link in the top right — “Taglibs”. Yep - we now have a nice online reference to the tag libraries. Before you get too excited, many of the tags don’t have proper documentation yet. If you look here you’ll see that many of the tags are in a light grey - those ones don’t have a doc-comment in the source code yet. We’re working our way through them.

At the moment tag names don’t come up in the search, but on that same page you can use your browsers search-in-page, because every tag is listed.

The great thing about having a single home for both the recipes and the reference docs is that we can add all sorts of cool cross linking. Every tag in the reference section could link to “Recipes that show this tag in use”, and recipes could have the tags clickable so you can go right to the reference material for that tag.And of course everything is user-commentable.

Later we’re also going to add “Tutorials” and “Hobo Manual” sections. It will be a one-stop-shop for all your Hobo Documentation needs *smile with tooth-bling*.


[General ]
View original post|Add to del.icio.us | Share

      view feed content Announcing the Hobo Cookbook (Hobo)   33 d and 13 h ago

Every now and then I find myself in the situation where I need to create a new app from scratch. It’s then that I get to sample the full Hobo experience. And I have to say — wow. Seriously. WOW.

Top priority right now with Hobo is to churn out as much documentation in as short a time as humanly possible. We felt we needed a home for all these docs - a simple app that supports user-comments, requests for documentation, searching etc. Sounds like a distraction from actually writing the docs? : ) Well… what if it only took a day? How much of an app could you turn out in a single day?

Quite a lot, it turns out.

The experience of creating the Hobo Cookbook was literally a rush for me. It really felt like we’re reaching the point where app-development is fast enough that you can sit down side-by-side with the client and have them guide you towards the app they really want and need. Hobo is coming together. In particular the DRYML generators introduced in 0.8 made everything so much easier.

The really encouraging part was that it never felt like Hobo was penning me in. Whatever small tweak I wanted to make in order to improve the app, I was able to quickly achieve without discarding the rest of the automatically generated stuff.

But enough of this idle banter. Ladies and gentlemen, I give you:

It’s even open source, so it provides documentation in more ways than one!

Now we just need to populate it, so that you folks can all learn how to build apps in a single day : )


[General ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.8.3 released (Hobo)   [2 views] 35 d and 12 h ago

I’ve just released Hobo 0.8.3. Various bug fixes, plus a few nice new features, including much better support for multi-model forms. See the changes for the details.

Please remember that Rubyforge takes a good while to get with the program, so gem update hobo might not work for a while. You can download the gem files from Rubyforge manually though.

Enjoy!


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.8.2 released (Hobo)   [1 views] 66 d ago

I’ve just released Hobo 0.8.2 — mostly a bugfix release. As always it’s tagged in the git repo and the gems are on Rubyforge (so you can just gem update hobo). See the changes for the lowdown.

Enjoy!


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.8.1 released (Hobo)   [4 views] 66 d ago

I’ve just released Hobo 0.8.2 — mostly a bugfix release. As always it’s tagged in the git repo and the gems are on Rubyforge (so you can just gem update hobo). See the changes for the lowdown.

Enjoy!


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content Hobos Required (Hobo)   68 d ago

It’s becoming increasingly common for people to get in touch with me asking for commercial help with their Hobo/Rails projects. It’s a shame then, that these days I pretty much always have to say no. It’s a shame for them, and it’s a shame for Hobo itself, because the more individual Hobo projects succeed, the more Hobo itself succeeds.

Which is a roundabout way of saying that, if there are developers out there would would like commercial work on Hobo projects, I could probably send some their way. I don’t want to be a middle man, and I definitely don’t want to end up getting embroiled into projects that don’t go smoothly, so… You’d need to be able to convince me that you know what you’re doing, know how to handle clients professionally, and are pretty handy with Ruby and Rails, even if you don’t (yet!) consider yourself a Hobo expert.

I even have a little project ready to go - something that James and I started but we’re both too swamped to move it forward.

If you’re interested, drop me a line at tom@tomlocke.com, subject “Hobo Project Work”. Thanks!

Once we get to Hobo 1.0, we’re thinking we might do something more structured along these via the hobocentral website. A job board for example, or perhaps even a Hobo consulting group, but for now we’ll keep it simple.


[General ]
View original post|Add to del.icio.us | Share

      view feed content New docs and tests on the way (Hobo)   69 d ago

Now I seem to remember I promised a series of blog posts on the new features in Hobo 0.8. Well, just to continue in the great tradition of this blog, I think I’ll change my mind :o)

It just struck me that writing long blog posts instead of getting on with actually documenting this stuff properly is a bit silly. So instead, I’ve launched into The DRYML Guide, mark 2. This is going to be the definitive guide to DRYML and it will cover the whole language.

I’ve also started the work of moving to test/unit and shoulda. The plan is to move either the tests or the docs forward every day.

To whet you’re appetites, here’s the outline for the new DRYML Guide:


[General ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.8.1 (Hobo)   72 d ago

I’ve just released Hobo 0.8.1 which contains a bunch of fixes and small enhancements. It’s tagged in the git repo, the gems are on Rubyforge (so you can just gem update hobo), and you can read the changes

Enjoy!


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content New in 0.8 - DRYML Generators (Hobo)   [1 views] 76 d ago

There’s a ton of new stuff in Hobo 0.8, mainly in the area of DRYML and the Rapid tag library. This post is the first in a short series that will give an overview of what’s new, what’s changed and why.

DRYML Generators

This is the big change in 0.8 — we’ve started using generators (gasp!) to create the automatic pages. If you’ve not been following along, you might wonder why the gasp. Well, we’ve always been quite opposed to using generators to automatically create a user-interface for your app. The reason being is that generators are really nothing more than copy-paste code re-use. Which as I’m sure you know is a terribly evil sin : ). The point being that if you’ve got five copies of something, and you want to change it, you’ve got to change it in five places, which is both tedious and error-prone.

Having said that, there’s one thing that generators are really great at, and that’s helping you learn. When you’re new to Rails itself, for example, it’s really useful to be able to look at the restful controller created by the scaffold generator. You learn at a glance how you’re supposed to use the provided API.

When it comes to DRYML, a natural first step when wanting to customise something in the UI, is to look at the source for that tag definition. The problem is that lots of the tags within the Rapid library are very unusual. Unusual in the sense that they’re not like the kind of tags that you would typically define in your own application. That’s because these tags have been written with no knowledge whatsoever of your application, they’re entirely generic. A good example is <show-page>, which does a remarkable job of presenting a reasonable looking page for any model that you throw at it. OK so you want to customise your <show-page>, so you go look at the source. Uh oh. All the logic for handling that generic magic is right there in the tag definition. As a result, we’ve noticed people copy some of these generic tricks into their own apps. This is really not a good idea — your app does not need to be generic, it’s specific to what you are doing.

So we don’t want DRYML generators because we don’t want DRYML to become WETML, but we would really like a generator-like approach to making DRYML, and Rapid, easier to learn. Here’s what we came up with…

The parts of Rapid that were very generic: the pages, cards and forms, are now generated. You can go look at the source code. You’ll find very simple code that’s been tailored to your application and is a good guideline for how you should write your own tags. But there’s a twist. The problem with generators is — what happens when things change. Easy! We just generate again and overwrite the old tags. Huh? What about my edits? That’s the twist - you don’t make any.

The generated taglibs are all written out under the directory app/views/taglibs/auto, and the rule is — you don’t edit anything within that directory. Instead, you use the powerful features that DRYML gives you to customise those tags. You can either extend them, which you’d probably do in application.dryml (using the new <extend> tag), or, you just call them and use DRYML’s parameter mechanism to tweak things to your needs.

This post is just to give you a heads-up of the thinking behind this feature, not to document how it all works, but here’s a quick example. Suppose you have a Story model, which has a title, and Rapid has automatically given you a show-page that uses that title as the main heading. But that’s not exactly what you want — you want the heading to always start with “Story:”.

So you mosey over to app/views/taglibs/auto/rapid/pages.dryml and find the tag definition for this page. It might look like this:

<def tag="show-page" for="Story"> <page merge title="Story"> <body: class="show-page story" param/> <content: param> <header param="content-header"> <a:project param="parent-link">&laquo; <name/></a> <h2 param="heading"><name/></h2> <a action="edit" if="&can_edit?" param="edit-link">Edit Story</a> </header> <section param="content-body"> <view:body/> <field-list fields="status" param/> </section> </content:> </page> </def>

That is much easier to understand than the old fully-generic definition of <show-page>. If you never saw it, take my word for it - it was scary : ). We can clearly see that <show-page> is calling <page>, adding a title, a couple of css classes to the <body> and some main content using the <content:> parameter. The content section itself is also very straightforward — we can see a header and a body, a link back to the owning project, the heading in an <h2> tag, the edit link, and so on.

OK so we want to add that “Story:” prefix to the heading. Well we can clearly see that the <h2> in question is parameterised — the parameter is heading. So, thanks to the magic of DRYML, we can simply create our app/views/stories/show.dryml as follows:

<show-page> <prepend-heading:>Story: </prepend-heading:> </show-page>

Now that’s not quite as obvious as simply hacking on the generated file, but once you get used to DRYML’s parameter mechanism, it’s really very easy. The beauty is what happens when you change your app. Say, for example, you decide you don’t want an edit page for stories, so you remove that action in the controller. The page generators are re-run automatically, and the edit link will disappear from your show-page. You’ve got the best of both worlds: the ease of learning that you get from generators, and the flexibility to change that Hobo has always had.

I’m pretty excited about this change. I think it will take the ease of working with Hobo to a whole new level, and we really haven’t compromised any flexibility. How’s that for change we can believe in ;o).


[General ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.8 Released (Hobo)   [1 views] 77 d ago

I’ve just tagged v0.8 in the git repo, and released the 0.8 gems on rubyforge.

Enjoy!

Expect breaking changes as always (until we get to 1.0 of course), and expect more than normal, because this is a fairly big release.

I’ve created a page on the github wiki to collect advice for upgrading your existing apps. That page will grow over the next few days, but to get you started, here are the main things you definitely need to do.

First, Hobo in general:

Upgrade gem to 1.2 (you don’t have to do this but it’s so much faster)

$ gem update --system

Add the github gem server as a source (so you get will_paginate)

$ gem sources -a http://gems.github.com

Now you can upgrade Hobo

$ gem update hobo Then, for your app:

You need to run some generators again. Be careful not to overwrite your code! The ‘d’ option to see the differences is useful. You might want (with the user model in particular) to just create a new blank Hobo app with the hobo command and compare the files manually. Run these generators:

From there, go check out the page on the wiki

I’ll follow-up shortly (heh) with a post about what’s new in 0.8.


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content Tweeting (Hobo)   [1 views] 3 months ago

I finally succumbed

I’ll pretty much only be using this to let anyone that’s interested know what I’m up to with Hobo at a given time. Don’t expect to see “brushing my teeth” or anything like that : )

This is going to be pretty much write-only, too. I’m not good with distractions. So apologies in advance if I don’t respond to your responses.


[General ]
View original post|Add to del.icio.us | Share

      view feed content Lighthouse lights up (Hobo)   3 months ago

It’s a funny thing that when someone offers to pay you to work on something, they tend to want to know what you’re up to. I did tell Owen over at Barquin that I could get the whole thing wrapped up from a beach in St. Tropez and that I’d be back in three or four months, but I could sense that the idea didn’t go down too well.

So we need a bit more visibility, we need it to be clear where we’re going and what we need to do to get there. Of course we need this anyway, to make it easier for folk to contribute to the project. We need to blow the cobwebs off our trusty Hobo Lighthouse.

Tis done! head over there and see how neat and tidy it all is : ) And if you think you’ll be keeping an eye on the tickets, and maybe even filing your own now and then, be sure to read the home page which explains how we’re organising the tickets.

The idea is that we’ll track pretty much everything as tickets, not just bugs and feature-requests, but bigger to-do items such as testing tasks and documentation that needs to be written. I’m not sure everything like that is in there right now, but most of it is.

In other news, we’re long overdue a release. This one is going to be 0.8 because it’s got some cool new features. I was hoping to get it released this week but that looks a bit doubtful now. I see that I’ve got 28 open tickets so I better get cracking!


[General ]
View original post|Add to del.icio.us | Share

      view feed content Good News (Hobo)   [1 views] 3 months ago

Oops I did it again. Stopped blogging that is. Hands up who thought this blog had died?

Of course those who wanted to know if the Hobo project itself was still active, if they knew where to look, would have headed over here and would have found things to be very much alive. That’s all very well but I really must start blogging more!

OK where were we? About the time of the last post I was just about to head off to Railsconf with some very interesting news. As often happens in life, and even more often with anything related to software development, things didn’t quite pan out the way we expected. I do have news though, oh yes, even better news than I had before in fact.

At Railsconf we announced our plan to form the Hobo Foundation, a non-profit organisation to act as a conduit for companies that want to help Hobo succeed, and a way for developers to put some serious time into the project while still paying the rent. The driving force behind the idea was a company over in Washington D.C., Barquin International, who were to be the initial sponsor. The more we talked to Barquin, the more apparent it became that these guys really wanted to take Hobo seriously. They’re using Hobo in some very critical projects, the first of which rolls-out next month. To cut a long story short, we’ve arrived at a perfect solution which gets Hobo very much on track, and gives Barquin a close link with the on-going development: they’ve contracted me to work on Hobo full-time! The Hobo Foundation lives on in spirit, but for now this is by far the best arrangement for everyone.

That’s right folks, progress is about to take a big leap forwards. You know what this means don’t you? It means all those warm and fuzzy things like a solid test suite, lots of documentation, continuing to separate out all the major sub-components like DRYML into their own projects. Good things are coming!

I want to say a big thank-you to the folk at Barquin for supporting open-source and creating this great opportunity for the Hobo project. Barquin does a lot of work for the US Federal Government, and to be honest, this is the very last place I would have looked for a company willing to stick their neck out for some exciting new technology. It turns out Barquin are not your average government contractor. They’re firm believers in client-centred agile practices, and that approach recently won them (shameless sponsor plug!) the “Small Business Contractor of the Year Award” from the US Department of Agriculture.

Here’s looking forward to really getting stuck in and making Hobo as good as it can be. Maybe I’ll even find time to blog more :-)

(p.s. In fact I’ve got a whole load more to tell everyone about, so do expect more posts over the next few days.)


[General ]
View original post|Add to del.icio.us | Share

      view feed content ActiveRecord behaviour with associations (Hobo)   [5 views] 6 months ago

The interaction between ActiveRecord and the database is very simple when working with a single record - it’s always pretty clear when the database is going to be changed. What about when you’re working with multiple records and associations? I did some experiments way back at the start of the Hobo project, but recently I wanted to check if anything had changed.

So I threw together some simple experiments, and turned on logging in the console. It’s a bit rough and certainly not exhaustive, but I formatted it in markdown out of habit and then though hey, I should post this, so here it is.

Is this stuff documented somewhere? I never found it if it is. I wonder if most Rails devs know about all this already.

This is all in Rail 2.0.2 BTW.

Some simple models class Post < ActiveRecord::Base has_many :comments has_many :categorisations has_many :categories, :through => :categorisations end class Comment < ActiveRecord::Base belongs_to :post end class Category < ActiveRecord::Base has_many :categorisations end class Categorisation < ActiveRecord::Base belongs_to :post belongs_to :category end has_many (not through) Assigning to the array on a new record

New comments are created along with a new post:

>> p = Post.new => #<Post id: nil> >> p.comments = [Comment.new] => [#<Comment id: nil, post_id: nil>] >> p.save Post Create (0.000601) INSERT INTO posts VALUES(NULL) Comment Create (0.000195) INSERT INTO comments ("post_id") VALUES(1) => true Appending to the array

For a post that exists, the appended comments are created immediately:

>> p => #<Post id: 1> >> p.comments << Comment.new Comment Create (0.000481) INSERT INTO comments ("post_id") VALUES(1) => [#<Comment id: 1, post_id: 1>, #<Comment id: 2, post_id: 1>] Assigning to the array on an existing record

Comments no longer in the array have their foreign_key set to NULL. (I’d guess this changes if you declare :dependent => :destroy, but I didn’t try it)

>> p.comments => [#<Comment id: 1, post_id: 1>, #<Comment id: 2, post_id: 1>] >> p.comments = [] Comment Update (0.001335) UPDATE comments SET post_id = NULL WHERE (post_id = 1 AND id IN (1,2)) => []

New comments in the array are created immediately:

>> p.comments = [Comment.new] Comment Create (0.000504) INSERT INTO comments ("post_id") VALUES(1) => [#<Comment id: 3, post_id: 1>]

Existing comments have their foreign key set

>> p2 = Post.create Post Create (0.000820) INSERT INTO posts VALUES(NULL) => #<Post id: 2> >> c = p.comments.first => #<Comment id: 3, post_id: 1> >> p2.comments = [c] Comment Load (0.000292) SELECT * FROM comments WHERE (comments.post_id = 2) Comment Update (0.000684) UPDATE comments SET "post_id" = 2 WHERE "id" = 3 => [#<Comment id: 3, post_id: 2>] belongs_to

When assigning c.post on an existing comment, the change is saved when the comment is saved:

>> c.post == p2 => true >> c.post = p => #<Post id: 1> >> c.save Comment Update (0.000778) UPDATE comments SET "post_id" = 1 WHERE "id" = 3 => true

When assigning a c.post to a new post, the post is created when the comment is saved:

>> c => #<Comment id: 3, post_id: 1> >> c.post = Post.new => #<Post id: nil> >> c.save Post Create (0.000464) INSERT INTO posts VALUES(NULL) Comment Update (0.000148) UPDATE comments SET "post_id" = 3 WHERE "id" = 3 => true

This happens the same way when the comment is new — both are created together:

>> c = Comment.new => #<Comment id: nil, post_id: nil> >> c.post = Post.new => #<Post id: nil> >> c.save Post Create (0.000499) INSERT INTO posts VALUES(NULL) Comment Create (0.000161) INSERT INTO comments ("post_id") VALUES(4) => true has_many :through Assigning to the array has no effect:

Assignment to p.categories where p is an existing post:

>> p => #<Post id: 1> >> cat = Category.create Category Create (0.000427) INSERT INTO categories VALUES(NULL) => #<Category id: 1> >> p.categories = [cat] Category Load (0.000289) SELECT categories.* FROM categories INNER JOIN categorisations ON categories.id = categorisations.category_id WHERE ((categorisations.post_id = 1)) => [#<Category id: 1>] >> p.save => true

Note there were no changes to the categories table.

Assignment to p.categories where p is a new post:

>> p = Post.new => #<Post id: nil> >> p.categories = [cat] => [#<Category id: 1>] >> p.save Post Create (0.000513) INSERT INTO posts VALUES(NULL) => true

Again, nothing happens to the categories table

Appending to the array does have an effect

Can’t append to a has-many-through on a new record:

>> p = Post.new => #<Post id: nil> >> p.categories << cat ActiveRecord::HasManyThroughCantAssociateNewRecords: Cannot associate new records through 'Post#categorisations' on '#'. Both records must have an id in order to create the has_many :through record associating them.

Can append to a has-many-through on an existing record. The joining record is created immediately:

>> p = Post.find(:first) Post Load (0.000365) SELECT * FROM posts LIMIT 1 => #<Post id: 1> >> p.categories Category Load (0.000294) SELECT categories.* FROM categories INNER JOIN categorisations ON categories.id = categorisations.category_id WHERE ((categorisations.post_id = 1)) => [] >> p.categories << cat Categorisation Create (0.000479) INSERT INTO categorisations ("post_id", "category_id") VALUES(1, 1) => [#<Category id: 1>]

But this is not allowed if the category is new:

>> p.categories << Category.new ActiveRecord::HasManyThroughCantAssociateNewRecords: Cannot associate new records through 'Post#categorisations' on '#'. Both records must have an id in order to create the has_many :through record associating them.

Did you learn something?


[Ruby Skills ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.7.5 released (Hobo)   [12 views] 7 months ago

Hobo 0.7.5 is a fairly small release in terms of new features, but does tidy up a few things and fixes some bugs that were causing people trouble. The bigger news is that there’s a whole bunch of new documentation now available.

To upgrade simply

gem update hobo

or grab the files from github or the svn repo and update your plugin directories.

A highlight of some of the changes.

There’s a bunch more little changes — see the changelog for the full low-down.

Then on the tidying up side, there are two major changes. First, we’ve moved to gems for the whole of hobo. Installing the hobo gem should get you hobosupport, hobofields and will_paginate. As a result of this the hobo command no longer tries to fetch anything with subversion.

And we’ve made a change to the structure of the git repo. Because Hobo is really one project, with some sub-components available as spin-offs, it is really much better to have the whole thing in a single repo. So github.com/tablatom/hobo now also contains hobosupport and hobofields in sub-directories. The separate repos on github for HoboSupport and HoboFields will be deleted soon. The one downside is that you can no longer follow “edge Hobo” by using git sub-modules, because git doesn’t support partial exports. We’ll provide some rake tasks to make that easier at some point.

And then there’s the docs.

We’ve got the very beginnings of a complete reference to the Rapid tag libraries. At the moment it’s just generated from the source-code but all we need to do now is start adding in-line documentation comments. The format is probably not ideal either - it doesn’t lend itself to easily searching the whole library. We’ll improve that too in time.

The manual has been extended to include a fairly comprehensive guide to customising Hobo’s RESTful model controller.

James has added some great insights into working with DRYML in the third part of the POD tutorial and with some additions to the DRYML guide.

And finally there’s our first HOW-TO: adding an admin sub-site to a Hobo app. We’ve got a bunch more of these planned which should be very useful.

So! We’re making good on our promise to concentrate less on features and more on making Hobo accessible to others. Mind you, having said that, there’s a cracking new feature in the pipeline…


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content The state of the documentation (Hobo)   [2 views] 7 months ago

While chatting in the hobo IRC channel yesterday, I realised that I should probably do a blog post on the state of the documentation. We’re far from done here. I don’t want anyone to get the false impression that you’re expected to figure out how to use Hobo from the tutorials and guides that we’ve posted already.

If you wanted to use Hobo not so long ago, pretty much your only option was reading the source and asking questions. If you want to use Hobo now, you’ve got some reasonable docs to get you going, but you’ll still need to read some source (especially the DRYML libraries in vendor/plugins/hobo/taglibs). Eventually, you’ll be able to get by on the docs alone and everyone will be happy :-)

There’s all sorts of details that we haven’t documented at all, but there’s two really big gaps: customising your controllers and the Rapid tag library. What I really wanted to talk about in this post is Rapid.

Rapid, in my opinion, is the best part of Hobo. You could say (and in fact I think I did somewhere or other) that everything else in Hobo exists to make Rapid possible. The combination of development speed and flexibility that Rapid brings is something I can’t say I’ve seen anywhere else.

But there’s a catch. You have to know it. And there’s a lot to know: layers and layers of tags calling tags calling tags. If you know your way around it from top to bottom, you’re singing. If you don’t, you’re probably writing way more view code than you need to.

You should get a good sense of this from the Agility tutorial. Towards the end you’re asked to code up bits and pieces of DRYML. These snippets seem to add functionality that far outweighs their size, but you must be thinking “how was I supposed to know that?!”

Some folk seem perfectly happy to read the DRYML taglibs and find their way around that way, but we really, really need docs for this stuff.

This is not meant as an apology, and it’s not going to be a promise to deliver X by Y. It’s just to let you know that those docs are very much on the to do list (and near the top), and please don’t think that you’re expected to just know what to do.

An idea that came out of that IRC chat was to create a tutorial that starts with a full app, in “normal Rails” style, and goes through how to gradually Hoboize it. In the view layer we could explain how to factor out all the HTML into layers of DRYML tags. That would not only show how to use bits and pieces from Rapid, but would also illustrate why Rapid is like it is. It would throw a lot of light on the whole of Hobo in fact. Could be a lot of work though, so don’t hold your breath until it’s ready :-)

p.s. On the subject of docs I just noticed that the HoboSupport docs are messed up — there’s a whole bunch of pages that aren’t linked to. like this one for example. Will fix!


[General ]
View original post|Add to del.icio.us | Share

      view feed content [Ruby Skills] * and where (Hobo)   [3 views] 7 months ago

This is the first post in a new category I’ve added to the blog: “Ruby Skills”. It’s a place for me to share Ruby tricks and tips I’ve picked up along the way. Sometimes, as with this post, I’ll post about the Ruby extensions in HoboSupport. Now that HoboSupport is available as a gem, you can easily use these tricks in any Ruby project.

First up, two new Enumerable methods that HoboSupport adds: * and where. Attentive readers might be thinking — hang on, Array already defined *. Don’t worry, it still works.

* is some syntactic sugar for map. The idea is that we use ‘dot’ to call a method on one object, and we use ‘dot star’ to call a method on a whole collection of objects, returning all the results in a new array.

Say users is an array of user objects, and we want all the names:

users.*.name

Nice eh? You can pass arguments too:

users.*.to_json(:only => [:first_name, :surname])

Note that you can’t do

users.*.name.upcase

That would try to upcase the array. You’d have to do:

users.*.name.*.upcase # Not very efficient though

Of course, as a good functional programmer, I wouldn’t dream of giving map some love while neglecting filter (better known in Ruby-land as find_all or select). So you can also do:

users.where.active? # same as users.find_all {|u| u.active? }

There’s also where_not

Given that the result is just an array, we can chain them. Want the names of all the inactive users?

users.where_not.active?.*.name

Very handy in the console.


[Ruby Skills ]
View original post|Add to del.icio.us | Share

      view feed content Welcome to the new hobocentral.net (Hobo)   [3 views] 7 months ago

And finally… Here it is. The site has been restructured with a new front page that does a much better job of communicating what we’re all about. And there’s much more besides…

Hobo 0.7.4 is out. Please see the changes. Note that rubyforge seems to be having a very bad day. Downloading the gem files directy from http://rubyforge.org/projects/hobo seems like a good option. You’ll need both hobo and hobosupport.

There are two, count them, two tutorials on the docs page, as well as guides to the basics of DRYML and the Hobo generators.

The big breakup has begun. The HoboSupport gem, and HoboFields plugin (with the migration-generator) are now available without the rest Hobo. Let the whole world be freed from the drudgery of writing migrations! As you’ll see, HoboSupport and HoboFields are tested and well documented. We’ve achieved both in one go using Python-style DocTests. More on those in a later post.

The source code now lives on GitHub at http://github.com/tablatom. This is a really fantastic step forward giving us:

And of course, if you do the GitHub thing, you’ve got to do the Lighthouse thing too. Lighthouse is now the new Hobo issue tracker.

BUT. More importantly than all that. This all marks the start of a new chapter in the life of Hobo. The documentation that’s available now is just the start. We’re now moving on to extracting DRYML as a separate plugin, which also means doctests for every last DRYML feature. Then it’ll be on to docs for the Rapid tag library.

The one thing that’s missing right now is screencasts. The old ones are still online but they’re so out of date that we’re not linking to them any more. A new series of screencasts based around the Agility tutorial will be created soon.

We will continue to add new features and functionality, and we will sill make breaking changes right up until 1.0, but the focus now is on stability, tests and documentation. Oh, and building a community of contributors. That means you!


[General ]
View original post|Add to del.icio.us | Share

      view feed content Nearly there… (Hobo)   [3 views] 7 months ago

So here I am at the Ruby Fools conference in Copenhagen, and I did say we were going to try and have some new stuff ready by now. We’re nearly there. Stay tuned over the next few days.

First off though, I better deflate your expectations a bit. I don’t know if this was my fault for wording the last blog post badly, but a few people seem to have gained some pretty wild expectations about what’s coming. Terms like “fully documented” and even (gasp) “version 1.0″ have been bouncing around. Sorry folks, there’s good stuff coming but I never meant to give you that idea. Apologies for any confusion.

What is coming is this — we are turning the corner and focussing our energy on making Hobo into something everyone can use. That means breaking it up into parts, and writing more documentation and tests. The process has begun, and the first installment is on the way. Here’s what we’re about to put out. (If you know where to look you’ll know that some of these things are in fact available already. We’re just holding off from the ‘official’ release so we can promote the new stuff properly in a few places).

So it’s not 1.0 and it’s not fully documented but I hope it’s enough to demonstrate that we’re serious about moving Hobo in the right direction now. And like I said, it’s nearly ready. Watch this space.


[General ]
View original post|Add to del.icio.us | Share

      view feed content Hobo at RailsConf 2008 (Hobo)   [4 views] 9 months ago

Seems it’s conference season :-)

We are very excited to be presenting a three hour hands-on Hobo tutorial at RailsConf in Portland, Oregon!


[General ]
View original post|Add to del.icio.us | Share

      view feed content The Fools! (Hobo)   [2 views] 9 months ago

The kind fools at the Ruby Fools Conference have invited me to give a presentation on Hobo in Copenhagen on April 2nd. This will be the third time I’ve stood up to talk about Hobo and both times it’s been really difficult to cover such a big topic in a short time. So I made a suggestion — how about a railsconf style three hour tutorial? To which they replied with an enthusiastic “yes!”.

Three hours should be enough time to build a complete Facebook clone and still have time for a relaxed chat about Danish history. Well, um, it should be enough time to build a decent demo app and get some experience with all of the main features of Hobo. Excellent! The tutorial is scheduled for March 31st, which I believe is the day before the presentations start. The tutorial is in addition to the one hour presentation which is on the 2nd.

Would be great to meet some more of you Hobo people face-to-face.

If you’re coming, say so in the comments :-)

Should be fun!

p.s. As I’m writing this the details they have for me on the conference website are kinda broken, and my face is that of a white fuzzy blob. Should all be fixed up shortly :-)


[General ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.7.2 released (Hobo)   [3 views] 10 months ago

This release is mainly about fixes - problems recently reported in the forums with the migration generator and validation error pages have been fixed. Of course we sneaked in a bunch of new features too, and James has been busy making the Clean theme even nicer.

CHANGELOG
[Releases ]
View original post|Add to del.icio.us | Share

      view feed content Triple Christmas Present (Hobo)   [2 views] 11 months ago

There is a lot to tell you about. I could blog on and on. In fact I intended to. But you know what, I’m supposed to be on holiday! So, I’ll cut straight to the chase and get off this computer :-)

For your hobo-ing pleasure there are three new goodies today, and I’m finally making good on my “Docs Month” promise (December is docs month!). The more I put time into documenting Hobo the more I realise what a huge task it is to produce in-depth documentation. But the beginnings are in place.

Please see the docs page for:

Both, of course, are at an early stage.

And, just in case two christmas presents are not enough, Hobo 0.7.1 is out. Hobo 0.7.1 features the new Clean theme as the default along with hugely improved default pages and much more besides. The out-of-the-box Hobo app with no work at all in the view layer is starting to look really good.

So go gem update hobo or svn up your plugin directory, and don’t forget to read the changelog

Happy Christmas! See you next year.


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content Hobo 0.7 released (Hobo)   [3 views] 11 months ago

Hobo 0.7 is now available, both as a gem on rubyforge, and in via the repo trunk.

Template tags and non-template tags are now unified. This is really a huge improvement to DRYML. We’ve also switched to dashes instead of underscores for tag and attribute names.

Got any existing DRYML code? It doesn’t work any more. At all :-)

Fortunately, happiness is only a rake task away:

rake hobo:fixdryml

From the changelog:

A rake task hobo:fixdryml has been added which does a pretty good job of converting Hobo 0.6 DRYML source-code to the new style. It will change every file in app/views/**/*.dryml, and keeps a backup copy of app/views in appviewsbefore_fixdryml. If you pass it CSS=y and ID=y it will ‘dasherize’ css classes and IDs too, which is the new Hobo convention. You can also pass DIR=… if you want to point it somewhere other than app/views. It won’t fix anything in erb scriptlets, e.g. use of the tagbody local variable. Expect to do some manual fixes after running the task (good job you’ve got that thorough test suite eh?)

We’ve switched to Rails 2.0 RC2 for our testing. Be warned - there’s a breaking change in Rails that might absorb some of your time as it did mine. It’s a change to fixtures - the default if you don’t give a value for a created_at or updated_at field, is now Time.now. It used to be nil like any other field.

There’s now only one significant feature that I want to add — fixing themes and CSS — before the push to 1.0 begins.

But before that, next up is beta.hobocentral.net!


[Releases ]
View original post|Add to del.icio.us | Share

      view feed content December is docs month! (Hobo)   [5 views] 11 months ago

You believe me, don’t you?

OK, OK — I missed my self imposed deadline. November came and went and you folk are still left perusing the source-code. I checked the “November is docs month” post and I did say “no guarantees” :-) Such is life. I have no idea how November managed to get so busy but it did.

On the whole though, I’d have to say that things are looking pretty darn good for this little project.

Hobo 0.7 is essentially ready — I’ve even written the changelog. This release features the long dreamt of (by me and James at least) unification of template tags and, er, the other kind of tag, you know, the normal ones. There is no um-ing and er-ing any more because now there’s just tags. They’re template-like if that’s what you want, and not if you don’t. It’s really rather nice, and makes DRYML feel pretty much done, baring all the little clean-up jobs and performance enhancements between here and 1.0. That’s a big deal.

I’m fairly confident in saying that beta.hobocentral.net, a.k.a. annotated Hobo-app goodness, is going to be out before you know it. I’ll be starting on it first-thing Monday.

And finally, our financial stability seems to have had a bit of a boost with a new client on the scene who are interested in using Hobo for a chunky-sized web-app. I might be able to share more about them at some point.


[General ]
View original post|Add to del.icio.us | Share

      view feed content Update - Even newer DRYML (Hobo)   [4 views] 11 months ago

The big feature back in Hobo 0.6 was “new DRYML” — A substantial improvement to the mark-up language that introduced the idea of “templates” - tags that can be given multiple, named blocks of content instead of just a single “tagbody”.

As I’ve mentioned a couple of times, we’re now working on another improvement to DRYML that unifies template tags and “normal” tags, and we’re switching to <tags-with-dashes> while we’re at it.

I’ve got all the DRYML tests passing now, and I’ve written a Rake task that does a pretty good job of automatically updating all your existing DRYML source to the new style. I’ve now got to put this new stuff through the wringer by making sure the test suites of our existing Hobo apps are all still fully green. Then Hobo 0.7 will be released!

I’ll then have my decks clear to move on to beta.hobocentral.net and you’ll finally have some documentation so you can find out what on earth I’m talking about :-). Obviously I’ve not managed to put the time into documentation that I’d hoped to in November, but I’d still like to make good on my promise by getting something out. Looks like the deadline is tomorrow :-). Wish me luck!


[General ]
View original post|Add to del.icio.us | Share

      view feed content Next directions - update (Hobo)   [3 views] 12 months ago

A few days ago we announced our intention to break Hobo up into various self-contained sub-projects. I just though I’d give you an update on our plans.

The first plan was to get started with the big break-up ASAP. That would obviously push back the documentation I’ve been promising to do. The idea was to provide a reasonable level of documentation for each sub-project as it was released.

Slight change of plan :-)

I’m not in the #hobo channel all that often, but James is, just 2 meters to my left. So I’m well aware that there are a bunch of you that are determined to keep making progress with Hobo with docs or without.

With that in mind, I’ve come around to the idea that getting at least some docs out there for you folk is really the top priority. I think the best way to address this issue quickly is with some example code.

With that goal in mind, we’re announcing a new project today — beta.hobocentral.net (don’t go there now, there’s nothing there yet!).

We’re going to build a new version of hobocentral.net in Rails + Hobo. It will have the current features: blog, forums, documentation (cough) etc. In time we’ll add a whole host of new features like the long-promised tag library, user-extensible documentation and more. This is going to be an open-source project, and it’s going to serve a dual purpose. As well as getting us a better hobocentral.net, the code will be extensively commented and the whole thing will server as a decent real-world example of how to build a Hobo app. The documentation will be implemented by the documentation. It’s all a bit meta-circular, which you gotta love :-)

The point of the beta.hobocentral.net domain is that we can whack this app up really soon, and continue using the existing Wordpress based site until the new one cuts the mustard.

There is one small hold-up I’m afraid (groan). We’ve got this little outstanding DRYML issue with CamelCaseTags. From James’ experience trying to explain template tags on #hobo, it’s clear that this needs to be cleaned up right now. So I’m going to work on that first (right now in fact), and then start on beta.hobocentral.net

You should see the first cut of beta.hobocentral.net go up next week, delivering on my promise to provide some documentation in November!


[General ]
View original post|Add to del.icio.us | Share

      view feed content Time to break it down (Hobo)   [7 views] more than one year ago

Over in the forums, finnhiggins is letting us know that keeping up with the all the changes to Hobo is a lot of work.

Hobo has some fantastic ideas that the rest of the Rails community could learn from, but keeping them all tied into a single package that is a very difficult dependency to track is making them pretty inaccessible to developers for the moment. Some more decoupling during development would be killer, IMHO.

“Can we have this in its own plugin?” is a very often heard request from the folk following Hobo. One that we’ve been saying no to.

Why?

The reason we’ve given is that there are a lot of interdependencies between the different parts of Hobo. Keeping all these parts separate will add an overhead to the development effort — possibly a significant overhead when you take into account all the extra management associated with having multiple sub-projects. And for what? There would be benefits for those who don’t want to use all of Hobo, but not so much for those who do. If you put it like that it doesn’t sound too tempting.

I’m going to say it plainly — we got it wrong.

James and I have just been chatting this over and come to the conclusion that the benefits of a collection of de-coupled Hobo “modules” far outweigh the costs:

Yep - we’re doing this!

The truth is that the Hobo code-base is already fairly well structured, so there’s really not as much work involved as one might fear.

We’ve had a bit of a scribble on the white-board and the initial stab at a logical breakdown looks like this:

So that’s looking like a set of 9 plugins/gems. The idea is that any of these plugins can be used with or without any of the others, subject to some dependencies of course (Rapid probably won’t work too well without DRYML!)

We’ve pretty much convinced ourselves that this is the way forward now for Hobo. It’s going to have an impact on the documentation schedule, because it makes no sense at all to write docs before breaking things down. On the other hand, documenting Hobo in small chunks will make the job much easier and should mean you’ll get well documented parts of Hobo even sooner.

I’m planning to launch into this work pretty much immediately. Big change coming!


[General ]
View original post|Add to del.icio.us | Share

      view feed content Bugfix: Hobo 0.6.4 (Hobo)   [1 views] more than one year ago

As warned of in the previous post, we had some Prototype/Scriptaculous related problems in 0.6.3. Now fixed in Hobo 0.6.4.

Same deal as usual:


[General ]
View original post|Add to del.icio.us | Share