Skip to content

Commit

Permalink
Merge pull request #876 from davidsiaw/falcon-mini
Browse files Browse the repository at this point in the history
switch to using falcon
  • Loading branch information
davidsiaw authored Nov 5, 2024
2 parents 846b59b + fbf9761 commit 0e01a9a
Show file tree
Hide file tree
Showing 29 changed files with 355 additions and 83 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ jobs:
command: |
mkdir -p /tmp/test-results
docker-compose -f .circleci/compose-unit.yml exec rails-unit mkdir /tmp/test-results
docker-compose -f .circleci/compose-unit.yml exec rails-unit rails db:test:prepare
docker-compose -f .circleci/compose-unit.yml exec rails-unit rails db:test:prepare
docker-compose -f .circleci/compose-unit.yml logs rails-unit
- run:
name: request to start recording video
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@

# Ignore master key for decrypting credentials and more.
/config/master.key

.DS_Store
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ Layout/LineLength:
Style/SignalException:
Exclude:
- 'Dangerfile'

# We don't want this
Rails/ApplicationRecord:
Exclude:
- 'app/models/paper_trail/version.rb'
42 changes: 37 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,51 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-05-26 05:10:14 UTC using RuboCop version 1.64.0.
# on 2024-06-12 14:52:30 UTC using RuboCop version 1.64.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 21

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 20

# Offense count: 4
RSpec/AnyInstance:
Exclude:
- 'spec/redis_connections/application_redis_connection_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- 'spec/browser/restricted_area_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationRecord:
# Offense count: 6
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 20

# Offense count: 2
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Exclude:
- 'spec/redis_connections/application_redis_connection_spec.rb'

# Offense count: 2
RSpec/MultipleExpectations:
Max: 2

# Offense count: 8
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'app/models/paper_trail/version.rb'
- 'spec/redis_connections/application_redis_connection_spec.rb'
- 'spec/services/async_redis_service_spec.rb'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ EXPOSE 3000

ENV RAILS_ENV=development

CMD ["sh", "-c", "rails s -b 0.0.0.0 -p 3000"]
CMD ["sh", "-c", "rails s -u falcon -b 0.0.0.0 -p 3000"]
12 changes: 9 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rails', '~> 7'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 6.3'
# Use falcon as webserver
gem 'falcon'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 6.0'
# Use Uglifier as compressor for JavaScript assets
Expand Down Expand Up @@ -50,15 +50,21 @@ gem 'ulid-rails', git: 'https://github.com/davidsiaw/ulid-rails'
gem 'sidekiq'
gem 'sidekiq-scheduler'

gem 'async-io'
gem 'async-redis'
gem 'async-websocket'
gem 'thread-local'

group :development, :test do
gem 'async-rspec'
gem 'factory_bot_rails'
gem 'pry-byebug', platforms: %i[mri mingw x64_mingw]
gem 'rspec-rails'
end

