You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Francesco Vollero <ra...@gmail.com> on 2010/12/10 17:29:41 UTC

[PATCH core] Beautified the code adding dashes to END tags, removing unuseful escaping chars

---
  server/lib/sinatra/rabbit.rb |    2 +-
  server/server.rb             |   31 ++++++++++++++++---------------
  2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/server/lib/sinatra/rabbit.rb b/server/lib/sinatra/rabbit.rb
index 05bd6c5..802d623 100644
--- a/server/lib/sinatra/rabbit.rb
+++ b/server/lib/sinatra/rabbit.rb
@@ -72,7 +72,7 @@ module Sinatra
        end
         def path(args = {})
-        l_prefix = args[:prefix] ? args[:prefix] : prefix
+        l_prefix =args[:prefix] || prefix
          if @member
            if standard?
              "#{l_prefix}/#{@collection.name}/:id"
diff --git a/server/server.rb b/server/server.rb
index f092933..c356803 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -69,15 +69,15 @@ end
  Sinatra::Application.register Sinatra::RespondTo
   # Redirect to /api
-get '/' do redirect url_for('/api'); end
+get '/' do redirect url_for('/api'), 301; end
  -get '/api/drivers\/?' do
+get '/api/drivers/?' do
    respond_to do |format|
      format.xml { haml :"api/drivers" }
    end
  end
  -get '/api\/?' do
+get '/api/?' do
    if params[:force_auth]
      return [401, 'Authentication failed'] unless 
driver.valid_credentials?(credentials)
    end
@@ -98,7 +98,7 @@ end
  # Rabbit DSL
   collection :realms do
-  description <<END
+  description <<-END
    Within a cloud provider a realm represents a boundary containing 
resources.
    The exact definition of a realm is left to the cloud provider.
    In some cases, a realm may represent different datacenters, 
different continents,
@@ -106,13 +106,14 @@ collection :realms do
    A cloud provider may insist that resources must all exist within a 
single realm in
    order to cooperate. For instance, storage volumes may only be 
allowed to be mounted to
    instances within the same realm.
-END
+  END
     operation :index do
-    description <<END
+    description <<-END
      Operation will list all available realms. Realms can be filtered using
      the "architecture" parameter.
-END
+    END
+         with_capability :realms
      param :id,            :string
      param :architecture,  :string,  :optional,  [ 'i386', 'x86_64' ]
@@ -130,17 +131,17 @@ END
  end
   collection :images do
-  description <<END
+  description <<-END
    An image is a platonic form of a machine. Images are not directly 
executable,
    but are a template for creating actual instances of machines."
-END
+  END
     operation :index do
-    description <<END
+    description <<-END
      The images collection will return a set of all images
      available to the current use. Images can be filtered using the
      "owner_id" and "architecture" parameters.
-END
+    END
      with_capability :images
      param :id,            :string
      param :architecture,  :string,  :optional
@@ -285,10 +286,10 @@ end
    collection :instances do
-  description <<END
+  description <<-END
    An instance is a concrete machine realized from an image.
    The images collection may be obtained by following the link from the 
primary entry-point."
-END
+  END
     operation :index do
      description "List all instances."
@@ -359,12 +360,12 @@ END
  end
   collection :hardware_profiles do
-  description <<END
+  description <<-END
   A hardware profile represents a configuration of resources upon which a
   machine may be deployed. It defines aspects such as local disk storage,
   available RAM, and architecture. Each provider is free to define as many
   (or as few) hardware profiles as desired.
-END
+ END
     operation :index do
      description "List of available hardware profiles."