Sha256: 75035623d94a835ff63cc92f1edbc32a69693efbafdb0470c5d4f104d1e1d54e

Contents?: true

Size: 750 Bytes

Versions: 3

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

3 entries across 3 versions & 1 rubygems

Version Path
punk-0.3.6 lib/punk.rb
punk-0.3.5 lib/punk.rb
punk-0.3.4 lib/punk.rb