futurism 1.2.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +160 -116
  3. data/Gemfile.lock~ +267 -0
  4. data/README.md +26 -0
  5. data/app/assets/javascripts/futurism.min.js.map +1 -1
  6. data/app/assets/javascripts/futurism.umd.min.js.map +1 -1
  7. data/futurism.gemspec +0 -3
  8. data/futurism.gemspec~ +1 -4
  9. data/lib/futurism/engine.rb +4 -0
  10. data/lib/futurism/helpers.rb +6 -6
  11. data/lib/futurism/message_verifier.rb +2 -2
  12. data/lib/futurism/options_transformer.rb +1 -1
  13. data/lib/futurism/resolver/controller/instrumentation.rb +33 -0
  14. data/lib/futurism/resolver/controller/renderer.rb +6 -2
  15. data/lib/futurism/resolver/resources.rb +3 -3
  16. data/lib/futurism/version.rb +1 -1
  17. data/lib/futurism.rb +11 -3
  18. data/package.json +1 -1
  19. data/package.json~ +2 -2
  20. data/yarn.lock +61 -21
  21. metadata +6 -94
  22. data/test/cable/channel_test.rb +0 -319
  23. data/test/dummy/app/channels/application_cable/channel.rb +0 -4
  24. data/test/dummy/app/channels/application_cable/connection.rb +0 -4
  25. data/test/dummy/app/controllers/application_controller.rb +0 -2
  26. data/test/dummy/app/controllers/home_controller.rb +0 -6
  27. data/test/dummy/app/controllers/posts_controller.rb +0 -59
  28. data/test/dummy/app/helpers/application_helper.rb +0 -2
  29. data/test/dummy/app/helpers/posts_helper.rb +0 -2
  30. data/test/dummy/app/jobs/application_job.rb +0 -7
  31. data/test/dummy/app/models/action_item.rb +0 -2
  32. data/test/dummy/app/models/application_record.rb +0 -3
  33. data/test/dummy/app/models/post.rb +0 -2
  34. data/test/dummy/config/application.rb +0 -29
  35. data/test/dummy/config/boot.rb +0 -5
  36. data/test/dummy/config/environment.rb +0 -5
  37. data/test/dummy/config/environments/development.rb +0 -40
  38. data/test/dummy/config/environments/production.rb +0 -94
  39. data/test/dummy/config/environments/test.rb +0 -39
  40. data/test/dummy/config/initializers/application_controller_renderer.rb +0 -8
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  42. data/test/dummy/config/initializers/content_security_policy.rb +0 -28
  43. data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
  44. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  45. data/test/dummy/config/initializers/inflections.rb +0 -16
  46. data/test/dummy/config/initializers/mime_types.rb +0 -4
  47. data/test/dummy/config/initializers/wrap_parameters.rb +0 -9
  48. data/test/dummy/config/puma.rb +0 -38
  49. data/test/dummy/config/routes.rb +0 -12
  50. data/test/dummy/config/spring.rb +0 -6
  51. data/test/dummy/db/migrate/20200711122838_create_posts.rb +0 -9
  52. data/test/dummy/db/migrate/2021042923813_create_action_items.rb +0 -9
  53. data/test/dummy/db/schema.rb +0 -27
  54. data/test/futurism_test.rb +0 -28
  55. data/test/helper/helper_test.rb +0 -206
  56. data/test/integration/navigation_test.rb +0 -7
  57. data/test/resolver/controller/renderer_test.rb +0 -120
  58. data/test/resolver/controller_test.rb +0 -26
  59. data/test/test_helper.rb +0 -14
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: futurism
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Rubisch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-14 00:00:00.000000000 Z
11
+ date: 2024-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '13.0'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.12.2
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.12.2
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: nokogiri
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +149,7 @@ files:
163
149
  - CHANGELOG.md
164
150
  - Gemfile
165
151
  - Gemfile.lock
152
+ - Gemfile.lock~
166
153
  - Gemfile~
167
154
  - MIT-LICENSE
168
155
  - README.md
