Sha256: 2a6141cef7d17f02cb0170fbde1cec9206c85be93218fee8628896e2645532c2

Contents?: true

Size: 543 Bytes

Versions: 11

Compression:

Stored size: 543 Bytes

Contents

module Kurchatov
  module Mixin
    module Command

      def shell_out(cmd)
        mix = ::Mixlib::ShellOut.new(cmd)
        mix.run_command
        mix
      end

      def shell_out!(cmd)
        mix = shell_out(cmd)
        mix.error!
        mix
      end

      def shell(cmd)
        mix = shell_out!(cmd)
        mix.stdout
      end

      def print_unix_mem_info
        pid, size = `ps ax -o pid,rss | grep -E "^[[:space:]]*#{$$}"`.strip.split.map(&:to_i)
        puts "Pid: #{pid}, memusage: #{size}"
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kurchatov-0.0.5.pre5 lib/kurchatov/mixin/command.rb
kurchatov-0.0.5.pre4 lib/kurchatov/mixin/command.rb
kurchatov-0.0.5.pre2 lib/kurchatov/mixin/command.rb
kurchatov-0.0.5.pre1 lib/kurchatov/mixin/command.rb
kurchatov-0.0.4 lib/kurchatov/mixin/command.rb
kurchatov-0.0.4d lib/kurchatov/mixin/command.rb
kurchatov-0.0.4c lib/kurchatov/mixin/command.rb
kurchatov-0.0.4b lib/kurchatov/mixin/command.rb
kurchatov-0.0.3 lib/kurchatov/mixin/command.rb
kurchatov-0.0.3b lib/kurchatov/mixin/command.rb
kurchatov-0.0.3a lib/kurchatov/mixin/command.rb