From 39d2b456a7f0fc2bb3b0e456d5ed01a5af53eede Mon Sep 17 00:00:00 2001 From: Adam Sanderson Date: Wed, 10 Nov 2010 13:24:36 -0800 Subject: [PATCH] optionally load a custom configuration script. --- lib/qwandry/launcher.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/qwandry/launcher.rb b/lib/qwandry/launcher.rb index 852c70b..961498f 100644 --- a/lib/qwandry/launcher.rb +++ b/lib/qwandry/launcher.rb @@ -11,6 +11,7 @@ module Qwandry def initialize @repositories = Hash.new{|h,k| h[k] = []} configure_repositories! + custom_configuration! end # Adds a repository path to Qwandry's Launcher. @@ -61,6 +62,13 @@ module Qwandry add :gem, path end end - + + def custom_configuration! + custom_path = ENV['HOME'] && ENV['HOME'] + '/.qwandry/init.rb' + if File.exist? custom_path + eval IO.read(custom_path) + end + end + end end \ No newline at end of file