Skip to content

Commit a929428

Browse files
authored
Merge branch 'master' into dependabot/bundler/puma-5.6.9
2 parents f0acb5b + ae4c7f0 commit a929428

23 files changed

+169
-147
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ storage/*
2626

2727
# Super-secret stuff
2828
set_aws_credentials.sh
29+
.env
2930

3031
# Ignore map images uploaded to Locations
3132
/locations
@@ -39,3 +40,4 @@ node_modules
3940
/yarn-error.log
4041
yarn-debug.log*
4142
.yarn-integrity
43+

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.1
1+
3.2.3

Gemfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ ruby "~> 3.2"
33

44
# Server core
55
gem 'rails', '~> 6.1'
6-
gem 'puma', '~> 5.6'
6+
7+
#gem 'puma', '~> 5.6'
8+
gem 'passenger'
9+
710
# gem 'bootsnap', require: false
811
gem 'sprockets', '~> 4.2.0'
912
gem 'terser'
@@ -88,6 +91,8 @@ gem 'discordrb'
8891
# Smarts
8992
gem 'word_count_analyzer'
9093

94+
gem 'will_paginate', '~> 4.0'
95+
9196
# Workers
9297
gem 'sidekiq'
9398
gem 'redis'
@@ -108,7 +113,6 @@ end
108113

109114
group :production do
110115
gem 'uglifier', '>= 1.3.0'
111-
gem 'newrelic_rpm'
112116
end
113117

114118
group :test, :production do
@@ -130,10 +134,16 @@ group :development do
130134
gem 'rack-mini-profiler'
131135
gem 'memory_profiler'
132136
gem 'flamegraph'
133-
gem 'stackprof'
134137
gem 'bundler-audit'
135138
end
136139

140+
group :development, :production do
141+
# Profiling / error tracking
142+
gem "stackprof"
143+
gem "sentry-ruby"
144+
gem "sentry-rails"
145+
end
146+
137147
group :worker do
138148
# These gems are only used in workers (and just so happen to slow down app startup
139149
# by quite a bit), so we exclude them from all groups other than RAILS_GROUPS=worker.

Gemfile.lock

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,7 @@ GEM
12701270
multi_json (~> 1)
12711271
statsd-ruby (~> 1.1)
12721272
bcrypt (3.1.18)
1273+
bigdecimal (3.1.9)
12731274
bindex (0.8.1)
12741275
binding_of_caller (1.0.0)
12751276
debug_inspector (>= 0.0.1)
@@ -1475,8 +1476,7 @@ GEM
14751476
net-smtp (0.3.3)
14761477
net-protocol
14771478
netrc (0.11.0)
1478-
newrelic_rpm (9.2.0)
1479-
nio4r (2.7.3)
1479+
nio4r (2.5.9)
14801480
nokogiri (1.16.6)
14811481
mini_portile2 (~> 2.8.2)
14821482
racc (~> 1.4)
@@ -1493,6 +1493,10 @@ GEM
14931493
terrapin (~> 0.6.0)
14941494
paranoia (2.6.1)
14951495
activerecord (>= 5.1, < 7.1)
1496+
passenger (6.0.23)
1497+
rack (>= 1.6.13)
1498+
rackup
1499+
rake (>= 12.3.3)
14961500
paypal-checkout-sdk (1.0.4)
14971501
paypalhttp (~> 1.0.1)
14981502
paypal_client (0.4.1)
@@ -1520,6 +1524,9 @@ GEM
15201524
rack
15211525
rack-test (2.1.0)
15221526
rack (>= 1.3)
1527+
rackup (1.0.1)
1528+
rack (< 3)
1529+
webrick
15231530
rails (6.1.7.2)
15241531
actioncable (= 6.1.7.2)
15251532
actionmailbox (= 6.1.7.2)
@@ -1609,6 +1616,12 @@ GEM
16091616
rubyzip (>= 1.2.2, < 3.0)
16101617
websocket (~> 1.0)
16111618
semantic_range (3.0.0)
1619+
sentry-rails (5.23.0)
1620+
railties (>= 5.0)
1621+
sentry-ruby (~> 5.23.0)
1622+
sentry-ruby (5.23.0)
1623+
bigdecimal
1624+
concurrent-ruby (~> 1.0, >= 1.0.2)
16121625
sidekiq (6.5.5)
16131626
connection_pool (>= 2.2.2)
16141627
rack (~> 2.0)
@@ -1675,13 +1688,15 @@ GEM
16751688
rack-proxy (>= 0.6.1)
16761689
railties (>= 5.2)
16771690
semantic_range (>= 2.3.0)
1691+
webrick (1.9.1)
16781692
websocket (1.2.9)
16791693
websocket-client-simple (0.3.0)
16801694
event_emitter
16811695
websocket
16821696
websocket-driver (0.7.5)
16831697
websocket-extensions (>= 0.1.0)
16841698
websocket-extensions (0.1.5)
1699+
will_paginate (4.0.1)
16851700
word_count_analyzer (1.0.1)
16861701
engtagger
16871702
zeitwerk (2.6.16)
@@ -1724,15 +1739,14 @@ DEPENDENCIES
17241739
memory_profiler
17251740
meta-tags
17261741
mini_racer (~> 0.6.3)
1727-
newrelic_rpm
17281742
onebox!
17291743
paperclip
17301744
paranoia
1745+
passenger
17311746
paypal-checkout-sdk
17321747
paypal_client
17331748
pg (~> 1.5)
17341749
pry
1735-
puma (~> 5.6)
17361750
puma-heroku
17371751
rack-mini-profiler
17381752
rails (~> 6.1)
@@ -1745,6 +1759,8 @@ DEPENDENCIES
17451759
rmagick
17461760
sass-rails
17471761
selenium-webdriver
1762+
sentry-rails
1763+
sentry-ruby
17481764
serendipitous!
17491765
sidekiq
17501766
slack-notifier
@@ -1760,6 +1776,7 @@ DEPENDENCIES
17601776
uglifier (>= 1.3.0)
17611777
web-console
17621778
webpacker
1779+
will_paginate (~> 4.0)
17631780
word_count_analyzer
17641781

17651782
RUBY VERSION

app/controllers/document_revisions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class DocumentRevisionsController < ApplicationController
44

55
# GET /document_revisions
66
def index
7-
@document_revisions = @document.document_revisions.order('created_at DESC')
7+
@document_revisions = @document.document_revisions.order('created_at DESC').paginate(page: params[:page], per_page: 10)
88
end
99

1010
# GET /document_revisions/1

app/javascript/components/Footer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Footer extends React.Component {
2626
</div>
2727
</div>
2828

29-
Notebook.ai © 2016-2023 <a href='http://www.indentlabs.com' className='grey-text'>
29+
Notebook.ai © 2016-2025 <a href='http://www.indentlabs.com' className='grey-text'>
3030
Indent Labs, LLC
3131
</a>
3232
</div>

app/services/forum_replacement_service.rb

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,56 @@ class ForumReplacementService < Service
408408
'yoga' => 'bendy business',
409409
'yuge' => '<span style="font-size: 40px">yuge</span>',
410410
'zalgo' => 'H̶̛̼̼̪̝̞͓̞͕͇̯͚͎͚̘̳͕̱̤̠̗͔͇̙̣̰͓̖̰̯̀̓̐̑̇͊͂̀͋̒̐̓͒̒͊͊̕͜͝ͅE̴̡̧̨̨̲̥̯͎̭̻̩̞̘̞̪̞̗̭͖̻͙͕͎̮͕̺͕̲̘̻̣͚̳̥͍̙͈͚͍͉̗͙̱͖͚̾̂̇͛̉͋͊̾͛̆̀́͑͛̅̋͊̕͘͜͜͜͝ͅͅͅͅ ̸̡̡̨̡̨̛̞͎̹̩̬̗̗̞̬̰̮̙̪̖͈̣̹͔̺̫̰̓̔̉̋̈̈́͐́̿̈̀͊̿̈̉̅̃̊̽͗̈̿̈́̓̈́̎͌̄̀̆̌̎͗̋͒̋̿̋̊̈́͆̋̾̈̏̈́̋̿̕̕̚͝͝͠͠ͅͅͅC̵̛̘̳͙̪̭͖̲̞̯̰̜͇̈̾̈́͋̌̉̽̽͑̎͌̾̈́͌̑͊̊̔̀͆̌̀̇̓͊̀̂̇̿̃͑́̈́̆͂̈́̾̓́̂̂̓̂̍̍͛͆͌͌̽̎̍̀̒̆̀͗͋͘͘͘͝͠͝͝͠͝͝Ǫ̸͕̻̞̝̜͚̗̮̼͎̤͔̤̱͔̫͂̄̉̋̈͊͐͂̇̀̌̎́͑̐̀̈́͋̓̾̅͒̒̄͑̒̆̑̾͜͝͝͝͝M̷̧̧̡̨̛̛̩̭̞͍̼̝̗͕̖͇̣̣̩͆̿̑͒́̉̅̓̌̆̈́͐͒̾̐̂̿̓̚͘̚͜E̵̡̨̢̧̢̢̡̢̨̛̠̱̻̺̦͚̹͓̬͔̪̟̼̥̯̠̘͚̫̯͍̺͔̫̟͇̱̦̟̪͚͉̣̳͓͍̬̙̲͔̘͙͔̤̰̜͍̠̩͉͐̂̊̏̐̿̊̋͑̿̇̊̈́͗̎̋́́̉̓̂̐͑̇̐̐͋́̒̈́͛͑͒̂͒̂̔̀̄̈́̓͂͆̈́͒̌͆̓͗̋͐̔̑͐̕͘ͅͅͅŞ̴̧̧̡̢̧̡̢͕̝͚̝̖͚̣̞̫̻̯͔̳̗̝̰̗̰̰̥̭͕̜̜̫͍̪̳̘̣̺̠͉̗̟͕̹͇̬̘̘̪͆͗̎̕',
411+
'antagonist' => 'plot troublemaker',
412+
'character arc' => 'protagonist pilgrimage',
413+
'dialogue' => 'character ping-pong',
414+
'epilogue' => 'literary afterparty',
415+
'exposition' => 'backstory breadcrumbs',
416+
'first draft' => 'word vomit masterpiece',
417+
'flashback' => 'temporal boomerang',
418+
'literary device' => 'wordsmith multitool',
419+
'narrative' => 'tale trajectory',
420+
'plot hole' => 'story oopsie',
421+
'plot twist' => 'narrative pretzel',
422+
'prologue' => 'story appetizer',
423+
'protagonist' => 'trouble magnet',
424+
'subplot' => 'story side quest',
425+
'afternoon' => 'post-meridian jaunt',
426+
'constellation' => 'connect-the-stars doodle',
427+
'dimension' => 'reality flavor',
428+
'galaxy' => 'cosmic spiraly-whirly',
429+
'gravity' => 'universal clingy-ness',
430+
'infinity' => 'endless et cetera',
431+
'light year' => 'space marathon',
432+
'parallel universe' => 'reality neighbor',
433+
'quantum physics' => 'subatomic tomfoolery',
434+
'anti-hero' => 'morally flexible protagonist',
435+
'mentor' => 'wisdom dispenser',
436+
'artificial intelligence' => 'silicon smartypants',
437+
'social media' => 'digital popularity contest',
438+
'streaming service' => 'endless content waterfall',
439+
'viral' => 'internet famous adjacent',
440+
'Wi-Fi' => 'invisible knowledge tubes',
441+
'footnote' => 'page whisper',
442+
'hypothesis' => 'educated guess-timate',
443+
'peer review' => 'academic fact-checking party',
444+
'autocorrect' => 'automated word mangler',
445+
'backspace' => 'letter eating key',
446+
'font' => 'letter costume',
447+
'grammar checker' => 'sentence referee',
448+
'spell check' => 'typo detective',
449+
'word count' => 'verbose-o-meter',
450+
'epiphany' => 'brain lightning',
451+
'existential crisis' => 'reality maintenance check',
452+
'inspiration' => 'creativity lightning strike',
453+
'procrastination' => 'productive avoidance',
454+
'writers block' => 'creativity traffic jam',
455+
'fantasy' => 'dragons-and-magic soup',
456+
'horror' => 'spooky word collection',
457+
'romance' => 'heart-squeezy tale',
458+
'science fiction' => 'future speculation story',
459+
'consciousness' => 'reality subscription service',
460+
'philosophy' => 'professional pondering',
411461
}
412462

413463
OVERLOAD_WORDS_REPLACEMENTS = {
@@ -527,7 +577,7 @@ class ForumReplacementService < Service
527577
}
528578

529579
def self.replace_for(text, user)
530-
gremlins_phase = 1
580+
gremlins_phase = 0
531581
replaced_text = text.dup
532582

533583
# Page tag replacements
@@ -587,4 +637,4 @@ def self.replace_for(text, user)
587637
def self.wrapped(text, tooltip, color='blue')
588638
"<span class='#{color} lighten-5 tooltipped black-text' style='padding: 4px' data-tooltip='#{tooltip}'>#{text}</span>"
589639
end
590-
end
640+
end

app/views/document_revisions/index.html.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<tr>
1111
<th>Title</th>
1212
<th>Backed up</th>
13+
<th>Word Count</th>
1314
<th>Actions</th>
1415
</tr>
1516
</thead>
@@ -18,12 +19,14 @@
1819
<tr>
1920
<td><%= @document.title %></td>
2021
<td>Latest version</td>
22+
<td><%= @document.cached_word_count %></td>
2123
<td><%= link_to 'Edit document', edit_document_path(@document), class: 'btn' %></td>
2224
</tr>
2325
<% @document_revisions.each do |document_revision| %>
2426
<tr>
2527
<td><%= document_revision.title %></td>
2628
<td><span class="tooltipped" data-tooltip="Backed up at <%= document_revision.created_at %>"><%= time_ago_in_words document_revision.created_at %> ago</span></td>
29+
<td><%= document_revision.cached_word_count %></td>
2730
<td>
2831
<%= link_to 'View', document_document_revision_path(id: document_revision.id), class: 'btn' %>
2932
<%= link_to 'Delete', document_document_revision_path(document: @document, id: document_revision.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn red lighten-5 red-text' %>
@@ -32,5 +35,6 @@
3235
<% end %>
3336
</tbody>
3437
</table>
38+
<%= will_paginate @document_revisions %>
3539
</div>
3640
</div>

app/views/layouts/_common_head.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<%= render 'layouts/seo' %>
1414

1515
<%# todo: Is there a way to play nicer with thredded's jquery? %>
16-
<% unless request.env.fetch('REQUEST_PATH', '').start_with?('/forum') %>
16+
<% unless request.fullpath.start_with?('/forum') %>
1717
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ujs/1.2.2/rails.min.js" integrity="sha256-BbyWhCn0G+F6xbWJ2pcI5LnnpsnpSzyjJNVtl7ABp+M=" crossorigin="anonymous"></script>
1818
<% end %>
1919

app/views/layouts/application.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<html lang="en">
33
<head>
44
<%= render 'layouts/common_head' %>
5-
</head>
5+
<%= Sentry.get_trace_propagation_meta.html_safe %>
6+
</head>
67
<body data-in-app="true"
78
class="<%= controller_name %> <%= action_name %> <%= 'has-fixed-sidenav' if user_signed_in? %> <%= 'dark' if user_signed_in? && current_user.dark_mode_enabled? %>"
89
>

0 commit comments

Comments
 (0)