class Mushy::Pwd

Public Class Methods

details() click to toggle source
# File lib/mushy/fluxs/pwd.rb, line 5
def self.details
  {
    name: 'Pwd',
    description: 'Run the "pwd" command.',
    config: Mushy::Bash.details[:config].tap { |c| c.delete :command },
  }
end

Public Instance Methods

process(event, config) click to toggle source
Calls superclass method Mushy::Bash#process
# File lib/mushy/fluxs/pwd.rb, line 13
def process event, config

  config[:command] = 'pwd'

  result = super event, config

  return result unless result[:success]

  pwd = result[:text].to_s.strip

  {
    pwd: Mushy::Ls.new.process({}, { path: pwd, directory_only: true })[0]
  }

end