Method: Libexec::Exec#by_ls_1
- Defined in:
- lib/libexec/exec.rb
#by_ls_1(*argv, env: {}, mode: "r", **opts) ⇒ Array
wrapper for ‘ls -1` which will be often used
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/libexec/exec.rb', line 35 def by_ls_1(*argv, env: {}, mode: "r", **opts) arr = [] argv.unshift("ls", "-1") cmd = _js_style_cmd(argv) IO.popen(env, cmd, mode, opts) do |pipe| pipe.each_line do |line| arr.push(line.chomp) end end arr end |