From 7a97441afeecae80f5493f4e8a4a6ba3044e2c33 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 26 Aug 2011 16:37:54 +0800 Subject: [PATCH] only require core for bin/rib, not for Rib.shell, see: at first i want to give people core plugins automatically if you're not using any plugin. so that using `rib` directly would give you an irb like session. but this is buggy :( if there's a program: require 'rib/more/anchor' Rib.anchor 123 then this would crash, because we ended up with plugins: (crash reason is that Anchor is not overriding Underscore!) [Rib::Anchor, Rib::Underscore] but it should be: [Rib::Underscore, Rib::Anchor] or merely: [Rib::Anchor] we can't really detect if we would want core plugins when calling `Rib.shell`, so this is too messy! thanks andrew --- bin/rib | 1 + lib/rib.rb | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/rib b/bin/rib index d228a36..67acaf1 100644 --- a/bin/rib +++ b/bin/rib @@ -1,4 +1,5 @@ #!/usr/bin/env ruby require 'rib/runner' +require 'rib/core' Rib::Runner.run(ARGV) diff --git a/lib/rib.rb b/lib/rib.rb index 895a372..4590df7 100644 --- a/lib/rib.rb +++ b/lib/rib.rb @@ -35,11 +35,7 @@ def home # need a clean shell which does not load rc file, use Shell.new instead. def shell shells.last || begin - if config_path - require_config - else # for those who don't have a config, we use core plugins - require 'rib/core' - end + require_config if config_path (shells << Shell.new(config)).last end end