Sha256: dfeda698bf786adcb7d9f20256bcd71cedf6423296a91fded6cc5b6254e2fd0f

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

module Rib; end
module Rib::Ramaze
  module_function
  def load
    load_ramaze
  rescue LoadError => e
    Rib.abort("Error: #{e}", "Is this a Ramaze app?")
  end

  def load_ramaze
    # try to produce consistent error message, and yet lazy loading ramaze
    require start_path unless ramaze?

    require 'ramaze'
    ::Ramaze.options.started = true

    require start_path
    at_exit{ puts('Ramazement has ended, go in peace.') }
  end

  def ramaze?
    File.exist?(start_path)
  end

  def start_path
    "#{Rib.config[:prefix]}/start.rb"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rib-1.4.0 lib/rib/app/ramaze.rb
rib-1.3.1 lib/rib/app/ramaze.rb
rib-1.3.0 lib/rib/app/ramaze.rb