Sha256: dcc0bce8989a0e731e6d39a9756e89af557164f8be47285644e26f46d5106465

Contents?: true

Size: 659 Bytes

Versions: 3

Compression:

Stored size: 659 Bytes

Contents

module FogExtensions
  module Fogdocker
    module Server
      extend ActiveSupport::Concern

      include ActionView::Helpers::NumberHelper

      def state
        state_running ? "Running" :"Stopped"
      end

      def command
        c=[]
        c += entrypoint if entrypoint.any?
        c += cmd if cmd.any?
        c.join(' ')
      end

      def poweroff
        service.vm_action(:id =>id, :action => :kill)
      end

      def reset
        poweroff
        start
      end

      def vm_description
        _("%{cores} Cores and %{memory} memory") % {:cores => cpus, :memory => number_to_human_size(memory.to_i)}
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_docker-0.0.3 app/models/concerns/fog_extensions/fogdocker/server.rb
foreman_docker-0.0.2 app/models/concerns/fog_extensions/fogdocker/server.rb
foreman_docker-0.0.1 app/models/concerns/fog_extensions/fogdocker/server.rb