phlex 2.0.0.beta1 → 2.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +8 -11
 - data/lib/phlex/context.rb +3 -2
 - data/lib/phlex/csv.rb +4 -11
 - data/lib/phlex/error.rb +1 -0
 - data/lib/phlex/fifo.rb +1 -0
 - data/lib/phlex/helpers.rb +3 -1
 - data/lib/phlex/html/standard_elements.rb +1033 -722
 - data/lib/phlex/html/void_elements.rb +94 -56
 - data/lib/phlex/html.rb +1 -7
 - data/lib/phlex/kit.rb +23 -11
 - data/lib/phlex/{elements.rb → sgml/elements.rb} +18 -44
 - data/lib/phlex/sgml.rb +221 -263
 - data/lib/phlex/svg/standard_elements.rb +480 -449
 - data/lib/phlex/svg.rb +0 -3
 - data/lib/phlex/{black_hole.rb → vanish.rb} +1 -1
 - data/lib/phlex/version.rb +1 -1
 - data/lib/phlex.rb +2 -5
 - metadata +5 -7
 - data/lib/phlex/deferred_render.rb +0 -29
 - data/lib/phlex/element_clobbering_guard.rb +0 -16
 
    
        data/lib/phlex/svg.rb
    CHANGED
    
    
    
        data/lib/phlex/version.rb
    CHANGED
    
    
    
        data/lib/phlex.rb
    CHANGED
    
    | 
         @@ -5,13 +5,11 @@ require "set" 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            module Phlex
         
     | 
| 
       7 
7 
     | 
    
         
             
            	autoload :ArgumentError, "phlex/errors/argument_error"
         
     | 
| 
       8 
     | 
    
         
            -
            	autoload : 
     | 
| 
       9 
     | 
    
         
            -
            	autoload :BlackHole, "phlex/black_hole"
         
     | 
| 
      
 8 
     | 
    
         
            +
            	autoload :Vanish, "phlex/vanish"
         
     | 
| 
       10 
9 
     | 
    
         
             
            	autoload :CSV, "phlex/csv"
         
     | 
| 
       11 
10 
     | 
    
         
             
            	autoload :Callable, "phlex/callable"
         
     | 
| 
       12 
11 
     | 
    
         
             
            	autoload :Context, "phlex/context"
         
     | 
| 
       13 
     | 
    
         
            -
            	autoload : 
     | 
| 
       14 
     | 
    
         
            -
            	autoload :ElementClobberingGuard, "phlex/element_clobbering_guard"
         
     | 
| 
      
 12 
     | 
    
         
            +
            	autoload :DoubleRenderError, "phlex/errors/double_render_error"
         
     | 
| 
       15 
13 
     | 
    
         
             
            	autoload :Elements, "phlex/elements"
         
     | 
| 
       16 
14 
     | 
    
         
             
            	autoload :Error, "phlex/error"
         
     | 
| 
       17 
15 
     | 
    
         
             
            	autoload :FIFO, "phlex/fifo"
         
     | 
| 
         @@ -24,7 +22,6 @@ module Phlex 
     | 
|
| 
       24 
22 
     | 
    
         | 
| 
       25 
23 
     | 
    
         
             
            	Escape = ERB::Escape
         
     | 
| 
       26 
24 
     | 
    
         
             
            	ATTRIBUTE_CACHE = FIFO.new
         
     | 
| 
       27 
     | 
    
         
            -
            	SUPPORTS_FIBER_STORAGE = RUBY_ENGINE == "ruby"
         
     | 
| 
       28 
25 
     | 
    
         
             
            	Null = Object.new.freeze
         
     | 
| 
       29 
26 
     | 
    
         | 
| 
       30 
27 
     | 
    
         
             
            	CACHED_FILES = Set.new
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: phlex
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2.0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.0.rc1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Joel Drapper
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-11-26 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: A high-performance view framework optimised for fun.
         
     | 
| 
       14 
14 
     | 
    
         
             
            email:
         
     | 
| 
         @@ -20,12 +20,8 @@ files: 
     | 
|
| 
       20 
20 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       21 
21 
     | 
    
         
             
            - README.md
         
     | 
| 
       22 
22 
     | 
    
         
             
            - lib/phlex.rb
         
     | 
| 
       23 
     | 
    
         
            -
            - lib/phlex/black_hole.rb
         
     | 
| 
       24 
23 
     | 
    
         
             
            - lib/phlex/context.rb
         
     | 
| 
       25 
24 
     | 
    
         
             
            - lib/phlex/csv.rb
         
     | 
| 
       26 
     | 
    
         
            -
            - lib/phlex/deferred_render.rb
         
     | 
| 
       27 
     | 
    
         
            -
            - lib/phlex/element_clobbering_guard.rb
         
     | 
| 
       28 
     | 
    
         
            -
            - lib/phlex/elements.rb
         
     | 
| 
       29 
25 
     | 
    
         
             
            - lib/phlex/error.rb
         
     | 
| 
       30 
26 
     | 
    
         
             
            - lib/phlex/errors/argument_error.rb
         
     | 
| 
       31 
27 
     | 
    
         
             
            - lib/phlex/errors/double_render_error.rb
         
     | 
| 
         @@ -37,6 +33,7 @@ files: 
     | 
|
| 
       37 
33 
     | 
    
         
             
            - lib/phlex/html/void_elements.rb
         
     | 
| 
       38 
34 
     | 
    
         
             
            - lib/phlex/kit.rb
         
     | 
| 
       39 
35 
     | 
    
         
             
            - lib/phlex/sgml.rb
         
     | 