@@ -188,6 +175,7 @@ files:
188
175
  - lib/futurism/message_verifier.rb
189
176
  - lib/futurism/options_transformer.rb
190
177
  - lib/futurism/resolver/controller.rb
178
+ - lib/futurism/resolver/controller/instrumentation.rb
191
179
  - lib/futurism/resolver/controller/renderer.rb
192
180
  - lib/futurism/resolver/resources.rb
193
181
  - lib/futurism/shims/deep_transform_values.rb
@@ -196,44 +184,6 @@ files:
196
184
  - package.json~
197
185
  - rollup.config.js
198
186
  - rollup.config.js~
199
- - test/cable/channel_test.rb
200
- - test/dummy/app/channels/application_cable/channel.rb
201
- - test/dummy/app/channels/application_cable/connection.rb
202
- - test/dummy/app/controllers/application_controller.rb
203
- - test/dummy/app/controllers/home_controller.rb
204
- - test/dummy/app/controllers/posts_controller.rb
205
- - test/dummy/app/helpers/application_helper.rb
206
- - test/dummy/app/helpers/posts_helper.rb
207
- - test/dummy/app/jobs/application_job.rb
208
- - test/dummy/app/models/action_item.rb
209
- - test/dummy/app/models/application_record.rb
210
- - test/dummy/app/models/post.rb
211
- - test/dummy/config/application.rb
212
- - test/dummy/config/boot.rb
213
- - test/dummy/config/environment.rb
214
- - test/dummy/config/environments/development.rb
215
- - test/dummy/config/environments/production.rb
216
- - test/dummy/config/environments/test.rb
217
- - test/dummy/config/initializers/application_controller_renderer.rb
218
- - test/dummy/config/initializers/backtrace_silencers.rb
219
- - test/dummy/config/initializers/content_security_policy.rb
220
- - test/dummy/config/initializers/cookies_serializer.rb
221
- - test/dummy/config/initializers/filter_parameter_logging.rb
222
- - test/dummy/config/initializers/inflections.rb
223
- - test/dummy/config/initializers/mime_types.rb
224
- - test/dummy/config/initializers/wrap_parameters.rb
225
- - test/dummy/config/puma.rb
226
- - test/dummy/config/routes.rb
227
- - test/dummy/config/spring.rb
228
- - test/dummy/db/migrate/20200711122838_create_posts.rb
229
- - test/dummy/db/migrate/2021042923813_create_action_items.rb
230
- - test/dummy/db/schema.rb
231
- - test/futurism_test.rb
232
- - test/helper/helper_test.rb
233
- - test/integration/navigation_test.rb
234
- - test/resolver/controller/renderer_test.rb
235
- - test/resolver/controller_test.rb
236
- - test/test_helper.rb
237
187
  - yarn.lock
238
188
  homepage: https://github.com/stimulusreflex/futurism
239
189
  licenses:
@@ -254,46 +204,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
204
  - !ruby/object:Gem::Version
255
205
  version: '0'
256
206
  requirements: []
257
- rubygems_version: 3.2.32
207
+ rubygems_version: 3.5.6
258
208
  signing_key:
259
209
  specification_version: 4
260
210
  summary: Lazy-load Rails partials via CableReady
