From a2b6324829082b9653b61264e0f3f24789e04d9d Mon Sep 17 00:00:00 2001 From: Ben Hoskings Date: Thu, 20 May 2010 03:35:51 +1000 Subject: [PATCH] Extract 'fish' logic into :shell_setup meta dep. --- shells.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shells.rb b/shells.rb index aba4312..7750d83 100644 --- a/shells.rb +++ b/shells.rb @@ -1,9 +1,13 @@ -dep 'fish' do - requires 'fish installed' - met? { grep which('fish'), '/etc/shells' } - meet { append_to_file which('fish'), '/etc/shells', :sudo => true } +meta :shell_setup do + template { + setup { requires "#{name} installed" } + met? { grep which(name), '/etc/shells' } + meet { append_to_file which(name), '/etc/shells', :sudo => true } + } end +shell_setup 'fish' + src 'fish installed' do requires 'ncurses', 'coreutils', 'gettext' source "git://github.com/benhoskings/fish.git"