Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concept for potentially better interface #1

Open
trans opened this issue Jun 25, 2010 · 1 comment
Open

Concept for potentially better interface #1

trans opened this issue Jun 25, 2010 · 1 comment

Comments

@trans
Copy link
Member

trans commented Jun 25, 2010

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.)

@trans
Copy link
Member Author

trans commented Jun 25, 2010

Hell, technically they could just be called:

XDG_CONFIG
XDG_CONFIG_HOME
XDG_CONFIG_DIRS

Then they would look just like the environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant