Sha256: 9894e180c44bee5aeb747f79f3f67e85cb26abaf0d8b56c4f09c33b91ee04900

Contents?: true

Size: 789 Bytes

Versions: 37

Compression:

Stored size: 789 Bytes

Contents

irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'

require 'optparse'

options = { :irb => irb }
OptionParser.new do |opt|
  opt.banner = "Usage: console [environment] [options]"
  opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |v| options[:irb] = v }
  opt.on("--debugger", 'Enable ruby-debugging for the console.') { |v| options[:debugger] = v }
  opt.parse!(ARGV)
end

libs =  " -r irb/completion"
libs << %( -r "#{APP_ROOT}/config/environment")

if options[:debugger]
  begin
    require 'ruby-debug'
    libs << " -r ruby-debug"
    puts "=> Debugger enabled"
  rescue Exception
    puts "You need to install ruby-debug to run the console in debugging mode. With gems, use 'gem install ruby-debug'"
    exit
  end
end

exec "#{options[:irb]} #{libs} --simple-prompt"

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
maccman-bowline-0.1.1 lib/bowline/commands/console.rb
maccman-bowline-0.1.10 lib/bowline/commands/console.rb
maccman-bowline-0.1.2 lib/bowline/commands/console.rb
maccman-bowline-0.1.3 lib/bowline/commands/console.rb
maccman-bowline-0.1.4 lib/bowline/commands/console.rb
maccman-bowline-0.1.6 lib/bowline/commands/console.rb
maccman-bowline-0.1.7 lib/bowline/commands/console.rb
maccman-bowline-0.1.8 lib/bowline/commands/console.rb
maccman-bowline-0.3.0 lib/bowline/commands/console.rb
maccman-bowline-0.3.1 lib/bowline/commands/console.rb
maccman-bowline-0.3.3 lib/bowline/commands/console.rb
maccman-bowline-0.3.5 lib/bowline/commands/console.rb
maccman-bowline-0.3.6 lib/bowline/commands/console.rb
maccman-bowline-0.3.7 lib/bowline/commands/console.rb
maccman-bowline-0.3.9 lib/bowline/commands/console.rb
maccman-bowline-0.4.0 lib/bowline/commands/console.rb
maccman-bowline-0.4.1 lib/bowline/commands/console.rb
maccman-bowline-0.4.3 lib/bowline/commands/console.rb
maccman-bowline-0.4.4 lib/bowline/commands/console.rb
maccman-bowline-0.4.5 lib/bowline/commands/console.rb