261
- test_files:
262
- - test/cable/channel_test.rb
263
- - test/dummy/app/channels/application_cable/channel.rb
264
- - test/dummy/app/channels/application_cable/connection.rb
265
- - test/dummy/app/controllers/application_controller.rb
266
- - test/dummy/app/controllers/home_controller.rb
267
- - test/dummy/app/controllers/posts_controller.rb
268
- - test/dummy/app/helpers/application_helper.rb
269
- - test/dummy/app/helpers/posts_helper.rb
270
- - test/dummy/app/jobs/application_job.rb
271
- - test/dummy/app/models/action_item.rb
272
- - test/dummy/app/models/application_record.rb
273
- - test/dummy/app/models/post.rb
274
- - test/dummy/config/application.rb
275
- - test/dummy/config/boot.rb
276
- - test/dummy/config/environment.rb
277
- - test/dummy/config/environments/development.rb
278
- - test/dummy/config/environments/production.rb
279
- - test/dummy/config/environments/test.rb
280
- - test/dummy/config/initializers/application_controller_renderer.rb
281
- - test/dummy/config/initializers/backtrace_silencers.rb
282
- - test/dummy/config/initializers/content_security_policy.rb
283
- - test/dummy/config/initializers/cookies_serializer.rb
284
- - test/dummy/config/initializers/filter_parameter_logging.rb
285
- - test/dummy/config/initializers/inflections.rb
286
- - test/dummy/config/initializers/mime_types.rb
287
- - test/dummy/config/initializers/wrap_parameters.rb
288
- - test/dummy/config/puma.rb
289
- - test/dummy/config/routes.rb
290
- - test/dummy/config/spring.rb
291
- - test/dummy/db/migrate/20200711122838_create_posts.rb
292
- - test/dummy/db/migrate/2021042923813_create_action_items.rb
293
- - test/dummy/db/schema.rb
294
- - test/futurism_test.rb
295
- - test/helper/helper_test.rb
296
- - test/integration/navigation_test.rb
297
- - test/resolver/controller/renderer_test.rb
298
- - test/resolver/controller_test.rb
299
- - test/test_helper.rb
211
+ test_files: []
@@ -1,319 +0,0 @@
1
- require "test_helper"
2
-
3
- def with_mocked_renderer
4
- renderer = Minitest::Mock.new
5
-
6
- Futurism::Resolver::Controller::Renderer.stub(:for, renderer) do
7
- yield(renderer)
8
- end
9
- end
10
-
11
- def with_mocked_cable_ready
12
- cable_ready_mock = MiniTest::Mock.new
13
- cable_ready_channel = MiniTest::Mock.new
14
- cable_ready_channel.expect(:outer_html, nil, [Hash])
15
- cable_ready_channel.expect(:outer_html, nil, [Hash])
16
-
17
- cable_ready_mock.expect(:[], cable_ready_channel, ["1"])
18
- cable_ready_mock.expect(:[], cable_ready_channel, ["1"])
19
- cable_ready_mock.expect(:broadcast, nil)
20
- cable_ready_mock.expect(:broadcast, nil)
21
- cable_ready_mock.expect(:broadcast, nil)
22
-
23
- CableReady::Broadcaster.alias_method(:orig_cable_ready, :cable_ready)
24
-
25
- CableReady::Broadcaster.define_method(:cable_ready) do
26
- cable_ready_mock
27
- end
28
-
29
- yield cable_ready_mock
30
-
31
- CableReady::Broadcaster.undef_method(:cable_ready)
32
-
33
- CableReady::Broadcaster.alias_method(:cable_ready, :orig_cable_ready)
34
- end
35
-
36
- class Futurism::ChannelTest < ActionCable::Channel::TestCase
37
- include Futurism::Helpers
38
- include ActionView::Helpers
39
- include ActionView::Context
40
- include CableReady::Broadcaster
41
-
42
- setup do
43
- stub_connection(env: {"SCRIPT_NAME" => "/cable"}, identifiers: [:current_user], current_user: Struct.new(:id)[1])
44
- end
45
-
46
- test "subscribed" do
47
- subscribe(channel: "Futurism::Channel")
48
-
49
- assert subscription.confirmed?
50
-
51
- assert_has_stream "Futurism::Channel:1"
52
- end
53
-
54
- test "broadcasts a rendered model after receiving signed params" do
55
- with_mocked_renderer do |mock_renderer|
56
- post = Post.create title: "Lorem"
57
- fragment = Nokogiri::HTML.fragment(futurize(post) {})
58
- signed_params_array = fragment.children.map { |element| element["data-signed-params"] }
59
- sgids = fragment.children.map { |element| element["data-sgid"] }
60
- subscribe
61
-
62
- mock_renderer.expect :render, "<tag></tag>", [post]
63
-
64
- perform :receive, {"signed_params" => signed_params_array, "sgids" => sgids}
65
-
66
- assert_mock mock_renderer
67
- end
68
- end
69
-
70
- test "broadcasts an ActiveRecord::Relation" do
71
- with_mocked_renderer do |mock_renderer|
72
- post1 = Post.create(title: "Lorem")
73
- post2 = Post.create(title: "Ipsum")
74
-
75
- fragment = Nokogiri::HTML.fragment(futurize(Post.all) {})
76
- signed_params_array = fragment.children.map { |element| element["data-signed-params"] }
77
- sgids = fragment.children.map { |element| element["data-sgid"] }
78
- subscribe
79
-
80
- mock_renderer
81
- .expect(:render, "<tag></tag>", [post1])
82
- .expect :render, "<tag></tag>", [post2]
83
-
84
- perform :receive, {"signed_params" => signed_params_array, "sgids" => sgids}
85
-
86
- assert_mock mock_renderer
87
- end
88
- end
89
-
90
- test "broadcasts a rendered partial after receiving signed params" do
91
- with_mocked_renderer do |mock_renderer|
92
- post = Post.create title: "Lorem"
93
- fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", locals: {post: post}) {})
94
- signed_params = fragment.children.first["data-signed-params"]
95
- subscribe
96
-
97
- mock_renderer
98
- .expect(:render, "<tag></tag>", [partial: "posts/card", locals: {post: post}])
99
-
100
- perform :receive, {"signed_params" => [signed_params]}
101
-
102
- assert_mock mock_renderer
103
- end
104
- end
105
-
106
- test "broadcasts a rendered partial after receiving the shorthand syntax" do
107
- with_mocked_renderer do |mock_renderer|
108
- post = Post.create title: "Lorem"
109
- fragment = Nokogiri::HTML.fragment(futurize("posts/card", post: post) {})
110
- signed_params = fragment.children.first["data-signed-params"]
111
- subscribe
112
-
113
- mock_renderer.expect(:render, "<tag></tag>", [partial: "posts/card", locals: {post: post}])
114
- perform :receive, {"signed_params" => [signed_params]}
115
-
116
- assert_mock mock_renderer
117
- end
118
- end
119
-
120
- test "broadcasts a rendered partial after receiving the shorthand syntax with html options" do
121
- with_mocked_renderer do |mock_renderer|
122
- post = Post.create title: "Lorem"
123
- fragment = Nokogiri::HTML.fragment(futurize("posts/card", post: post, html_options: {style: "color: green"}) {})
124
- signed_params = fragment.children.first["data-signed-params"]
125
- subscribe
126
-
127
- mock_renderer.expect(:render, "<tag></tag>", [partial: "posts/card", locals: {post: post}])
128
-
129
- perform :receive, {"signed_params" => [signed_params]}
130
-
131
- assert_mock mock_renderer
132
- end
133
- end
134
-
135
- test "broadcasts a collection" do
136
- with_mocked_renderer do |mock_renderer|
137
- Post.create title: "Lorem"
138
- Post.create title: "Ipsum"
139
- fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", collection: Post.all, locals: {important_local: "needed to render"}) {})
140
- subscribe
141
-
142
- mock_renderer
143
- .expect(:render, "<tag></tag>", [partial: "posts/card", locals: {post: Post.first, important_local: "needed to render", post_counter: 0}])
144
- .expect(:render, "<tag></tag>", [partial: "posts/card", locals: {post: Post.last, important_local: "needed to render", post_counter: 1}])
145
-
146
- signed_params = fragment.children.first["data-signed-params"]
147
- perform :receive, {"signed_params" => [signed_params]}
148
-
149
- signed_params = fragment.children.last["data-signed-params"]
150
- perform :receive, {"signed_params" => [signed_params]}
151
-
152
- assert_mock mock_renderer
153
- end
154
- end
155
-
156
- test "broadcasts a collection (with multi-word class)" do
157
- with_mocked_renderer do |mock_renderer|
158
- ActionItem.create description: "Do this"
159
- ActionItem.create description: "Do that"
160
- fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", collection: ActionItem.all, locals: {important_local: "needed to render"}) {})
161
-
162
- subscribe
163
-
164
- mock_renderer
165
- .expect(:render, "<tag></tag>", [partial: "posts/card", locals: {action_item: ActionItem.first, important_local: "needed to render", action_item_counter: 0}])
166
- .expect(:render, "<tag></tag>", [partial: "posts/card", locals: {action_item: ActionItem.last, important_local: "needed to render", action_item_counter: 1}])
167
-
168
- signed_params = fragment.children.first["data-signed-params"]
169
- perform :receive, {"signed_params" => [signed_params]}
170
-
171
- signed_params = fragment.children.last["data-signed-params"]
172
- perform :receive, {"signed_params" => [signed_params]}
173
-
174
- assert_mock mock_renderer
175
- end
176
- end
177
-
178
- test "broadcasts a collection with :as" do
179
- with_mocked_renderer do |mock_renderer|
180
- Post.create title: "Lorem"
181
- Post.create title: "Ipsum"
182
- fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", collection: Post.all, as: :post_item) {})
183
- subscribe
184
-
185
- mock_renderer.expect(:render, "<tag></tag>", [partial: "posts/card", locals: {post_item: Post.first, post_item_counter: 0}])
186
- signed_params = fragment.children.first["data-signed-params"]
187
- perform :receive, {"signed_params" => [signed_params]}
188
-
189
- mock_renderer.expect(:render, "<tag></tag>", [partial: "posts/card", locals: {post_item: Post.last, post_item_counter: 1}])
190
- signed_params = fragment.children.last["data-signed-params"]
191
- perform :receive, {"signed_params" => [signed_params]}
192
-
193
- assert_mock mock_renderer
194
- end
195
- end
196
-
197
- test "broadcasts elements of a collection immediately" do
198
- with_mocked_cable_ready do |cable_ready_mock|
199
- Post.create title: "Lorem"
200
- Post.create title: "Ipsum"
201
- fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", collection: Post.all, broadcast_each: true, locals: {important_local: "needed to render"}) {})
202
- subscribe
203
-
204
- signed_params_1 = fragment.children.first["data-signed-params"]
205
- broadcast_each_1 = fragment.children.first["data-broadcast-each"]
206
- signed_params_2 = fragment.children.last["data-signed-params"]
207
- broadcast_each_2 = fragment.children.last["data-broadcast-each"]
208
- perform :receive, {"signed_params" => [signed_params_1, signed_params_2], "broadcast_each" => [broadcast_each_1, broadcast_each_2]}
209
-
210
- assert_mock cable_ready_mock
211
- end
212
- end
213
-
214
- test "broadcasts an inline rendered text" do
215
- fragment = Nokogiri::HTML.fragment(futurize(inline: "<%= 1 + 2 %>") {})
216
- signed_params = fragment.children.first["data-signed-params"]
217
- subscribe(channel: "Futurism::Channel")
218
-
219
- assert_cable_ready_operation_on("Futurism::Channel:1", operation: "outerHtml", selector: "[data-signed-params='#{signed_params}']", html: "3") do
220
- perform :receive, {"signed_params" => [signed_params]}
221
- end
222
- end
223
-
224
- test "broadcasts a correctly formed path" do
225
- post = Post.create title: "Lorem"
226
- fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", locals: {post: post}) {})
227
- signed_params = fragment.children.first["data-signed-params"]
228
- subscribe(channel: "Futurism::Channel")
229
-
230
- assert_cable_ready_operation_on("Futurism::Channel:1", operation: "outerHtml",
231
- selector: "[data-signed-params='#{signed_params}']",
232
- html: "<div class=\"card\">\n Lorem\n <a href=\"/posts/1/edit\">Edit</a>\n</div>\n") do
233
- perform :receive, {"signed_params" => [signed_params]}
234
- end
235
- end
236
-
237
- test "passes parsed params to controller render" do
238
- with_mocked_renderer do |mock_renderer|
239
- post = Post.create title: "Lorem"
240
- fragment = Nokogiri::HTML.fragment(futurize(post) {})
241
- signed_params_array = fragment.children.map { |element| element["data-signed-params"] }
242
- sgids = fragment.children.map { |element| element["data-sgid"] }
243
- urls = Array.new(fragment.children.length, "http://www.example.org/route?param1=true&param2=1234")
244
- subscribe
245
-
246
- mock_renderer.expect(:render, "<tag></tag>", [post])
247
-
248
- perform :receive, {"signed_params" => signed_params_array, "sgids" => sgids, "urls" => urls}
249
-
250
- assert_mock mock_renderer
251
- end
252
- end
253
-
254
- test "renders error message when rendering invalid partial error" do
255
- fragment = Nokogiri::HTML.fragment(futurize(partial: "INVALID/PARTIAL") {})
256
- signed_params = fragment.children.first["data-signed-params"]
257
- subscribe(channel: "Futurism::Channel")
258
-
259
- assert_cable_ready_operation_on("Futurism::Channel:1", operation: "outerHtml",
260
- selector: "[data-signed-params='#{signed_params}']",
261
- html: /Missing partial INVALID\/_PARTIAL/) do
262
- perform :receive, {"signed_params" => [signed_params]}
263
- end
264
- end
265
-
266
- test "renders error message when wrong variable name" do
267
- Post.create title: "Lorem"
268
- fragment = Nokogiri::HTML.fragment(futurize(partial: "posts/card", collection: Post.all, as: :wrong_variable_name) {})
269
- signed_params = fragment.children.first["data-signed-params"]
270
- subscribe(channel: "Futurism::Channel")
271
-
272
- assert_cable_ready_operation_on("Futurism::Channel:1", operation: "outerHtml",
273
- selector: "[data-signed-params='#{signed_params}']",
274
- html: /undefined local variable or method/) do
275
- perform :receive, {"signed_params" => [signed_params]}
276
- end
277
- end
278
-
279
- def assert_cable_ready_operation_on(stream, operation:, selector:, html:, &block)
280
- data = {
281
- "cableReady" => true,
282
- "operations" => [{
283
- "selector" => selector,
284
- "html" => html,
285
- "operation" => operation
286
- }]
287
- }
288
-
289
- old_messages = broadcasts(stream)
290
- clear_messages(stream)
291
-
292
- assert_nothing_raised(&block)
293
-
294
- new_messages = broadcasts(stream)
295
- clear_messages(stream)
296
-
297
- # Restore all sent messages
298
- (old_messages + new_messages).each { |m| pubsub_adapter.broadcast(stream, m) }
299
-
300
- message = new_messages.find { |msg| cable_ready_match?(ActiveSupport::JSON.decode(msg), data) }
301
-
302
- assert message, "No messages sent with #{data} to #{stream}"
303
- end
304
-
305
- def cable_ready_match?(message, matcher)
306
- return true if message == matcher
307
-
308
- first_matching_operation = ["operations", 0]
309
-
310
- matcher_operation = matcher.dig(*first_matching_operation)
311
- message_operation = message.dig(*first_matching_operation)
312
-
313
- message.dig("cableReady") == true &&
314
- (matcher_operation.dig("selector") === message_operation.dig("selector") ||
315
- matcher_operation.dig("selector").match(message_operation.dig("selector"))) &&
316
- (matcher_operation.dig("html") === message_operation.dig("html") ||
317
- matcher_operation.dig("html").match(message_operation.dig("html")))
318
- end
319
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,6 +0,0 @@
1
- class HomeController < ApplicationController
2
- # GET /home
3
- def index
4
- head :no_content
5
- end
6
- end
@@ -1,59 +0,0 @@
1
- class PostsController < ApplicationController
2
- before_action :set_post, only: [:show, :edit, :update, :destroy]
3
-
4
- # GET /posts
5
- def index
6
- @posts = Post.all
7
- end
8
-
9
- # GET /posts/1
10
- def show
11
- end
12
-
13
- # GET /posts/new
14
- def new
15
- @post = Post.new
16
- end
17
-
18
- # GET /posts/1/edit
19
- def edit
20
- end
21
-
22
- # POST /posts
23
- def create
24
- @post = Post.new(post_params)
25
-
26
- if @post.save
27
- redirect_to @post, notice: "Post was successfully created."
28
- else
29
- render :new
30
- end
31
- end
32
-
33
- # PATCH/PUT /posts/1
34
- def update
35
- if @post.update(post_params)
36
- redirect_to @post, notice: "Post was successfully updated."
37
- else
38
- render :edit
39
- end
40
- end
41
-
42
- # DELETE /posts/1
43
- def destroy
44
- @post.destroy
45
- redirect_to posts_url, notice: "Post was successfully destroyed."
46
- end
47
-
48
- private
49
-
50
- # Use callbacks to share common setup or constraints between actions.
51
- def set_post
52
- @post = Post.find(params[:id])
53
- end
54
-
55
- # Only allow a trusted parameter "white list" through.
56
- def post_params
57
- params.require(:post).permit(:title)
58
- end
59
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module PostsHelper
2
- end
@@ -1,7 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- # Automatically retry jobs that encountered a deadlock
3
- # retry_on ActiveRecord::Deadlocked
4
-
5
- # Most jobs are safe to ignore if the underlying records are no longer available
6
- # discard_on ActiveJob::DeserializationError
7
- end
@@ -1,2 +0,0 @@
1
- class ActionItem < ApplicationRecord
2
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,2 +0,0 @@
1
- class Post < ApplicationRecord
2
- end
@@ -1,29 +0,0 @@
1
- require_relative "boot"
2
-
3
- require "rails"
4
- # Pick the frameworks you want:
5
- require "active_model/railtie"
6
- require "active_job/railtie"
7
- require "active_record/railtie"
8
- # require "active_storage/engine"
9
- require "action_controller/railtie"
10
- # require "action_mailer/railtie"
11
- require "action_view/railtie"
12
- require "action_cable/engine"
13
- # require "sprockets/railtie"
14
- require "rails/test_unit/railtie"
15
-
16
- Bundler.require(*Rails.groups)
17
- require "futurism"
18
-
19
- module Dummy
20
- class Application < Rails::Application
21
- # Initialize configuration defaults for originally generated Rails version.
22
- config.load_defaults Rails::VERSION::MAJOR + (Rails::VERSION::MINOR / 10.0)
23
-
24
- # Settings in config/environments/* take precedence over those specified here.
25
- # Application configuration can go into files in config/initializers
26
- # -- all .rb files in that directory are automatically loaded after loading
27
- # the framework and any gems in your application.
28
- end
29
- end
@@ -1,5 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
3
-
4
- require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
5
- $LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require_relative "application"
3
-
4
- # Initialize the Rails application.
5
- Rails.application.initialize!
@@ -1,40 +0,0 @@
1
- Rails.application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports.
13
- config.consider_all_requests_local = true
14
-
15
- # Enable/disable caching. By default caching is disabled.
16
- # Run rails dev:cache to toggle caching.
17
- if Rails.root.join("tmp", "caching-dev.txt").exist?
18
- config.action_controller.perform_caching = true
19
- config.action_controller.enable_fragment_cache_logging = true
20
-
21
- config.cache_store = :memory_store
22
- config.public_file_server.headers = {
23
- "Cache-Control" => "public, max-age=#{2.days.to_i}"
24
- }
25
- else
26
- config.action_controller.perform_caching = false
27
-
28
- config.cache_store = :null_store
29
- end
30
-
31
- # Print deprecation notices to the Rails logger.
32
- config.active_support.deprecation = :log
33
-
34
- # Raises error for missing translations.
35
- # config.action_view.raise_on_missing_translations = true
36
-
37
- # Use an evented file watcher to asynchronously detect changes in source code,
38
- # routes, locales, etc. This feature depends on the listen gem.
39
- # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
40
- end