Sha256: 8fe41e2e5618b27e6bd738919b4d88f5d952a658cf4e2885bbb87462635ec0a7

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

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

require "ruse"
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.0.1 lib/pico.rb