Sha256: 580578a54db335cc5eda75948a948303a25a9f35082979923ca71222bc0c34c1

Contents?: true

Size: 750 Bytes

Versions: 1

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

require "bootsnap"

env = ENV.fetch("PUNK_ENV") { ENV.store("PUNK_ENV", "development") }

if defined?(Bootsnap)
  # TODO: update gem and check setup options
  Bootsnap.setup(
    cache_dir: "tmp/cache",
    development_mode: env == "development",
    load_path_cache: true,
    compile_cache_iseq: true,
    compile_cache_yaml: true
  )
end

module PUNK
  def self.init(task: "server", path: "./app", config: {})
    require_relative "punk/core/interface"
    raise InternalServerError, "Cannot call PUNK.init multiple times!" if state != :included
    store.args = OpenStruct.new(
      task: task,
      path: path,
      config: config
    )
    store.state = :initialised
    Interface.bootstrap
    self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
punk-0.4.1 lib/punk.rb