Sha256: 84142a2f6272a7223fe70da9c0539671395458a004c0b0722e4947149af61ea9

Contents?: true

Size: 811 Bytes

Versions: 2

Compression:

Stored size: 811 Bytes

Contents

# encoding: utf-8

module Rango
  def self.parse(args = ARGV)
    # if you will run this script with -i argument, interactive session will begin
    Rango.interactive if ARGV.delete("-i")
    # so it can work as a runner
    load ARGV.shift if File.exist?(ARGV.first)
  end

  # Start IRB interactive session
  # @since 0.0.1
  def self.interactive
    require "irb"
    require "rango/utils"

    begin
      require "racksh/boot"
    rescue LoadError
      Rango.logger.info("For more goodies install racksh gem")
    else
      Rango::Utils.load_rackup # so you can use Rango::Router.app etc
    end

    begin
      require "irb/completion"
    rescue LoadError
      # some people can have ruby compliled without readline
    end

    ARGV.delete("-i") # otherwise irb will read it
    IRB.start
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rango-0.2.1 lib/rango/cli.rb
rango-0.2.1.pre lib/rango/cli.rb