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'
Boson.start

Methods

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]."
          return
        end
        ARGV.replace ['-f']
        Kernel.load $0 = repl
      end
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:

:libraries
Array of libraries to load.
:verbose
Boolean to be verbose about libraries loading. Default is true.
:no_defaults
Boolean which turns off loading any default libraries. Default is false.
:autoload_libraries
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]
      end