deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core] Added :documentation_class setting to help Rabbit generate docs.
Date Fri, 14 Sep 2012 10:32:05 GMT
From: Michal Fojtik <mfojtik@redhat.com>

>From sinatra-rabbit >=1.1.0 we are now generating online
documentation again. The only required change is to provide
'documentation_class' setting in base.rb, so Rabbit will know
what module it should query about collections.

The documentation is then generated on:

/api/docs
/cimi/docs

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/deltacloud-core.gemspec            |    2 +-
 server/lib/cimi/collections/base.rb       |    1 +
 server/lib/deltacloud/collections/base.rb |    2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec
index 9d761e6..4970518 100644
--- a/server/deltacloud-core.gemspec
+++ b/server/deltacloud-core.gemspec
@@ -69,7 +69,7 @@ Gem::Specification.new do |s|
   s.add_dependency('rake', '>= 0.8.7')
   s.add_dependency('haml', '>= 2.2.17')
   s.add_dependency('sinatra', '>= 1.3.0')
-  s.add_dependency('sinatra-rabbit', '>= 1.0.10')
+  s.add_dependency('sinatra-rabbit', '>= 1.0.11')
   s.add_dependency('crack')
   s.add_dependency('rack', '>= 1.0.0')
   s.add_dependency('rack-accept')
diff --git a/server/lib/cimi/collections/base.rb b/server/lib/cimi/collections/base.rb
index 00620fb..ed61d17 100644
--- a/server/lib/cimi/collections/base.rb
+++ b/server/lib/cimi/collections/base.rb
@@ -42,6 +42,7 @@ module CIMI::Collections
     set :root, File.join(File.dirname(__FILE__), '..', '..', '..')
     set :views, root + '/views/cimi'
     set :public_folder, root + '/public'
+    set :documentation_class, CIMI
 
     error do
       report_error
diff --git a/server/lib/deltacloud/collections/base.rb b/server/lib/deltacloud/collections/base.rb
index 1cbeb70..d5182ca 100644
--- a/server/lib/deltacloud/collections/base.rb
+++ b/server/lib/deltacloud/collections/base.rb
@@ -38,6 +38,8 @@ module Deltacloud::Collections
     set :root, File.join(File.dirname(__FILE__), '..', '..', '..')
     set :views, File.join(settings.root, 'views')
     set :public_folder, root + '/public'
+    # A class where the Rabbit will look up for 'collections'
+    set :documentation_class, Deltacloud
 
     error do
       report_error
-- 
1.7.10.2


Mime
View raw message