You need ChromeDriver (and Chrome) installed locally and running.
You can install ChromeDriver with Homebrew on MacOS:
brew install chromedriver
This is a demo of leveraging the proposed Action Cable architecture to implement an SSE transport for Action Cable (without changing the user-space code, e.g., Connection and Channel classes).
Start the server by running the following command:
ruby main.rb
Now, you can connect to Action Cable over SSE via cURL as follows:
# From https://evilmartians.com/chronicles/viewcomponent-in-the-wild-embracing-tailwindcss-classes-and-html-attributes | |
class ApplicationViewComponent < ViewComponentContrib::Base | |
# Move default attrs to a constants so we can re-use it | |
EMPTY_ATTRS = {}.freeze | |
class << self | |
def html_option(name, default: nil, **opts) | |
if default | |
opts[:type] = proc { default.merge(_1) } | |
end |
# frozen_string_literal: true | |
# Patch Wisper to disable broadcasting by default | |
# (to speed up tests). | |
# Profile Wisper publishing via EventProf | |
TestProf::EventProf.monitor(Wisper::Publisher, "wisper.publisher.broadcast", :broadcast) | |
module Wisper | |
module Testing |
# This a custom Thor command which can be used to install RailsBytes templates | |
# without Rails. | |
# The primary use case is to make it possible to apply templates without a Rails app being installed. | |
# (For example, when you want to configure a dev environment and cannot run `bundle install`). | |
# | |
# Usage: | |
# | |
# 1) Install Thor: | |
# | |
# gem install thor |
# Usage: | |
# gem install syntax_tree | |
# stree double_query.txt spec/**/*.rb | |
# | |
CallNode[ | |
receiver: NilClass, | |
message: Ident[value: "double" | "instance_double"], | |
arguments: ArgParen[ | |
arguments: Args[ | |
parts: [StringLiteral | VarRef[value: Const], BareAssocHash] |
<div class="min-w-full flex flex-row"> | |
<%= turbo_stream_from "demo" %> | |
<div id="demo"></div> | |
</div> |
# frozen_string_literal: true | |
require "yabeda/base_adapter" | |
module Yabeda | |
module STDOUT | |
class Adapter < BaseAdapter | |
def register_counter!(_metric) | |
end |
require 'active_support/core_ext/hash/indifferent_access' | |
def send_admin_notification(changes = previous_changes) | |
case changes | |
in ends_at: [Time, _] | |
:resubscribed | |
in ends_at: [nil, Time] | |
:churned | |
in processor_plan: [nil, String] | |
:subscribed |
# frozen_string_literal: true | |
require "rails_helper" | |
# Automatically smoke-test all mailer previews | |
describe "/rails/mailers" do | |
subject { response } | |
ActionMailer::Preview.all.each do |preview| | |
next if preview.emails.empty? |