rux-rails 1.2.2 → 1.4.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +4 -0
- data/lib/rux-rails/railtie.rb +22 -20
- data/lib/rux-rails/version.rb +1 -1
- data/lib/rux-rails.rb +3 -0
- data/rux-rails.gemspec +1 -1
- data/spec/controllers/home_controller_spec.rb +4 -0
- data/spec/dummy/app/components/home_component.rb +1 -4
- data/spec/dummy/log/test.log +57 -0
- data/spec/spec_helper.rb +1 -0
- metadata +16 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80c3381d7ae7854540067cd7267c5636961a7b30a538fad7c5fd063c5cb12a64
|
4
|
+
data.tar.gz: c4234d93e5b93109b612a5249f06b065cc53157999246cc04f12aea1bdc98cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b61ed880646e3a058c4bd525f6f7fe9e308fe066f40d76c53ea312a5c604874eb321405f9d41f3a026221df3a83b3049356c1146f897ca7c9c4cf96b5274443
|
7
|
+
data.tar.gz: 6aa7c072623ab565de33479b0428c096412377f9cf020c0c91751cf9b80e2f21fad1c2f8500a95b2b67dd5450a985ef8a5d0162ac72978d6cd1de04d706b64dc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 1.4.0
|
2
|
+
* Make rux-rails safe to load in production.
|
3
|
+
- All the monkeypatches to `Kernel`, etc are now only loaded if `config.rux.transpile` is `true`.
|
4
|
+
|
5
|
+
## 1.3.0
|
6
|
+
* Add support for view_component v3.0.
|
7
|
+
|
1
8
|
## 1.2.2
|
2
9
|
* Fix calling private Zeitwerk method.
|
3
10
|
* Check railties version in dummy app instead of rails.
|
data/Gemfile
CHANGED
data/lib/rux-rails/railtie.rb
CHANGED
@@ -8,35 +8,37 @@ module RuxRails
|
|
8
8
|
config.rux = ActiveSupport::OrderedOptions.new
|
9
9
|
|
10
10
|
initializer 'rux-rails.initialize', before: :set_autoload_paths do |app|
|
11
|
-
if
|
12
|
-
|
13
|
-
|
11
|
+
if config.rux.transpile.nil? && (Rails.env.development? || Rails.env.test?)
|
12
|
+
config.rux.transpile = true
|
13
|
+
end
|
14
|
+
|
15
|
+
RuxRails.transpile_on_load = -> () { config.rux.transpile }
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
if config.rux.transpile
|
18
|
+
if Rails.respond_to?(:autoloaders) && Rails.autoloaders.zeitwerk_enabled?
|
19
|
+
require 'rux-rails/core_ext/kernel_zeitwerk'
|
20
|
+
require 'rux-rails/ext/zeitwerk/loader'
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
+
RuxRails.zeitwerk_mode = true
|
23
|
+
else
|
24
|
+
require 'rux-rails/core_ext/kernel'
|
25
|
+
require 'rux-rails/ext/activesupport/dependencies'
|
26
|
+
|
27
|
+
RuxRails.zeitwerk_mode = false
|
28
|
+
end
|
22
29
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
30
|
+
begin
|
31
|
+
require 'bootsnap'
|
32
|
+
rescue LoadError
|
33
|
+
else
|
34
|
+
require 'rux-rails/ext/bootsnap/autoload'
|
35
|
+
end
|
28
36
|
end
|
29
37
|
|
30
38
|
ActionView::Template.register_template_handler(
|
31
39
|
:ruxt, RuxRails::TemplateHandler
|
32
40
|
)
|
33
41
|
|
34
|
-
if config.rux.transpile.nil? && (Rails.env.development? || Rails.env.test?)
|
35
|
-
config.rux.transpile = true
|
36
|
-
end
|
37
|
-
|
38
|
-
RuxRails.transpile_on_load = -> () { config.rux.transpile }
|
39
|
-
|
40
42
|
Rux.library_paths.each do |library_path|
|
41
43
|
app.config.eager_load_paths << library_path
|
42
44
|
app.config.autoload_paths << library_path
|
data/lib/rux-rails/version.rb
CHANGED
data/lib/rux-rails.rb
CHANGED
data/rux-rails.gemspec
CHANGED
@@ -4,7 +4,11 @@ describe HomeController, type: :request do
|
|
4
4
|
describe '#index' do
|
5
5
|
it 'works' do
|
6
6
|
get '/'
|
7
|
+
|
7
8
|
expect(response).to have_http_status(:ok)
|
9
|
+
expect(response.body).to(
|
10
|
+
have_selector("div.container img[src='/images/cat.png'] + button", text: "Click Me!")
|
11
|
+
)
|
8
12
|
end
|
9
13
|
end
|
10
14
|
end
|
@@ -2,13 +2,10 @@ class HomeComponent < ViewComponent::Base
|
|
2
2
|
def call
|
3
3
|
Rux.tag("div", { class: "container" }) {
|
4
4
|
Rux.create_buffer.tap { |_rux_buf_|
|
5
|
-
_rux_buf_ << " "
|
6
5
|
_rux_buf_ << render(Image.new(src: "cat.png", size: "40"))
|
7
|
-
_rux_buf_ << " "
|
8
6
|
_rux_buf_ << render(Button.new(outline: true, disabled: "true", size: :large)) {
|
9
|
-
"
|
7
|
+
"Click Me!"
|
10
8
|
}
|
11
|
-
_rux_buf_ << " "
|
12
9
|
}.to_s
|
13
10
|
}
|
14
11
|
end
|
data/spec/dummy/log/test.log
CHANGED
@@ -160,3 +160,60 @@ Processing by HomeController#index as HTML
|
|
160
160
|
Rendered home/index.html.ruxt within layouts/application (Duration: 77.5ms | Allocations: 43481)
|
161
161
|
Rendered layout layouts/application.html.erb (Duration: 78.0ms | Allocations: 43712)
|
162
162
|
Completed 200 OK in 89ms (Views: 83.2ms | Allocations: 49251)
|
163
|
+
Started GET "/" for 127.0.0.1 at 2023-05-28 13:52:10 -0700
|
164
|
+
Processing by HomeController#index as HTML
|
165
|
+
Rendering layout layouts/application.html.erb
|
166
|
+
Rendering home/index.html.ruxt within layouts/application
|
167
|
+
Rendered home/index.html.ruxt within layouts/application (Duration: 76.5ms | Allocations: 42477)
|
168
|
+
Rendered layout layouts/application.html.erb (Duration: 77.6ms | Allocations: 42711)
|
169
|
+
Completed 200 OK in 90ms (Views: 82.8ms | Allocations: 49992)
|
170
|
+
Started GET "/" for 127.0.0.1 at 2023-05-28 13:52:23 -0700
|
171
|
+
Processing by HomeController#index as HTML
|
172
|
+
Rendering layout layouts/application.html.erb
|
173
|
+
Rendering home/index.html.ruxt within layouts/application
|
174
|
+
Rendered home/index.html.ruxt within layouts/application (Duration: 71.3ms | Allocations: 42478)
|
175
|
+
Rendered layout layouts/application.html.erb (Duration: 71.8ms | Allocations: 42712)
|
176
|
+
Completed 200 OK in 87ms (Views: 78.2ms | Allocations: 49993)
|
177
|
+
Started GET "/" for 127.0.0.1 at 2023-05-28 13:54:28 -0700
|
178
|
+
Processing by HomeController#index as HTML
|
179
|
+
Rendering layout layouts/application.html.erb
|
180
|
+
Rendering home/index.html.ruxt within layouts/application
|
181
|
+
Rendered home/index.html.ruxt within layouts/application (Duration: 61.9ms | Allocations: 42478)
|
182
|
+
Rendered layout layouts/application.html.erb (Duration: 62.3ms | Allocations: 42712)
|
183
|
+
Completed 200 OK in 73ms (Views: 67.1ms | Allocations: 49993)
|
184
|
+
Started GET "/" for 127.0.0.1 at 2023-05-28 13:58:00 -0700
|
185
|
+
Processing by HomeController#index as HTML
|
186
|
+
Rendering layout layouts/application.html.erb
|
187
|
+
Rendering home/index.html.ruxt within layouts/application
|
188
|
+
Rendered home/index.html.ruxt within layouts/application (Duration: 113.6ms | Allocations: 43896)
|
189
|
+
Rendered layout layouts/application.html.erb (Duration: 114.4ms | Allocations: 44131)
|
190
|
+
Completed 200 OK in 128ms (Views: 120.0ms | Allocations: 51788)
|
191
|
+
Started GET "/" for 127.0.0.1 at 2023-05-28 14:27:01 -0700
|
192
|
+
Processing by HomeController#index as HTML
|
193
|
+
Rendering home/index.html.ruxt within layouts/application
|
194
|
+
Rendered home/index.html.ruxt within layouts/application (95.1ms)
|
195
|
+
Completed 200 OK in 106ms (Views: 105.4ms)
|
196
|
+
Started GET "/" for 127.0.0.1 at 2023-06-07 20:52:52 -0700
|
197
|
+
Processing by HomeController#index as HTML
|
198
|
+
Rendering home/index.html.ruxt within layouts/application
|
199
|
+
Rendered home/index.html.ruxt within layouts/application (88.7ms)
|
200
|
+
Completed 200 OK in 100ms (Views: 98.6ms)
|
201
|
+
Started GET "/" for 127.0.0.1 at 2023-06-07 20:52:58 -0700
|
202
|
+
Processing by HomeController#index as HTML
|
203
|
+
Rendering home/index.html.ruxt within layouts/application
|
204
|
+
Rendered home/index.html.ruxt within layouts/application (Duration: 75.5ms | Allocations: 45236)
|
205
|
+
Completed 200 OK in 88ms (Views: 82.7ms | Allocations: 52067)
|
206
|
+
Started GET "/" for 127.0.0.1 at 2023-06-07 20:53:04 -0700
|
207
|
+
Processing by HomeController#index as HTML
|
208
|
+
Rendering layout layouts/application.html.erb
|
209
|
+
Rendering home/index.html.ruxt within layouts/application
|
210
|
+
Rendered home/index.html.ruxt within layouts/application (Duration: 85.3ms | Allocations: 44654)
|
211
|
+
Rendered layout layouts/application.html.erb (Duration: 85.8ms | Allocations: 44800)
|
212
|
+
Completed 200 OK in 100ms (Views: 93.6ms | Allocations: 50960)
|
213
|
+
Started GET "/" for 127.0.0.1 at 2023-06-07 20:53:10 -0700
|
214
|
+
Processing by HomeController#index as HTML
|
215
|
+
Rendering layout layouts/application.html.erb
|
216
|
+
Rendering home/index.html.ruxt within layouts/application
|
217
|
+
Rendered home/index.html.ruxt within layouts/application (Duration: 84.7ms | Allocations: 44260)
|
218
|
+
Rendered layout layouts/application.html.erb (Duration: 85.3ms | Allocations: 44407)
|
219
|
+
Completed 200 OK in 108ms (Views: 94.0ms | Allocations: 52425)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rux-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rux
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: view_component
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2'
|
48
|
+
- - "<"
|
46
49
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
50
|
+
version: '4'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '2'
|
58
|
+
- - "<"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '4'
|
55
61
|
description: Rux view components on Rails.
|
56
62
|
email:
|
57
63
|
- camertron@gmail.com
|
@@ -101,7 +107,7 @@ files:
|
|
101
107
|
homepage: http://github.com/camertron/rux-rails
|
102
108
|
licenses: []
|
103
109
|
metadata: {}
|
104
|
-
post_install_message:
|
110
|
+
post_install_message:
|
105
111
|
rdoc_options: []
|
106
112
|
require_paths:
|
107
113
|
- lib
|
@@ -116,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
122
|
- !ruby/object:Gem::Version
|
117
123
|
version: '0'
|
118
124
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
120
|
-
signing_key:
|
125
|
+
rubygems_version: 3.1.6
|
126
|
+
signing_key:
|
121
127
|
specification_version: 4
|
122
128
|
summary: Rux view components on Rails.
|
123
129
|
test_files: []
|