Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 7a97441afeecae80f5493f4e8a4a6ba3044e2c33 1 parent 277b631
@godfat authored
Showing with 2 additions and 5 deletions.
  1. +1 −0  bin/rib
  2. +1 −5 lib/rib.rb
View
1  bin/rib
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
require 'rib/runner'
+require 'rib/core'
Rib::Runner.run(ARGV)
View
6 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

0 comments on commit 7a97441

Please sign in to comment.
Something went wrong with that request. Please try again.