Skip to content

Commit

Permalink
only require core for bin/rib, not for Rib.shell, see:
Browse files Browse the repository at this point in the history
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
  • Loading branch information
godfat committed Aug 26, 2011
1 parent 277b631 commit 7a97441
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions bin/rib
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby

require 'rib/runner'
require 'rib/core'
Rib::Runner.run(ARGV)
6 changes: 1 addition & 5 deletions lib/rib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7a97441

Please sign in to comment.