phlex 2.3.0 → 2.4.0.beta1

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.
data/lib/phlex.rb CHANGED
@@ -6,6 +6,8 @@ require "zeitwerk"
6
6
 
7
7
  module Phlex
8
8
  Loader = Zeitwerk::Loader.for_gem.tap do |loader|
9
+ loader.ignore("#{__dir__}/ruby_lsp")
10
+
9
11
  loader.inflector.inflect(
10
12
  "csv" => "CSV",
11
13
  "fifo" => "FIFO",
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ruby_lsp/addon"
4
+
5
+ module RubyLsp
6
+ module Phlex
7
+ class Addon < ::RubyLsp::Addon
8
+ def activate(global_state, message_queue)
9
+ end
10
+
11
+ def deactivate
12
+ end
13
+
14
+ def name
15
+ "Phlex"
16
+ end
17
+
18
+ def version
19
+ "0.1.0"
20
+ end
21
+ end
22
+
23
+ class IndexingEnhancement < RubyIndexer::Enhancement
24
+ def on_call_node_enter(node)
25
+ name = node.name
26
+ owner = @listener.current_owner
27
+ location = node.location
28
+ arguments = node.arguments&.arguments
29
+
30
+ return unless owner
31
+ return unless :register_element == name
32
+
33
+ case arguments
34
+ in [Prism::SymbolNode[unescaped: String => method_name], *]
35
+ tag_name = method_name.tr("_", "-")
36
+ arguments[1] in Prism::StringNode[unescaped: String => tag_name]
37
+
38
+ @listener.add_method(method_name, location, [
39
+ RubyIndexer::Entry::Signature.new([
40
+ RubyIndexer::Entry::KeywordRestParameter.new(name: :attributes),
41
+ RubyIndexer::Entry::BlockParameter.new(name: :content),
42
+ ]),
43
+ ], visibility: :public, comments: "Outputs a `<#{tag_name}>` tag.")
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
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.3.0
4
+ version: 2.4.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Drapper
8
8
  - Will Cosgrove
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-08 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: refract
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
27
41
  description: Build HTML, SVG and CSV views with Ruby classes.
28
42
  email:
29
43
  - joel@drapper.me
@@ -34,6 +48,11 @@ files:
34
48
  - LICENSE.txt
35
49
  - README.md
36
50
  - lib/phlex.rb
51
+ - lib/phlex/compiler.rb
52
+ - lib/phlex/compiler/class_compiler.rb
53
+ - lib/phlex/compiler/compilation.rb
54
+ - lib/phlex/compiler/file_compiler.rb
55
+ - lib/phlex/compiler/method_compiler.rb
37
56
  - lib/phlex/csv.rb
38
57
  - lib/phlex/error.rb
39
58
  - lib/phlex/errors/argument_error.rb
@@ -48,6 +67,7 @@ files:
48
67
  - lib/phlex/html/void_elements.rb
49
68
  - lib/phlex/kit.rb
50
69
  - lib/phlex/sgml.rb
70
+ - lib/phlex/sgml/attributes.rb
51
71
  - lib/phlex/sgml/elements.rb
52
72
  - lib/phlex/sgml/safe_object.rb
53
73
  - lib/phlex/sgml/safe_value.rb
@@ -55,6 +75,7 @@ files:
55
75
  - lib/phlex/svg.rb
56
76
  - lib/phlex/svg/standard_elements.rb
57
77
  - lib/phlex/version.rb
78
+ - lib/ruby_lsp/phlex/addon.rb
58
79
  homepage: https://www.phlex.fun
59
80
  licenses:
60
81
  - MIT
@@ -78,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
99
  - !ruby/object:Gem::Version
79
100
  version: '0'
80
101
  requirements: []
81
- rubygems_version: 3.6.6
102
+ rubygems_version: 3.6.7
82
103
  specification_version: 4
83
104
  summary: Object-oriented views in Ruby.
84
105
  test_files: []