Sha256: 9db2e90c2248631cc8964f9c758504a78994f5e927aaaf339110a128c521200b

Contents?: true

Size: 924 Bytes

Versions: 2

Compression:

Stored size: 924 Bytes

Contents

# frozen_string_literal: true

require "cgi"
require "zeitwerk"
require "syntax_tree"

loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
loader.ignore("#{__dir__}/generators")
loader.ignore("#{__dir__}/install")
loader.inflector.inflect("html" => "HTML")
loader.inflector.inflect("vcall" => "VCall")
loader.inflector.inflect("fcall" => "FCall")
loader.setup

module Phlex
	Error = Module.new
	ArgumentError = Class.new(ArgumentError) { include Error }
	NameError = Class.new(NameError) { include Error }

	extend self

	ATTRIBUTE_CACHE = {}

	def const_missing(name)
		if name == :Component
			raise NameError, "👋 Phlex::Component is now Phlex::View"
		else
			super
		end
	end

	def configuration
		@configuration ||= Configuration.new
	end

	def configure
		yield configuration
	end
end

begin
	require "rails"
	require "phlex/engine"
rescue LoadError
	# Rails isn't in this env, don't load the engine.
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phlex-0.4.0 lib/phlex.rb
phlex-0.3.2 lib/phlex.rb