Permalink
Browse files

added status class

  • Loading branch information...
1 parent f4ae044 commit ebbc0c32e93f9d77345ff1b6485d830b9f18b706 @joshbuddy committed Jan 4, 2010
Showing with 40 additions and 37 deletions.
  1. +1 −0 lib/messed/tasks.rb
  2. +37 −0 lib/messed/tasks/status.rb
  3. +2 −37 patterns/messed/bin/status
View
@@ -2,6 +2,7 @@ class Messed
module Tasks
autoload :Generation, File.join('messed', 'tasks', 'generation')
autoload :Runner, File.join('messed', 'tasks', 'runner')
+ autoload :Status, File.join('messed', 'tasks', 'status')
autoload :Web, File.join('messed', 'tasks', 'web')
autoload :Console, File.join('messed', 'tasks', 'console')
end
View
@@ -0,0 +1,37 @@
+class Messed
+ module Tasks
+ class Status < Thor
+
+ desc "Status", "status"
+ method_options :environment => "development"
+ def status
+ booter = Messed::Booter.new(File.expand_path(File.join(File.dirname(__FILE__), '..')), options.environment)
+
+ puts "=Queues"
+ puts "==Incoming"
+ booter.application.incoming.status.each {|k,v|
+ puts " %40s - %s" % [k, v]
+ }
+
+ puts "==Outgoing"
+ booter.application.outgoing.status.each {|k,v|
+ puts " %40s - %s" % [k, v]
+ }
+
+ puts "=Interfaces"
+ booter.interface_map.each {|name, interface|
+ puts "==#{interface.name}"
+ Messed::Util::RemoteStatus.new(interface.configuration.options['host'], interface.configuration.options['port']).status.each {|k,v|
+ puts " %40s - %s" % [k, v]
+ }
+ }
+
+ puts "=Application"
+ Messed::Util::RemoteStatus.new(booter.application.configuration['host'], booter.application.configuration['port']).status.each {|k,v|
+ puts " %40s - %s" % [k, v]
+ }
+ end
+
+ end
+ end
+end
View
@@ -1,38 +1,3 @@
-class IncomingRunnerTask < Thor
+$root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- desc "Status", "status"
- method_options :environment => "development"
- def status
- booter = Messed::Booter.new(File.expand_path(File.join(File.dirname(__FILE__), '..')), options.environment)
-
- puts "=Queues"
- puts "==Incoming"
- booter.application.incoming.status.each {|k,v|
- puts " %40s - %s" % [k, v]
- }
-
- puts "==Outgoing"
- booter.application.outgoing.status.each {|k,v|
- puts " %40s - %s" % [k, v]
- }
-
- puts "=Interfaces"
- booter.interface_map.each {|name, interface|
- puts "==#{interface.name}"
- Messed::Util::RemoteStatus.new(interface.configuration.options['host'], interface.configuration.options['port']).status.each {|k,v|
- puts " %40s - %s" % [k, v]
- }
- }
-
-
- puts "=Application"
- Messed::Util::RemoteStatus.new(booter.application.configuration['host'], booter.application.configuration['port']).status.each {|k,v|
- puts " %40s - %s" % [k, v]
- }
-
-
- end
-
-end
-
-IncomingRunnerTask.start
+Messed::Tasks::Status.start

0 comments on commit ebbc0c3

Please sign in to comment.