Skip to content

Concept for potentially better interface #1

@trans

Description

@trans

Where as currently we have a partial method/constant interface, e.g. XDG::Config.home or XDG.config.home. It is possible to use a complete constant and make it act both like an string/array and a pathname.

XDG::CONFIG::HOME  => "~/.config"
XDG::CONFIG::DIRS  => ["/etc/xdg", "/etc"]

But still have a file based set of methods too:

XDG::CONFIG::DIRS.find(pattern){ |f| .... }
XDG::CONFIG::DIRS.glob(pattern){ |f| .... }

And to include both home and dirs:

XDG::CONFIG.find(pattern){ |f| .... }
XDG::CONFIG.glob(pattern){ |f| .... }

(Might use a different name for #find since that's used by Enumerable already, but not sure what that might be.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions