phlexible 1.0.0 → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf3f2d54135dc708dc50f837b8dc9011c56e180aab472d58f47b8381289ea166
4
- data.tar.gz: 7d01c32e4597aaa907b3bbae4482b54e14166562f239430679a8073a405f0ecd
3
+ metadata.gz: 25f83dab70f4f2888bbc3fb5f4ed31a2f66763bd78e8964bd5ebc9348db05049
4
+ data.tar.gz: 9f77535094aef1d3ef05d60c3f6706cbd4e01ed8b487dadbcc3e922fb40d4a67
5
5
  SHA512:
6
- metadata.gz: 165a9a1d766643dc7957d5c52a5eb91d6d97e48d634effc8f2a3e877536dfb6f95ebd8948c47924d4a637bda6c81618975c5831e252098661ad5478184973c65
7
- data.tar.gz: ba5c5b1f6b433b0e93af5e35b954706f9cb93f43cfee5280776b7475b56048142d14507cc50f4cf2ca39c86d024000c246ac5f3d8a94b6e9a24ff1dffaabb5b1
6
+ metadata.gz: 828998464742292c483795a080490b80984feea916f7e1feacdbcdb5c0edb16af90f2c03f552538862c7eda083557051c6a5528f36b85c0812d417139c92b5ed
7
+ data.tar.gz: 54eafd9c6b556d6bbe36d6968fd3817e54ef89c2bff98efeeee6adaa04079cc4b832328677b89d391068bb8636b139dc8c1128db26fe41bdeeae8f00e7f1b3ef
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- phlexible (1.0.0)
5
- phlex (>= 1.8.1)
6
- phlex-rails (>= 1.0.0)
4
+ phlexible (2.0.0)
5
+ phlex (>= 1.10.0, < 2.0.0)
6
+ phlex-rails (>= 1.2.1, < 2.0.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (7.1.3)
12
- actionview (= 7.1.3)
13
- activesupport (= 7.1.3)
11
+ actionpack (7.1.3.2)
12
+ actionview (= 7.1.3.2)
13
+ activesupport (= 7.1.3.2)
14
14
  nokogiri (>= 1.8.5)
15
15
  racc
16
16
  rack (>= 2.2.4)
@@ -18,13 +18,13 @@ GEM
18
18
  rack-test (>= 0.6.3)
19
19
  rails-dom-testing (~> 2.2)
20
20
  rails-html-sanitizer (~> 1.6)
21
- actionview (7.1.3)
22
- activesupport (= 7.1.3)
21
+ actionview (7.1.3.2)
22
+ activesupport (= 7.1.3.2)
23
23
  builder (~> 3.1)
24
24
  erubi (~> 1.11)
25
25
  rails-dom-testing (~> 2.2)
26
26
  rails-html-sanitizer (~> 1.6)
27
- activesupport (7.1.3)
27
+ activesupport (7.1.3.2)
28
28
  base64
29
29
  bigdecimal
30
30
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -36,9 +36,8 @@ GEM
36
36
  tzinfo (~> 2.0)
37
37
  ast (2.4.2)
38
38
  base64 (0.2.0)
39
- bigdecimal (3.1.6)
39
+ bigdecimal (3.1.7)
40
40
  builder (3.2.4)
41
- cgi (0.4.1)
42
41
  combustion (1.4.0)
43
42
  activesupport (>= 3.0.0)
44
43
  railties (>= 3.0.0)
@@ -46,49 +45,42 @@ GEM
46
45
  concurrent-ruby (1.2.3)
47
46
  connection_pool (2.4.1)
48
47
  crass (1.0.6)
49
- drb (2.2.0)
50
- ruby2_keywords
51
- erb (4.0.4)
52
- cgi (>= 0.3.3)
48
+ drb (2.2.1)
53
49
  erubi (1.12.0)
54
- i18n (1.14.1)
50
+ i18n (1.14.4)
55
51
  concurrent-ruby (~> 1.0)
56
52
  io-console (0.7.2)
57
- irb (1.11.2)
53
+ irb (1.12.0)
58
54
  rdoc
59
55
  reline (>= 0.4.2)
60
- json (2.7.1)
56
+ json (2.7.2)
61
57
  language_server-protocol (3.17.0.3)
62
58
  loofah (2.22.0)
63
59
  crass (~> 1.0.2)
64
60
  nokogiri (>= 1.12.0)
65
- minitest (5.22.2)
61
+ minitest (5.22.3)
66
62
  mutex_m (0.2.0)
67
- nokogiri (1.16.2-arm64-darwin)
63
+ nokogiri (1.16.4-arm64-darwin)
68
64
  racc (~> 1.4)
69
- nokogiri (1.16.2-x86_64-darwin)
65
+ nokogiri (1.16.4-x86_64-darwin)
70
66
  racc (~> 1.4)
71
- nokogiri (1.16.2-x86_64-linux)
67
+ nokogiri (1.16.4-x86_64-linux)
72
68
  racc (~> 1.4)
73
69
  parallel (1.24.0)
74
70
  parser (3.3.0.5)
75
71
  ast (~> 2.4.1)
76
72
  racc
77
- phlex (1.9.0)
78
- concurrent-ruby (~> 1.2)
79
- erb (>= 4)
80
- zeitwerk (~> 2.6)
81
- phlex-rails (1.1.1)
82
- phlex (~> 1.9)
73
+ phlex (1.10.0)
74
+ phlex-rails (1.2.1)
75
+ phlex (~> 1.10.0)
83
76
  railties (>= 6.1, < 8)
84
- zeitwerk (~> 2.6)
85
77
  phlex-testing-nokogiri (0.1.0)
86
78
  nokogiri (~> 1.13)
87
79
  phlex (>= 0.5)
88
80
  psych (5.1.2)
89
81
  stringio
90
82
  racc (1.7.3)
91
- rack (3.0.9)
83
+ rack (3.0.10)
92
84
  rack-session (2.0.0)
93
85
  rack (>= 3.0.0)
94
86
  rack-test (2.1.0)
@@ -103,23 +95,23 @@ GEM
103
95
  rails-html-sanitizer (1.6.0)
104
96
  loofah (~> 2.21)
105
97
  nokogiri (~> 1.14)
106
- railties (7.1.3)
107
- actionpack (= 7.1.3)
108
- activesupport (= 7.1.3)
98
+ railties (7.1.3.2)
99
+ actionpack (= 7.1.3.2)
100
+ activesupport (= 7.1.3.2)
109
101
  irb
110
102
  rackup (>= 1.0.0)
111
103
  rake (>= 12.2)
112
104
  thor (~> 1.0, >= 1.2.2)
113
105
  zeitwerk (~> 2.6)
114
106
  rainbow (3.1.1)
115
- rake (13.1.0)
116
- rdoc (6.6.2)
107
+ rake (13.2.1)
108
+ rdoc (6.6.3.1)
117
109
  psych (>= 4.0.0)
118
110
  regexp_parser (2.9.0)
119
- reline (0.4.2)
111
+ reline (0.5.1)
120
112
  io-console (~> 0.5)
121
113
  rexml (3.2.6)
122
- rubocop (1.60.2)
114
+ rubocop (1.63.1)
123
115
  json (~> 2.3)
124
116
  language_server-protocol (>= 3.17.0)
125
117
  parallel (~> 1.10)
@@ -127,16 +119,15 @@ GEM
127
119
  rainbow (>= 2.2.2, < 4.0)
128
120
  regexp_parser (>= 1.8, < 3.0)
129
121
  rexml (>= 3.2.5, < 4.0)
130
- rubocop-ast (>= 1.30.0, < 2.0)
122
+ rubocop-ast (>= 1.31.1, < 2.0)
131
123
  ruby-progressbar (~> 1.7)
132
124
  unicode-display_width (>= 2.4.0, < 3.0)
133
- rubocop-ast (1.30.0)
134
- parser (>= 3.2.1.0)
125
+ rubocop-ast (1.31.2)
126
+ parser (>= 3.3.0.4)
135
127
  ruby-progressbar (1.13.0)
136
- ruby2_keywords (0.0.5)
137
128
  stringio (3.1.0)
138
129
  sus (0.24.6)
139
- thor (1.3.0)
130
+ thor (1.3.1)
140
131
  tzinfo (2.0.6)
141
132
  concurrent-ruby (~> 1.0)
142
133
  unicode-display_width (2.5.0)
data/README.md CHANGED
@@ -50,7 +50,7 @@ class Views::Users::Index < Views::Base
50
50
 
51
51
  controller_variable :first_name, :last_name
52
52
 
53
- def template
53
+ def view_template
54
54
  h1 { "#{@first_name} #{@last_name}" }
55
55
  end
56
56
  end
@@ -73,7 +73,7 @@ class Views::Users::Index < Views::Base
73
73
 
74
74
  controller_variable last_name: :surname, first_name: { as: :given_name, allow_undefined: true }
75
75
 
76
- def template
76
+ def view_template
77
77
  h1 { "#{@given_name} #{@surname}" }
78
78
  end
79
79
  end
@@ -128,7 +128,7 @@ end
128
128
  class MyView < Phlex::HTML
129
129
  include Phlexible::Rails::AElement
130
130
 
131
- def template
131
+ def view_template
132
132
  a(href: :articles) { 'View articles' }
133
133
  end
134
134
  end
@@ -165,7 +165,6 @@ Phlexible::Rails::ButtonTo.new(:root, method: :patch) { 'My Button' }
165
165
 
166
166
  > Available in **>= 1.0.0**
167
167
 
168
-
169
168
  A super simple way to define and render meta tags in your Phlex views. Just render the
170
169
  `Phlexible::Rails::MetaTagsComponent` component in the head element of your page, and define the
171
170
  meta tags using the `meta_tag` method in your controllers.
@@ -179,7 +178,7 @@ end
179
178
 
180
179
  ```ruby
181
180
  class MyView < Phlex::HTML
182
- def template
181
+ def view_template
183
182
  html do
184
183
  head do
185
184
  render Phlexible::Rails::MetaTagsComponent
@@ -200,7 +199,7 @@ So instead of:
200
199
 
201
200
  ```ruby
202
201
  class MyView < Phlex::HTML
203
- def template
202
+ def view_template
204
203
  div do
205
204
  render My::Awesome::Component.new
206
205
  end
@@ -216,7 +215,7 @@ class MyView < Phlex::HTML
216
215
 
217
216
  alias_view :awesome, -> { My::Awesome::Component }
218
217
 
219
- def template
218
+ def view_template
220
219
  div do
221
220
  awesome
222
221
  end
@@ -3,7 +3,7 @@
3
3
  class Views::Articles::Link < Phlex::HTML
4
4
  include Phlexible::Rails::AElement
5
5
 
6
- def template
6
+ def view_template
7
7
  a(href: :root, class: :foo) { 'A link to root' }
8
8
  end
9
9
  end
@@ -3,5 +3,5 @@
3
3
  class Views::Articles::Show < Phlex::HTML
4
4
  include Phlexible::Rails::ControllerVariables
5
5
 
6
- def template; end
6
+ def view_template; end
7
7
  end
@@ -7,7 +7,7 @@ module Phlexible
7
7
  # So instead of:
8
8
  #
9
9
  # class MyView < Phlex::HTML
10
- # def template
10
+ # def view_template
11
11
  # div do
12
12
  # render My::Awesome::Component.new
13
13
  # end
@@ -21,7 +21,7 @@ module Phlexible
21
21
  #
22
22
  # alias_view :awesome, -> { My::Awesome::Component }
23
23
  #
24
- # def template
24
+ # def view_template
25
25
  # div do
26
26
  # awesome
27
27
  # end
@@ -24,7 +24,7 @@ module Phlexible
24
24
  @options = options
25
25
  end
26
26
 
27
- def template(&block) # rubocop:disable Metrics/AbcSize
27
+ def view_template(&block) # rubocop:disable Metrics/AbcSize
28
28
  action = helpers.url_for(@url)
29
29
  @options = DEFAULT_OPTIONS.merge((@options || {}).symbolize_keys)
30
30
 
@@ -9,7 +9,7 @@
9
9
  # class Views::Users::Index < Views::Base
10
10
  # controller_variable :user_name
11
11
  #
12
- # def template
12
+ # def view_template
13
13
  # h1 { @user_name }
14
14
  # end
15
15
  # end
@@ -31,8 +31,8 @@ module Phlexible
31
31
  class UndefinedVariable < NameError
32
32
  def initialize(name)
33
33
  @variable_name = name
34
- super "Attempted to expose controller variable `#{@variable_name}`, but instance " \
35
- 'variable is not defined in the controller.'
34
+ super("Attempted to expose controller variable `#{@variable_name}`, but instance " \
35
+ 'variable is not defined in the controller.')
36
36
  end
37
37
  end
38
38
 
@@ -3,7 +3,7 @@
3
3
  module Phlexible
4
4
  module Rails
5
5
  class MetaTagsComponent < Phlex::HTML
6
- def template
6
+ def view_template
7
7
  helpers.controller.view_assigns['meta_tags']&.each do |name, content|
8
8
  meta name: name, content: content.is_a?(String) ? content : content.to_json
9
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Phlexible
4
- VERSION = '1.0.0'
4
+ VERSION = '2.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexible
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-21 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex
@@ -16,28 +16,40 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.1
19
+ version: 1.10.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: 1.8.1
29
+ version: 1.10.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: phlex-rails
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: 1.0.0
39
+ version: 1.2.1
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: 2.0.0
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
47
  - - ">="
39
48
  - !ruby/object:Gem::Version
40
- version: 1.0.0
49
+ version: 1.2.1
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: 2.0.0
41
53
  description: A bunch of helpers and goodies intended to make life with Phlex even
42
54
  easier!
43
55
  email:
@@ -101,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
113
  - !ruby/object:Gem::Version
102
114
  version: '0'
103
115
  requirements: []
104
- rubygems_version: 3.5.5
116
+ rubygems_version: 3.5.7
105
117
  signing_key:
106
118
  specification_version: 4
107
119
  summary: A bunch of helpers and goodies intended to make life with Phlex even easier!