Class: LSWish
- Inherits:
-
Djinni::Wish
- Object
- Djinni::Wish
- LSWish
- Defined in:
- lib/jenkins_shell/wish/ls_wish.rb
Instance Method Summary collapse
- #aliases ⇒ Object
- #description ⇒ Object
- #execute(args, djinni_env = Hash.new) ⇒ Object
- #usage ⇒ Object
Instance Method Details
#aliases ⇒ Object
4 5 6 |
# File 'lib/jenkins_shell/wish/ls_wish.rb', line 4 def aliases return ["ls", "dir"] end |
#description ⇒ Object
8 9 10 |
# File 'lib/jenkins_shell/wish/ls_wish.rb', line 8 def description return "List directory contents" end |
#execute(args, djinni_env = Hash.new) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# 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 ⇒ Object
25 26 27 28 |
# File 'lib/jenkins_shell/wish/ls_wish.rb', line 25 def usage puts "#{aliases.join(", ")} [directory]" puts " #{description}." end |