Skip to content

Commit

Permalink
Upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
joshfng committed Oct 12, 2024
1 parent bb03622 commit 00b90d7
Show file tree
Hide file tree
Showing 18 changed files with 1,838 additions and 1,919 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require:
AllCops:
NewCops: enable
Exclude:
- "bin/**"
- "db/**/*"
- "config/**/*"
- "node_modules/**/*"
Expand All @@ -15,6 +16,8 @@ AllCops:

Style/Documentation:
Enabled: false
Rails/I18nLocaleTexts:
Enabled: false

Metrics/BlockLength:
Max: 100
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem 'sass-rails'
gem 'turbolinks'
gem 'webpacker'

gem 'rexml', '~> 3.3'
gem 'rexml'

# Authentication
gem 'devise'
Expand Down
79 changes: 43 additions & 36 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ GEM
bcrypt (3.1.20)
bigdecimal (3.1.8)
bindex (0.8.1)
blind_index (2.4.0)
blind_index (2.5.0)
activesupport (>= 6.1)
argon2-kdf (>= 0.1.1)
bootsnap (1.7.6)
msgpack (~> 1.0)
brakeman (5.1.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (6.2.1)
racc
builder (3.3.0)
bundler-audit (0.9.2)
bundler (>= 1.2.0, < 3)
Expand Down Expand Up @@ -101,6 +102,8 @@ GEM
factory_bot (~> 6.4)
railties (>= 5.0.0)
ffi (1.17.0)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
foreman (0.88.1)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
Expand All @@ -121,12 +124,14 @@ GEM
jbuilder (2.13.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
listen (3.6.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lockbox (1.4.1)
Expand All @@ -144,7 +149,7 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.1)
msgpack (1.4.2)
msgpack (1.7.3)
net-imap (0.4.16)
date
net-protocol
Expand All @@ -163,14 +168,15 @@ GEM
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.20.1)
parser (3.0.2.0)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pg (1.5.8)
pg_query (5.1.0)
google-protobuf (>= 3.22.3)
pghero (3.5.0)
activerecord (>= 6)
pghero (3.6.0)
activerecord (>= 6.1)
public_suffix (6.0.1)
puma (6.4.3)
nio4r (~> 2.0)
Expand All @@ -180,7 +186,7 @@ GEM
rack-canonical-host (1.3.0)
addressable (> 0, < 3)
rack (>= 1.6, < 4)
rack-mini-profiler (2.3.2)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-proxy (0.7.7)
rack
Expand Down Expand Up @@ -214,18 +220,18 @@ GEM
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.0.0)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
redis (5.3.0)
redis-client (>= 0.22.0)
redis-client (0.22.2)
connection_pool
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.1.1)
regexp_parser (2.9.2)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
Expand All @@ -235,7 +241,7 @@ GEM
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.5)
Expand All @@ -247,28 +253,29 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rubocop (1.18.4)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.8.0, < 2.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.8.0)
parser (>= 3.0.1.1)
rubocop-performance (1.11.4)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.11.3)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (2.4.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-progressbar (1.11.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.1.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
Expand Down Expand Up @@ -313,7 +320,7 @@ GEM
turbolinks-source (5.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.0.0)
unicode-display_width (2.6.0)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
Expand All @@ -329,7 +336,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.18)
zeitwerk (2.7.0)

PLATFORMS
ruby
Expand Down Expand Up @@ -358,7 +365,7 @@ DEPENDENCIES
rails (~> 6.1)
redis
redis-namespace
rexml (~> 3.3)
rexml
rspec-rails
rubocop
rubocop-performance
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class HomeController < ApplicationController
skip_before_action :authenticate_user!

def index
return redirect_to(switches_path) if current_user
redirect_to(switches_path) if current_user
end
end
2 changes: 0 additions & 2 deletions app/models/heartbeat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

class Heartbeat < ApplicationRecord
belongs_to :switch

validates :switch, presence: true
end
1 change: 0 additions & 1 deletion app/models/switch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Switch < ApplicationRecord

enum heartbeat_interval: { daily: 0, weekly: 1, monthly: 2 }

validates :user, presence: true
validates :name, presence: true
validates :content, presence: true
validates :heartbeat_address, presence: true
Expand Down
2 changes: 1 addition & 1 deletion bin/spring
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

if !defined?(Spring) && [nil, 'development', 'test'].include?(ENV['RAILS_ENV'])
if !defined?(Spring) && [nil, 'development', 'test'].include?(ENV.fetch('RAILS_ENV', nil))
gem 'bundler'
require 'bundler'

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@rails/ujs": "^7.1.400",
"@rails/webpacker": "5.4.0",
"bootstrap": "^4.6.0",
"css-what": "^5.0.1",
"is-svg": "^4.2.2",
"jquery": "^3.7.1",
"popper.js": "^1.16.1",
Expand Down
6 changes: 3 additions & 3 deletions spec/mailers/heartbeat_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
end

it 'renders the headers' do
expect(mail.subject).to eq('Heartbeat Attempt')
expect(mail.to).to eq([heartbeat.switch.heartbeat_address])
expect(mail.from).to eq(['noreply@detonateapp.com'])
expect(mail.subject).to be('Heartbeat Attempt')
expect(mail.to).to be([heartbeat.switch.heartbeat_address])
expect(mail.from).to be(['noreply@detonateapp.com'])
end

it 'renders the body' do
Expand Down
6 changes: 3 additions & 3 deletions spec/mailers/switch_detonation_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
end

it 'renders the headers' do
expect(mail.subject).to eq('Someone has sent you sensitive data')
expect(mail.to).to eq([switch.switch_address])
expect(mail.from).to eq(['noreply@detonateapp.com'])
expect(mail.subject).to be('Someone has sent you sensitive data')
expect(mail.to).to be([switch.switch_address])
expect(mail.from).to be(['noreply@detonateapp.com'])
end

it 'renders the body' do
Expand Down
4 changes: 2 additions & 2 deletions spec/models/heartbeat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
describe 'validations' do
it 'ensures a switch exists' do
heartbeat = build(:heartbeat, switch: nil)
expect(heartbeat.valid?).to eq(false)
expect(heartbeat.valid?).to be(false)

heartbeat.switch = create(:switch)
expect(heartbeat.valid?).to eq(true)
expect(heartbeat.valid?).to be(true)
end
end
end
Loading

0 comments on commit 00b90d7

Please sign in to comment.