Sha256: 4d535a45f394994c91cf211237e02e1a2b975d17e4e6b34d935fdccf74a483db
Contents?: true
Size: 899 Bytes
Versions: 3
Compression:
Stored size: 899 Bytes
Contents
module Bundler class CLI::Console attr_reader :options, :group def initialize(options, group) @options = options @group = group end def run group ? Bundler.require(:default, *(group.split.map! {|g| g.to_sym })) : Bundler.require ARGV.clear console = get_console(Bundler.settings[:console] || 'irb') load '.consolerc' if File.exists?('.consolerc') console.start end def get_console(name) require name get_constant(name) rescue LoadError Bundler.ui.error "Couldn't load console #{name}" get_constant('irb') end def get_constant(name) const_name = { 'pry' => :Pry, 'ripl' => :Ripl, 'irb' => :IRB, }[name] Object.const_get(const_name) rescue NameError Bundler.ui.error "Could not find constant #{const_name}" exit 1 end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bundler-prehistoric-1.6.2.2 | lib/bundler/cli/console.rb |
bundler-prehistoric-1.6.2.1 | lib/bundler/cli/console.rb |
bundler-prehistoric-1.6.2 | lib/bundler/cli/console.rb |