Class Boson::ConsoleRunner

  1. lib/boson/runners/console_runner.rb
Parent: Boson::Runner

Runner used when starting irb. To use in irb, drop this in your ~/.irbrc:

require 'boson'


public class

  1. bin_start
  2. start

Public class methods

bin_start (repl, libraries)

Loads libraries and then starts irb (or the configured console) from the commandline.

[show source]
# File lib/boson/runners/console_runner.rb, line 22
      def bin_start(repl, libraries)
        start :no_defaults=>true, :libraries=>libraries
        repl = Boson.repo.config[:console] if Boson.repo.config[:console]
        repl = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb' unless repl.is_a?(String)
        unless repl.index('/') == 0 || (repl = Util.which(repl))
          $stderr.puts "Console not found. Please specify full path in config[:console]."
        ARGV.replace ['-f']
        Kernel.load $0 = repl
start (options={})

Starts Boson by loading configured libraries. If no default libraries are specified in the config, it will load up all detected libraries. Options:

Array of libraries to load.
Boolean to be verbose about libraries loading. Default is true.
Boolean which turns off loading any default libraries. Default is false.
Boolean which makes any command execution easier. It redefines method_missing on Boson.main_object so that commands with unloaded libraries are automatically loaded. Default is false.
[show source]
# File lib/boson/runners/console_runner.rb, line 15
      def start(options={})
        @options = {:verbose=>true}.merge options
        init unless @initialized
        Manager.load(@options[:libraries], load_options) if @options[:libraries]