group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'falcon-capybara'
gem 'rspec_junit_formatter'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
Expand Down
114 changes: 108 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,45 @@ GEM
ar-uuid (0.2.3)
activerecord
ast (2.4.2)
async (2.11.0)
console (~> 1.25, >= 1.25.2)
fiber-annotation
io-event (~> 1.5, >= 1.5.1)
timers (~> 4.1)
async-container (0.18.2)
async (~> 2.10)
async-http (0.66.3)
async (>= 2.10.2)
async-pool (>= 0.6.1)
io-endpoint (~> 0.10, >= 0.10.3)
io-stream (~> 0.4)
protocol-http (~> 0.26.0)
protocol-http1 (~> 0.19.0)
protocol-http2 (~> 0.17.0)
traces (>= 0.10.0)
async-http-cache (0.4.3)
async-http (~> 0.56)
async-io (1.43.2)
async
async-pool (0.6.1)
async (>= 1.25)
async-redis (0.8.1)
async (>= 1.8, < 3.0)
async-pool (~> 0.2)
io-endpoint (~> 0.10)
io-stream (~> 0.4)
protocol-redis (~> 0.8.0)
async-rspec (1.17.0)
rspec (~> 3.0)
rspec-files (~> 1.0)
rspec-memory (~> 1.0)
async-service (0.12.0)
async
async-container (~> 0.16)
async-websocket (0.26.1)
async-http (~> 0.54)
protocol-rack (~> 0.5)
protocol-websocket (~> 0.11)
base32-crockford (0.1.0)
base64 (0.2.0)
bcrypt (3.1.20)
Expand Down Expand Up @@ -121,6 +160,10 @@ GEM
colored2 (3.1.2)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
console (1.25.2)
fiber-annotation
fiber-local (~> 1.1)
json
cork (0.3.0)
colored2 (~> 3.1)
crass (1.0.6)
Expand Down Expand Up @@ -180,6 +223,22 @@ GEM
railties (>= 5.0.0)
faker (3.5.1)
i18n (>= 1.8.11, < 2)
falcon (0.47.6)
async
async-container (~> 0.18)
async-http (~> 0.66, >= 0.66.3)
async-http-cache (~> 0.4.0)
async-service (~> 0.10)
bundler
localhost (~> 1.1)
openssl (~> 3.0)
process-metrics (~> 0.2.0)
protocol-rack (~> 0.5)
samovar (~> 2.3)
falcon-capybara (1.6.1)
capybara (~> 3.37)
falcon
selenium-webdriver
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
json
Expand All @@ -192,6 +251,10 @@ GEM
faraday (~> 2.0)
ffaker (2.23.0)
ffi (1.16.3)
fiber-annotation (0.2.0)
fiber-local (1.1.0)
fiber-storage
fiber-storage (0.1.1)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
Expand Down Expand Up @@ -223,6 +286,9 @@ GEM
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
io-endpoint (0.10.3)
io-event (1.5.1)
io-stream (0.4.0)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
Expand All @@ -238,6 +304,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
localhost (1.3.1)
logger (1.6.1)
loofah (2.23.1)
crass (~> 1.0.2)
Expand All @@ -247,6 +314,7 @@ GEM
net-imap
net-pop
net-smtp
mapping (1.1.1)
marcel (1.0.4)
matrix (0.4.2)
method_source (1.1.0)
Expand All @@ -271,12 +339,13 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.4)
nokogiri (1.16.7-x86_64-linux)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
octokit (9.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
openssl (3.2.0)
orm_adapter (0.5.0)
paper_trail (15.2.0)
activerecord (>= 6.1)
Expand All @@ -286,6 +355,22 @@ GEM
ast (~> 2.4.1)
racc
pg (1.5.9)
process-metrics (0.2.1)
console (~> 1.8)
samovar (~> 2.1)
protocol-hpack (1.4.3)
protocol-http (0.26.5)
protocol-http1 (0.19.1)
protocol-http (~> 0.22)
protocol-http2 (0.17.0)
protocol-hpack (~> 1.4)
protocol-http (~> 0.18)
protocol-rack (0.5.1)
protocol-http (~> 0.23)
rack (>= 1.0)
protocol-redis (0.8.1)
protocol-websocket (0.13.0)
protocol-http (~> 0.2)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -296,8 +381,6 @@ GEM
psych (5.1.2)
stringio
public_suffix (6.0.1)
puma (6.4.3)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.1)
rack (3.1.8)
Expand Down Expand Up @@ -362,11 +445,19 @@ GEM
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.9)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-files (1.1.3)
rspec (~> 3.0)
rspec-memory (1.0.4)
rspec (~> 3.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
Expand Down Expand Up @@ -412,6 +503,9 @@ GEM
rubyzip (2.3.2)
rufus-scheduler (3.9.2)
fugit (~> 1.1, >= 1.11.1)
samovar (2.3.0)
console (~> 1.0)
mapping (~> 1.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
Expand Down Expand Up @@ -458,8 +552,11 @@ GEM
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.2)
thread-local (1.1.0)
tilt (2.4.0)
timeout (0.4.1)
timers (4.3.5)
traces (0.11.1)
trailblazer-option (0.1.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -491,20 +588,25 @@ GEM
zeitwerk (2.7.1)

PLATFORMS
x86_64-linux
aarch64-linux

DEPENDENCIES
ar-uuid
async-io
async-redis
async-rspec
async-websocket
bcrypt (~> 3.1.19)
bootsnap (>= 1.1.0)
brakeman
bundler-audit
capybara
danger
database_cleaner
devise
factory_bot_rails
faker
falcon
falcon-capybara
faraday-retry
ffaker
grape
Expand All @@ -517,7 +619,6 @@ DEPENDENCIES
paper_trail
pg (>= 0.18, < 2.0)
pry-byebug
puma (~> 6.3)
rails (~> 7)
redis (~> 5.3)
rspec-rails
Expand All @@ -535,6 +636,7 @@ DEPENDENCIES
sidekiq-scheduler
spring
spring-watcher-listen (~> 2.1.0)
thread-local
tzinfo-data
uglifier (>= 1.3.0)
ulid-rails!
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
*= require_tree .
*= require_self
*/

body {
background: #000;
color: #fff;
}
6 changes: 0 additions & 6 deletions app/channels/application_cable/channel.rb

This file was deleted.

6 changes: 0 additions & 6 deletions app/channels/application_cable/connection.rb

This file was deleted.

Loading

0 comments on commit 0e01a9a

Please sign in to comment.