crowbar/barclamp-crowbar — pull request #358 by cloudedge (2013-01-25 05:27:06+00:00)
Title: Add Barclamp Type to model (refactoring prep) [1/2]

We're subclassing barclamp as part of the work to pull apart the ServiceObject.

This pull introduces the type to the parent model.

Barclamps will now be able to add a NAMESPACED barclamp subclass with the following
approach.

the file app/models/[barclampname]/barclamp_[barclampname].rb
should contain the [BarclampNameSpace]::Barclamp[BarclampName] < Barclamp class.

For example, for the foo barclamp:
file = app/models/foo/barclamp_foo.rm
class = Foo::BarclampFoo < Barclamp

To prevent having to touch every barclamp, the current code implements a safety mechanism
where barclamps without the subclass will automatically get the BarclampFramework class.

I have added the new barclamp subclass (empty) for the Crowbar & Test barclamps.

This pull also contains some minor doc updates and BDD test cleanup.

BDD/dashboard.erl | 4 +-
BDD/users.erl | 13 +++----
crowbar_framework/app/models/barclamp.rb | 22 ++++++++++-
crowbar_framework/app/models/barclamp_framework.rb | 19 ++++++++++
.../app/models/crowbar/barclamp_crowbar.rb | 19 ++++++++++
.../db/migrate/20120731225405_create_barclamps.rb | 1 +
.../spec/models/service_object_spec.rb | 2 +-
.../test/unit/barclamp_attrib_model_test.rb | 4 +-
crowbar_framework/test/unit/barclamp_model_test.rb | 25 ++++++++++++
doc/devguide/ui/documentation.md | 4 +-
doc/devguide/ui/documentation/formatting.md | 40 ++++++++++++++++++++
11 files changed, 138 insertions(+), 15 deletions(-)

Crowbar-Pull-ID: 487fbfcd462d9d1e7ccdb337764bd0e3a8a23568

Crowbar-Release: development