class LSWish

Public Instance Methods

aliases() click to toggle source
# File lib/jenkins_shell/wish/ls_wish.rb, line 4
def aliases
    return ["ls", "dir"]
end
description() click to toggle source
# File lib/jenkins_shell/wish/ls_wish.rb, line 8
def description
    return "List directory contents"
end
execute(args, djinni_env = Hash.new) click to toggle source
# File lib/jenkins_shell/wish/ls_wish.rb, line 12
def execute(args, djinni_env = Hash.new)
    jsh = djinni_env["jsh"]

    case djinni_env["os"]
    when JenkinsShell::OS.LINUX
        puts jsh.command("ls #{args}")
        djinni_env["djinni_prompt"] = "#{jsh.cwd}$ ".light_white
    when JenkinsShell::OS.WINDOWS
        puts jsh.command("dir #{args}")
        djinni_env["djinni_prompt"] = "#{jsh.cwd}> ".light_white
    end
end
usage() click to toggle source
# File lib/jenkins_shell/wish/ls_wish.rb, line 25
def usage
    puts "#{aliases.join(", ")} [directory]"
    puts "    #{description}."
end