Permalink
Browse files

Add bare option to Bond.start

  • Loading branch information...
1 parent e11a2e0 commit 7ce101cfb6610622d73b63943907fb2d7dc9255a @cldwalker committed Dec 23, 2010
Showing with 8 additions and 6 deletions.
  1. +3 −1 lib/bond.rb
  2. +1 −1 lib/bond/completions/bond.rb
  3. +4 −4 lib/bond/m.rb
View
@@ -103,7 +103,9 @@ def config; M.config; end
# @option options [Boolean] :debug (false) Shows the stacktrace when autocompletion fails and raises exceptions
# in Rc.eval.
# @option options [Boolean] :eval_debug (false) Raises eval errors occuring when finding a matching completion.
- # Useful to debug an incorrect completion.
+ # Useful to debug an incorrect completion
+ # @option options [Boolean] :bare (false) Doesn't load default ruby completions and completions in
+ # ~/.bond*. Useful for non-ruby completions
def start(options={}, &block); M.start(options, &block); end
# Restarts completions with given options, ensuring to delete current completions.
@@ -2,7 +2,7 @@
["on", "method", "methods", "class", "object", "anywhere", "prefix", "search", "action", "place", "name"]
}
complete(:methods=>['Bond.start', 'Bond.restart']) {
- ["gems", "yard_gems", "readline_plugin", "default_mission", "default_search", "eval_binding", "debug", "eval_debug"]
+ %w{gems yard_gems readline_plugin default_mission default_search eval_binding debug eval_debug bare}
}
complete(:method=>'Bond.load_yard_gems') {
["verbose", "reload"]
View
@@ -126,12 +126,12 @@ def load_plugin_file(rubygem)
end
def load_completions
- load_file File.join(File.dirname(__FILE__), 'completion.rb')
- load_dir File.dirname(__FILE__)
+ load_file File.join(File.dirname(__FILE__), 'completion.rb') unless config[:bare]
+ load_dir File.dirname(__FILE__) unless config[:bare]
load_gems *config[:gems] if config[:gems]
Yard.load_yard_gems *config[:yard_gems] if config[:yard_gems]
- load_file(File.join(home,'.bondrc')) if File.exists?(File.join(home, '.bondrc'))
- load_dir File.join(home, '.bond')
+ load_file(File.join(home,'.bondrc')) if File.exists?(File.join(home, '.bondrc')) && !config[:bare]
+ load_dir File.join(home, '.bond') unless config[:bare]
end
end
end

0 comments on commit 7ce101c

Please sign in to comment.