| 
      
 36 
     | 
    
         
            +
            - lib/phlex/sgml/elements.rb
         
     | 
| 
       40 
37 
     | 
    
         
             
            - lib/phlex/sgml/safe_object.rb
         
     | 
| 
       41 
38 
     | 
    
         
             
            - lib/phlex/sgml/safe_value.rb
         
     | 
| 
       42 
39 
     | 
    
         
             
            - lib/phlex/svg.rb
         
     | 
| 
         @@ -46,6 +43,7 @@ files: 
     | 
|
| 
       46 
43 
     | 
    
         
             
            - lib/phlex/testing/nokogiri.rb
         
     | 
| 
       47 
44 
     | 
    
         
             
            - lib/phlex/testing/nokolexbor.rb
         
     | 
| 
       48 
45 
     | 
    
         
             
            - lib/phlex/testing/sgml.rb
         
     | 
| 
      
 46 
     | 
    
         
            +
            - lib/phlex/vanish.rb
         
     | 
| 
       49 
47 
     | 
    
         
             
            - lib/phlex/version.rb
         
     | 
| 
       50 
48 
     | 
    
         
             
            homepage: https://www.phlex.fun
         
     | 
| 
       51 
49 
     | 
    
         
             
            licenses:
         
     | 
| 
         @@ -64,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       64 
62 
     | 
    
         
             
              requirements:
         
     | 
| 
       65 
63 
     | 
    
         
             
              - - ">="
         
     | 
| 
       66 
64 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       67 
     | 
    
         
            -
                  version: 3. 
     | 
| 
      
 65 
     | 
    
         
            +
                  version: '3.2'
         
     | 
| 
       68 
66 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       69 
67 
     | 
    
         
             
              requirements:
         
     | 
| 
       70 
68 
     | 
    
         
             
              - - ">="
         
     | 
| 
         @@ -1,29 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # frozen_string_literal: true
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            # Include this module into an {HTML} or {SVG} component to make it yield the content block before calling {#template}.
         
     | 
| 
       4 
     | 
    
         
            -
            # @example
         
     | 
| 
       5 
     | 
    
         
            -
            # 	class Tabs < Phlex::HTML
         
     | 
| 
       6 
     | 
    
         
            -
            # 		include DeferredRender
         
     | 
| 
       7 
     | 
    
         
            -
            #
         
     | 
| 
       8 
     | 
    
         
            -
            # 		Tab = Data.define(:name, :content)
         
     | 
| 
       9 
     | 
    
         
            -
            #
         
     | 
| 
       10 
     | 
    
         
            -
            # 		def initialize
         
     | 
| 
       11 
     | 
    
         
            -
            # 			@tabs = []
         
     | 
| 
       12 
     | 
    
         
            -
            # 		end
         
     | 
| 
       13 
     | 
    
         
            -
            #
         
     | 
| 
       14 
     | 
    
         
            -
            # 		def view_template
         
     | 
| 
       15 
     | 
    
         
            -
            # 			@tabs.each { |t| a { t.name } }
         
     | 
| 
       16 
     | 
    
         
            -
            # 			@tabs.each { |t| article(&t.content) }
         
     | 
| 
       17 
     | 
    
         
            -
            # 		end
         
     | 
| 
       18 
     | 
    
         
            -
            #
         
     | 
| 
       19 
     | 
    
         
            -
            # 		def tab(name, &content)
         
     | 
| 
       20 
     | 
    
         
            -
            # 			@tabs << Tab.new(name, content)
         
     | 
| 
       21 
     | 
    
         
            -
            # 		end
         
     | 
| 
       22 
     | 
    
         
            -
            # 	end
         
     | 
| 
       23 
     | 
    
         
            -
            module Phlex::DeferredRender
         
     | 
| 
       24 
     | 
    
         
            -
            	# This module doesn't do anything. Phlex::HTML#call checks for its inclusion in the ancestry instead.
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
            	# @!method template
         
     | 
| 
       27 
     | 
    
         
            -
            	# @abstract Override to define your own template.
         
     | 
| 
       28 
     | 
    
         
            -
            	# @note {DeferredRender} templates do not receive the content block. Instead, it is yielded in advance.
         
     | 
| 
       29 
     | 
    
         
            -
            end
         
     | 
| 
         @@ -1,16 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # frozen_string_literal: true
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            # @api private
         
     | 
| 
       4 
     | 
    
         
            -
            module Phlex::ElementClobberingGuard
         
     | 
| 
       5 
     | 
    
         
            -
            	def method_added(method_name)
         
     | 
| 
       6 
     | 
    
         
            -
            		if method_name[0] == "_" && __element_method__?(method_name[1..].to_sym)
         
     | 
| 
       7 
     | 
    
         
            -
            			raise Phlex::NameError.new("👋 Redefining the method `#{name}##{method_name}` is not a good idea.")
         
     | 
| 
       8 
     | 
    
         
            -
            		elsif method_name == :view_template
         
     | 
| 
       9 
     | 
    
         
            -
            			Phlex.__expand_attribute_cache__(
         
     | 
| 
       10 
     | 
    
         
            -
            				instance_method(method_name).source_location[0],
         
     | 
| 
       11 
     | 
    
         
            -
            			)
         
     | 
| 
       12 
     | 
    
         
            -
            		else
         
     | 
| 
       13 
     | 
    
         
            -
            			super
         
     | 
| 
       14 
     | 
    
         
            -
            		end
         
     | 
| 
       15 
     | 
    
         
            -
            	end
         
     | 
| 
       16 
     | 
    
         
            -
            end
         
     |