Sha256: 0083304119e3aaf5ee951164d84ddcd627ab5cb17ead8b0af4f22769582bad9f

Contents?: true

Size: 1.36 KB

Versions: 2

Compression:

Stored size: 1.36 KB

Contents

# You shouldn't place Bond.complete statements before requiring this file
# unless you're also reproducing this Bond.debrief
Bond.debrief(:default_search=>:underscore) unless Bond.config[:default_search]
Bond.debrief(:default_mission=>:default) unless Bond.config[:default_mission]
Bond.complete(:method=>/system|`/, :action=>:shell_commands)
Bond.complete(:method=>'require', :action=>:method_require, :search=>false)

# irb/completion reproduced without the completion quirks
# Completes classes and constants
Bond.complete(:on=>/(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/, :action=>:constants, :search=>false)
# Completes absolute constants
Bond.complete(:on=>/::([A-Z][^:\.\(]*)$/, :search=>false) {|e|
  Object.constants.grep(/^#{Regexp.escape(e.matched[1])}/).collect{|f| "::" + f}
}
# Completes symbols
Bond.complete(:on=>/(:[^:\s.]*)$/) {|e|
  Symbol.respond_to?(:all_symbols) ? Symbol.all_symbols.map {|f| ":#{f}" } : []
}
# Completes global variables
Bond.complete(:on=>/(\$[^\s.]*)$/, :search=>false) {|e|
  global_variables.grep(/^#{Regexp.escape(e.matched[1])}/)
}
# Completes files
Bond.complete(:on=>/\s+["']([^'"]*)$/, :search=>false, :action=>:quoted_files, :place=>:last)
# Completes any object's methods
Bond.complete(:object=>"Object", :place=>:last)
# Completes method completion anywhere in the line
Bond.complete(:on=>/([^.\s]+)\.([^.\s]*)$/, :object=>"Object", :place=>:last)

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
cldwalker-bond-0.1.3 lib/bond/completion.rb
bond-0.1.3 lib/bond/completion.rb