Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dev_to/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ x-app: &app
environment: &env
NODE_ENV: ${NODE_ENV:-development}
RAILS_ENV: ${RAILS_ENV:-development}
RACK_ENV: ${RACK_ENV:-development}
tmpfs:
- /tmp
- /app/tmp/pids
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ package-lock.json

#sitemap
/public/sitemap.xml.gz

#newrelic
newrelic-infra/newrelic-infra.yml
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.1
3.4.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

3 changes: 3 additions & 0 deletions Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ variable :ALGOLIASEARCH_API_KEY, :String, default: only_in_test
variable :ALGOLIASEARCH_APPLICATION_ID, :String, default: only_in_test
variable :ALGOLIASEARCH_SEARCH_ONLY_KEY, :String, default: only_in_test

# NewRelic
variable :NEW_RELIC_LICENSE_KEY, :String, default: "Optional"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


# AWS for images storages
variable :AWS_ID, :String, default: "Optional"
variable :AWS_SECRET, :String, default: "Optional"
Expand Down
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ group :production do
gem "nakayoshi_fork"
end

gem 'newrelic_rpm'
gem 'newrelic-infinite_tracing'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

gem 'rack-mini-profiler'

gem "psych", "< 4"
gem "skylight"

Expand Down Expand Up @@ -105,7 +109,7 @@ gem "validate_url", "~> 1.0"
gem "webpacker", "~> 3.6"
gem "webpush", "~> 0.3"

group :development do
group :development, :local_production do
gem "better_errors", "~> 2.5"
gem "binding_of_caller", "~> 0.8"
gem "brakeman", "~> 4.4", require: false
Expand All @@ -119,7 +123,7 @@ group :development do
gem "web-console", "~> 3.7"
end

group :development, :test do
group :development, :test, :local_production do
gem "capybara", "~> 3.13"
gem "derailed", "~> 0.1"
gem "erb_lint", "~> 0.0", require: false
Expand Down
23 changes: 23 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,22 @@ GEM
google-apis-core (>= 0.11.0, < 2.a)
google-apis-discovery_v1 (~> 0.5)
thor (>= 0.20, < 2.a)
google-protobuf (3.25.6-aarch64-linux)
google-protobuf (3.25.6-x86_64-linux)
googleapis-common-protos-types (1.18.0)
google-protobuf (>= 3.18, < 5.a)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.65.2-aarch64-linux)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.65.2-x86_64-linux)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
guard (2.19.1)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
Expand Down Expand Up @@ -646,9 +656,16 @@ GEM
net-smtp (0.5.1)
net-protocol
netrc (0.11.0)
newrelic-infinite_tracing (9.17.0)
google-protobuf (< 4.0)
grpc (~> 1.34)
newrelic_rpm (= 9.17.0)
newrelic_rpm (9.17.0)
nio4r (2.7.4)
nokogiri (1.15.7-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.7-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
Expand Down Expand Up @@ -726,6 +743,8 @@ GEM
rack (2.2.11)
rack-host-redirect (1.3.0)
rack
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-protection (2.2.4)
rack
rack-proxy (0.7.7)
Expand Down Expand Up @@ -1011,6 +1030,7 @@ GEM

PLATFORMS
aarch64-linux
x86_64-linux

DEPENDENCIES
actionpack-action_caching (~> 1.2)
Expand Down Expand Up @@ -1081,6 +1101,8 @@ DEPENDENCIES
liquid (~> 4.0)
memory_profiler (~> 0.9)
nakayoshi_fork
newrelic-infinite_tracing
newrelic_rpm
nokogiri (~> 1.10)
octokit (~> 4.13)
omniauth (~> 1.9)
Expand All @@ -1098,6 +1120,7 @@ DEPENDENCIES
pusher (~> 1.3)
pusher-push-notifications (~> 1.0)
rack-host-redirect (~> 1.3)
rack-mini-profiler
rack-timeout (~> 0.5)
rails (~> 5.1.6)
rails-assets-airbrake-js-client (~> 1.5)!
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def icon_url(name)
end

def cloudinary(url, width = nil, _quality = 80, _format = "jpg")
return url if Rails.env.development? && (url.blank? || url.exclude?("http"))
return url if (Rails.env.development? || Rails.env.local_production?) && (url.blank? || url.exclude?("http"))

service_path = "https://res.cloudinary.com/practicaldev/image/fetch"

Expand All @@ -101,7 +101,7 @@ def cloudinary(url, width = nil, _quality = 80, _format = "jpg")
def cloud_cover_url(url)
return if url.blank?
return asset_path("triple-unicorn") if Rails.env.test?
return url if Rails.env.development?
return url if (Rails.env.development? || Rails.env.local_production?)

width = 1000
height = 420
Expand Down
2 changes: 1 addition & 1 deletion app/observers/article_observer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ArticleObserver < ApplicationObserver
def after_save(article)
return if Rails.env.development?
return if (Rails.env.development? || Rails.env.local_production?)

if article.published && article.published_at > 30.seconds.ago
SlackBot.delay.ping "New Article Published: #{article.title}\nhttps://dev.to#{article.path}",
Expand Down
2 changes: 1 addition & 1 deletion app/observers/comment_observer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CommentObserver < ApplicationObserver
def after_save(comment)
return if Rails.env.development?
return if (Rails.env.development? || Rails.env.local_production?)

warned_user_ping(comment)
rescue StandardError
Expand Down
2 changes: 1 addition & 1 deletion app/observers/organization_observer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class OrganizationObserver < ActiveRecord::Observer
def after_create(organization)
return if Rails.env.development?
return if (Rails.env.development? || Rails.env.local_production?)

SlackBot.delay.ping(
"New Org Created: #{organization.name}\nhttps://dev.to/#{organization.username}",
Expand Down
4 changes: 3 additions & 1 deletion app/views/stories/_main_stories_feed.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
<% if !user_signed_in? && i == 4 %>
<%= render "stories/sign_in_invitation" %>
<% end %>
<%= render "articles/single_story", story: story %>
<% cache story do %>
<%= render "articles/single_story", story: story %>
<% end %>
<% end %>
<% end %>
<% if @stories.size > 1 %>
Expand Down
Loading