Skip to content

Instantly share code, notes, and snippets.

@nuclearsandwich
Created June 28, 2011 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuclearsandwich/1050636 to your computer and use it in GitHub Desktop.
Save nuclearsandwich/1050636 to your computer and use it in GitHub Desktop.
Which of these would you want to use forever?
# Which ones. Pick one number and one letter. Reply back to
# @nuclearsandwich on identi.ca or @_nuclearsammich on Twitter.
# 1) .snidelyrc
# 2) .snidely
# 3) Snidefile
# 4) Snidely
# 5) Snidefile
# A)
Snidely.render do |configs|
configs << Snidely::Config.new(:file => "gitconfig", :link => "~/.gitconfig")
configs << Snidely::Config.new(:file => "xmonad/xmonad.hs", :link => "~/.xmonad/xmonad.hs")
configs << Snidely::Config.new(:file => "hgrc", :link => "~/.hgrc")
configs << Snidely::Config.new(:file => "bash_profile/", :link => "~/.bash_profile")
configs << Snidely::Config.new(:file => "bashrc", :link => "~/.bashrc")
end
# B)
config "gitconfig" # Link name optional and inferred.
config "xmonad/xmonad.hs", :link => "~/.xmonad/xmonad.hs"
config "hgrc", :link => "~/.hgrc"
config "bash_profile/", :link => "~/.bash_profile"
@eostrom
Copy link

eostrom commented Jun 28, 2011

2, probably. 3 if I'm going to be running this file directly or editing it often.

B, for conciseness and clarity, unless there's a compelling bed for additional flexibility provided by A.

@nuclearsandwich
Copy link
Author

B it is then. Both syntaxes are modeled on existing Ruby idioms, A being Rails 2's config environment, B being Bundler's Gemfile.

The file itself will be a meta-dotfile which goes in your .dotfiles repo and handles symlink generation as well as using mustache to inject platform specific config elements such as fonts or aliases in addition to info you'd rather not make public like API keys and passwords. The in-progress repo is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment