Sha256: 387072c558f680964f4d981628d4fc5d0c11273b70cbe1ee6cb9644b7a9651cb

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 Bytes

Contents

require "pico/string_inflections"
require "pico/autoloader"
require "pico/context"
require "pico/application"
require "pico/version"

require "ruse"
require "pathname"
require "pico/ruse_extensions"

if defined? Rake
  require "pico/rake"
end

module Pico
  extend self

  attr :application, :contexts
  @contexts = {}

  def define_application(name, **params, &block)
    contexts[name] = @application = Application.new(name, **params, &block)
  end

  def define_context(name, **params)
    contexts[name] = Context.new(name, **params)
  end

  def boot!
    contexts.each_value(&:boot!)
  end

  def shutdown!
    contexts.each_value do |context|
      context.shutdown! if context.booted?
    end
    contexts.clear
  end

  Error = Class.new StandardError
  Exception = Class.new Error
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pico-0.1.0 lib/pico.rb