Skip to content

Can't assign result of a command execution to a variable #1

@sohocoke

Description

@sohocoke

It appears the result of an assignment of the results of a call to Command#map, ends up with the variable pointing to the Command, rather than the result Array.

parkan@xldn3743vdap:~$ irb -rrubish
>> Rubish.repl
> ls
archived_  Documents  logs     Movies    pkgs    src
bin        Downloads  mmt      Music     public  tmp
Desktop    Library    mob-dev  Pictures  Public  vpworkspace
> files = ls.map
["archived_",
 "bin",
 "Desktop",
 "Documents",
 "Downloads",
 "Library",
 "logs",
 "mmt",
 "mob-dev",
 "Movies",
 "Music",
 "Pictures",
 "pkgs",
 "public",
 "Public",
 "src",
 "tmp",
 "vpworkspace"]
> puts files
#<Rubish::Command:0x98e4c58 @args=[], @cmd="files", @quoted=false>
> files.class
Rubish::Command
> ls.map.class
Array
>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions