Sha256: 78b77c3086aed661f9a54737cc3fe5e64d99b5f9a061078d7d61be54dad185be

Contents?: true

Size: 1.42 KB

Versions: 10

Compression:

Stored size: 1.42 KB

Contents

require File.dirname(__FILE__) + "/display"

module PoolParty
  module Console
    
    include Display
    
    # Print help commands for the console
    # level 0 - Basic help
    # level 1 - Commands
    def help(level=0)
      @np = NicePrinter.new(60)
      @np.header
      @np.center "PoolParty console help"      
      @np.center "Basics"
      @np << "Load your pool with load_pool(filename)"
      @np << "Reference clouds with"
      @np << "c = cloud :cloudname"
      @np.empty
      if level >= 1
        @np.center "CloudSpeak"
        @np << "All the commands set on your cloud can be called within the console"
        @np << "instances_by_status('running') - get list of running nodes"
        @np << "list_of_pending_instances - get list of pending nodes"
        @np << "available_monitors - get list of the available monitors on the cloud"
        @np << "  note: all monitors can be called as a method on the cloud"
        @np << "    i.e. CpuMonitor makes the method cpu available on the cloud"
        @np.empty
      end
      @np.footer
      @np.print
    end
    
    # Clear all the pools and reload the console
    # Call within console to reset and reload the entire poolparty base
    # as well
    def reload!      
      reset!
      require File.dirname(__FILE__) + "/../../../poolparty"
      require File.dirname(__FILE__) + "/../../../poolpartycl"
    end
    
  end
end

class Object
  include PoolParty::Console
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
auser-poolparty-1.1.6 lib/poolparty/helpers/console.rb
auser-poolparty-1.1.7 lib/poolparty/helpers/console.rb
auser-poolparty-1.2.0 lib/poolparty/helpers/console.rb
auser-poolparty-1.2.1 lib/poolparty/helpers/console.rb
auser-poolparty-1.2.2 lib/poolparty/helpers/console.rb
auser-poolparty-1.2.3 lib/poolparty/helpers/console.rb
auser-poolparty-1.2.4 lib/poolparty/helpers/console.rb
auser-poolparty-1.2.7 lib/poolparty/helpers/console.rb
fairchild-poolparty-1.1.5 lib/poolparty/helpers/console.rb
poolparty-1.2.2 lib/poolparty/helpers/console.rb