cantino/huginn — pull request #499 by dsander (2014-09-14 22:22:53+00:00)
Title: [WIP] Configure agents via HTML forms rather then JSON

Even though this is in pretty early stages I am opening the PR to get some feedback about the general idea and the implementation itself. But first a little demo :smile:
![out](https://cloud.githubusercontent.com/assets/20943/4265639/da45ae52-3c58-11e4-82f7-7edfc8c2205b.gif)

I would like to simplify the configuration of agents as much as possible. Admittedly the hipchat agent is a perfect fit for this (a lot of well defined options), but I think many other agents that do not require a nested or 'dynamic' configuration would benefit as well.

What do you think about presenters in general and the PORO approach used here?
I like that it is plain and simple but the extra initialization line annoys me, I would prefer calling something like `@agent.form_configurable_presenter.option_field_for(attribute)` in the view and define `form_configurable_presenter` in the `FormConfigurable` concern.

An issue I had before is that it seems like you do not get the full class definition of the class that includes the concern in a class method of the concern (see the comment in `form_configurable`). `validate_auth_token` is defined by the HipchatAgent class but the `method_defined?` call always returns false, it is also not included in `public_instance_methods` although `validate_option` is.

/cc @cantino @knu @alias1