rux-rails 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eab4f715bf1a690c2203a58abb43387cbf9069a351448c29d19fae7eca71e4e
4
- data.tar.gz: 569d1715c3649eec7809864fe76e29d7094eddea038618d25da220b307940d83
3
+ metadata.gz: 69a808afcb08d05209e5e4c8a759bf96524ec8f2580647ac216332a585271fac
4
+ data.tar.gz: bce97762fcd5076e2a572661aedc2a02424fdabf804f1d869d8a7156acc73c0a
5
5
  SHA512:
6
- metadata.gz: 5eff94f3b29f81201639657faf5f765f61a16d35df439b53cf3bb2bad0025634fbae5aa2fcb32ecdf2fbaafd94d6a183941c16e501847fdc81e343194eef5077
7
- data.tar.gz: 92d3fec8830c2de5c7ad41b0fd011f8c6d550a855f9e8eaa47a00aaf585944f163933b6a5c6d971ff5e37fd9dbc44ae62cf320f64c0db803d7c419d9e886a29a
6
+ metadata.gz: 73031ea1107540cf63e5834a8b7cdb46e7470d49832cc45b4b86f51edbd5a29611bb120b8f6cefa35505a6c2e2173c08cab1b6996fc2e3d7b435f58d37c66daa
7
+ data.tar.gz: b3a6049fbbfd8972a9c09dd445193da594f23080d0b0b121bf2b795c0683dac64eb248eaa22de6278543479d08d5d7b42eac84984a72e77c6de628ae5cfc386a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.3.0
2
+ * Add support for view_component v3.0.
3
+
4
+ ## 1.2.2
5
+ * Fix calling private Zeitwerk method.
6
+ * Check railties version in dummy app instead of rails.
7
+
1
8
  ## 1.2.1
2
9
  * Support newer versions of Zeitwerk (2.5 and beyond).
3
10
  * Support Rails 7.
data/Gemfile CHANGED
@@ -15,4 +15,5 @@ end
15
15
 
16
16
  group :test do
17
17
  gem 'rspec-rails'
18
+ gem 'capybara', '~> 3.0'
18
19
  end
data/Rakefile CHANGED
@@ -2,6 +2,8 @@ require 'bundler'
2
2
  require 'rspec/core/rake_task'
3
3
  require 'rubygems/package_task'
4
4
 
5
+ require 'rux-rails'
6
+
5
7
  Bundler::GemHelper.install_tasks
6
8
 
7
9
  task default: :spec
@@ -14,7 +14,7 @@ module Kernel
14
14
  # an uninitialized constant, and it's like... yeah, I _know_ it's
15
15
  # uninitialized, that's why I'm loading this file. Whatevs.
16
16
  loader = Zeitwerk::Registry.loader_for(file)
17
- parent, cname = loader.autoloads[file]
17
+ parent, cname = loader.send(:autoloads)[file]
18
18
  parent.send(:remove_const, cname)
19
19
 
20
20
  return rux_orig_load(tmpl.default_outfile, *args)
@@ -1,5 +1,8 @@
1
1
  require 'rails/railtie'
2
2
 
3
+ require 'active_support'
4
+ require 'active_support/isolated_execution_state' if ActiveSupport::VERSION::MAJOR > 6
5
+
3
6
  module RuxRails
4
7
  class Railtie < Rails::Railtie
5
8
  config.rux = ActiveSupport::OrderedOptions.new
@@ -1,3 +1,3 @@
1
1
  module RuxRails
2
- VERSION = '1.2.1'
2
+ VERSION = '1.3.0'
3
3
  end
data/lib/rux-rails.rb CHANGED
@@ -28,6 +28,9 @@ end
28
28
 
29
29
  require 'rux'
30
30
  require 'rux-rails/railtie'
31
+
32
+ # require both of these to support multiple versions of view_component
33
+ require 'view_component'
31
34
  require 'view_component/engine'
32
35
 
33
36
  ViewComponent::Base.send(:include, RuxRails::Components)
data/rux-rails.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.add_dependency 'rux', '~> 1.0'
14
14
  s.add_dependency 'railties', '>= 5.0'
15
- s.add_dependency 'view_component', '~> 2.0'
15
+ s.add_dependency 'view_component', '>= 2', '< 4'
16
16
 
17
17
  s.require_path = 'lib'
18
18
 
@@ -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,7 +2,7 @@ module RuxRails
2
2
  class DummyApplication < ::Rails::Application
3
3
  if config.respond_to?(:load_defaults)
4
4
  config.load_defaults(
5
- Gem.loaded_specs['rails'].version.to_s.split('.')[0..1].join('.')
5
+ Gem.loaded_specs['railties'].version.to_s.split('.')[0..1].join('.')
6
6
  )
7
7
  end
8
8
 
@@ -146,3 +146,50 @@ Processing by HomeController#index as HTML
146
146
  Rendered home/index.html.ruxt within layouts/application (Duration: 73.8ms | Allocations: 49092)
147
147
  Rendered layout layouts/application.html.erb (Duration: 74.2ms | Allocations: 49322)
148
148
  Completed 200 OK in 88ms (Views: 81.1ms | Allocations: 56373)
149
+ Started GET "/" for 127.0.0.1 at 2023-04-25 14:13:28 -0700
150
+ Processing by HomeController#index as HTML
151
+ Rendering layout layouts/application.html.erb
152
+ Rendering home/index.html.ruxt within layouts/application
153
+ Rendered home/index.html.ruxt within layouts/application (Duration: 97.3ms | Allocations: 43182)
154
+ Rendered layout layouts/application.html.erb (Duration: 97.8ms | Allocations: 43413)
155
+ Completed 200 OK in 111ms (Views: 104.7ms | Allocations: 48899)
156
+ Started GET "/" for 127.0.0.1 at 2023-04-25 14:22:51 -0700
157
+ Processing by HomeController#index as HTML
158
+ Rendering layout layouts/application.html.erb
159
+ Rendering home/index.html.ruxt within layouts/application
160
+ Rendered home/index.html.ruxt within layouts/application (Duration: 77.5ms | Allocations: 43481)
161
+ Rendered layout layouts/application.html.erb (Duration: 78.0ms | Allocations: 43712)
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)
data/spec/spec_helper.rb CHANGED
@@ -22,4 +22,5 @@ end
22
22
 
23
23
  RSpec.configure do |config|
24
24
  config.include(SpecHelpers)
25
+ config.include(Capybara::RSpecMatchers, type: :request)
25
26
  end
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.2.1
4
+ version: 1.3.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: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2023-05-29 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: '2.0'
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: '2.0'
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.2.22
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: []