deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [40/50] [abbrv] git commit: Core: Added possiblity to list all Rabbit defined routes by rake rabbit:routes
Date Tue, 22 May 2012 20:19:38 GMT
Core: Added possiblity to list all Rabbit defined routes by rake rabbit:routes


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/b504b173
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/b504b173
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/b504b173

Branch: refs/heads/master
Commit: b504b173d05d2cdd69201f7c4537309350f29907
Parents: 4c99e86
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Tue Apr 17 15:26:46 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue May 22 22:17:35 2012 +0200

----------------------------------------------------------------------
 server/Rakefile |   51 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/b504b173/server/Rakefile
----------------------------------------------------------------------
diff --git a/server/Rakefile b/server/Rakefile
index 147cdcf..5d205ce 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -193,3 +193,54 @@ namespace :mock do
 
   end
 end
+
+namespace :openshift do
+
+  desc "Deploy Deltacloud API to OpenShift"
+  task :deploy do
+    print "RHN or OpenShift login with OpenShift Express access: "
+    STDOUT.flush
+    login = STDIN.gets.chomp
+    print "Password: "
+    system "stty -echo"
+    password = STDIN.gets.chomp
+    system "stty echo"
+    puts `rhc-create-app --rhlogin #{login} --app deltacloudtest --password '#{password}'
--type ruby-1.8`
+  end
+end
+
+namespace :rabbit do
+  load File.join(File.dirname(__FILE__), 'config.ru')
+
+  desc "List the routes defined by Rabbit"
+  task :routes do
+    Deltacloud.collections.each do |c|
+      puts "\033[1;32;m#{c.name}\33[0m"
+      c.operations.each do |o|
+        puts "\033[1;37m%6s\033[0m :%-10s %-30s (%s)" % [
+          o.http_method.to_s.upcase,
+          o.operation_name,
+          o.full_path,
+          o.description[0..100]
+        ]
+      end
+      unless c.collections.empty?
+        puts
+        c.collections.each do |s|
+          puts "\033[1;32;m#{s.name}\33[0m"
+          s.operations.each do |o|
+            puts "\033[1;37m%6s\033[0m :%-10s %-30s (%s)" % [
+              o.http_method.to_s.upcase,
+              o.operation_name,
+              o.full_path,
+              o.description[0..100]
+            ]
+          end
+        end
+      end
+      puts
+    end
+  end
+
+end
+


Mime
View raw message