Sha256: 0154578989640be74afe49a60ab89e448648ff234092ecf815efd6c24c3e60e1

Contents?: true

Size: 878 Bytes

Versions: 15

Compression:

Stored size: 878 Bytes

Contents

module Hobo
  module Helper

    def vm_shell command, opts = {}
      shell ::Hobo::Lib::Vm::Command.new(command, opts).to_s, opts
    end

    def vm_mysql opts = {}
      opts = {
        :auto_echo => true,
        :db => "",
        :user => maybe(Hobo.project_config.mysql.username) || "",
        :pass => maybe(Hobo.project_config.mysql.password) || "",
        :mysql => 'mysql'
      }.merge(opts)

      opts[:user] = "-u#{opts[:user].shellescape}" unless opts[:user].empty?
      opts[:pass] = "-p#{opts[:pass].shellescape}" unless opts[:pass].empty?
      opts[:db] = opts[:db].shellescape unless opts[:db].empty?

      ::Hobo::Lib::Vm::Command.new "#{opts[:mysql]} #{opts[:user]} #{opts[:pass]} #{opts[:db]}".strip, opts
    end

    def vm_command command = nil, opts = {}
      ::Hobo::Lib::Vm::Command.new command, opts
    end
  end
end

include Hobo::Helper

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hobo-inviqa-0.0.15 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.14 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.13 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.11 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc11 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc10 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc9 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc8 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc7 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc6 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc4 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.10.pre.rc2 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.9 lib/hobo/helper/vm_command.rb
hobo-inviqa-0.0.9.pre.rc2 lib/hobo/helper/vm_command.rb