Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/DX-789-snyk-issues
Browse files Browse the repository at this point in the history
sunil-lakshman authored Jul 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents e5276fc + a73e8a5 commit a6add47
Showing 6 changed files with 174 additions and 113 deletions.
18 changes: 11 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -4,19 +4,20 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.7.8'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.2'

gem 'rails', '~> 7.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
gem 'puma', '~> 6.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.4', '>= 5.4.4'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
gem 'jbuilder', '~> 2.12'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
@@ -40,21 +41,24 @@ end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'

gem 'web-console', '>= 4.2.1'
gem 'listen', '~> 3.9'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'capybara', '>= 3.39'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'rubocop', '~> 0.89.1'
gem 'rubocop', '~> 0.89.1'

248 changes: 144 additions & 104 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,69 +1,89 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.6.1)
actionpack (= 6.0.6.1)
actioncable (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.6.1)
actionpack (= 6.0.6.1)
activejob (= 6.0.6.1)
activerecord (= 6.0.6.1)
activestorage (= 6.0.6.1)
activesupport (= 6.0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (>= 2.7.1)
actionmailer (6.0.6.1)
actionpack (= 6.0.6.1)
actionview (= 6.0.6.1)
activejob (= 6.0.6.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.6.1)
actionview (= 6.0.6.1)
activesupport (= 6.0.6.1)
rack (~> 2.0, >= 2.0.8)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.6.1)
actionpack (= 6.0.6.1)
activerecord (= 6.0.6.1)
activestorage (= 6.0.6.1)
activesupport (= 6.0.6.1)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.0.6.1)
activesupport (= 6.0.6.1)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.6.1)
activesupport (= 6.0.6.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
globalid (>= 0.3.6)
activemodel (6.0.6.1)
activesupport (= 6.0.6.1)
activerecord (6.0.6.1)
activemodel (= 6.0.6.1)
activesupport (= 6.0.6.1)
activestorage (6.0.6.1)
actionpack (= 6.0.6.1)
activejob (= 6.0.6.1)
activerecord (= 6.0.6.1)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
timeout (>= 0.4.0)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.4)
marcel (~> 1.0)
activesupport (6.0.6.1)
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.18.3)
msgpack (~> 1.2)
builder (3.3.0)
builder (3.2.4)
byebug (11.1.3)
capybara (3.39.2)
addressable
@@ -78,31 +98,36 @@ GEM
crass (1.0.6)
date (3.3.4)
erubi (1.13.0)

faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.17.0)
globalid (1.1.0)
activesupport (>= 5.0)
ffi (1.17.0-arm64-darwin)
globalid (1.2.1)
activesupport (>= 6.1)
graphlient (0.8.0)
faraday (~> 2.0)
graphql-client
graphql (2.3.9)
graphql (2.3.4)
base64
graphql-client (0.23.0)
graphql-client (0.22.0)
activesupport (>= 3.0)
graphql (>= 1.13.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)

io-console (0.7.2)
irb (1.13.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.12.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
@@ -113,12 +138,13 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.1.0)

mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.24.1)
minitest (5.23.1)
msgpack (1.7.2)
net-imap (0.4.14)
mutex_m (0.2.0)
net-imap (0.4.12)
date
net-protocol
net-pop (0.1.2)
@@ -128,58 +154,69 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.15.6)
mini_portile2 (~> 2.8.2)
nokogiri (1.15.6-arm64-darwin)
racc (~> 1.4)
parallel (1.25.1)
parser (3.3.4.0)
parallel (1.24.0)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
public_suffix (5.1.1)
puma (4.3.12)
psych (5.1.2)
stringio
public_suffix (5.0.5)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.8.0)
rack (2.2.9)
rack (3.0.11)
rack-proxy (0.7.7)
rack
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.0.6.1)
actioncable (= 6.0.6.1)
actionmailbox (= 6.0.6.1)
actionmailer (= 6.0.6.1)
actionpack (= 6.0.6.1)
actiontext (= 6.0.6.1)
actionview (= 6.0.6.1)
activejob (= 6.0.6.1)
activemodel (= 6.0.6.1)
activerecord (= 6.0.6.1)
activestorage (= 6.0.6.1)
activesupport (= 6.0.6.1)
bundler (>= 1.3.0)
railties (= 6.0.6.1)
sprockets-rails (>= 2.0.0)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
bundler (>= 1.15.0)
railties (= 7.1.3.4)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (6.0.6.1)
actionpack (= 6.0.6.1)
activesupport (= 6.0.6.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.2)
rexml (3.3.2)
strscan
reline (0.5.8)
io-console (~> 0.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rubocop (0.89.1)
parallel (~> 1.10)
parser (>= 2.7.1.1)
@@ -217,22 +254,23 @@ GEM
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets-rails (3.5.0)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sqlite3 (1.7.3)
mini_portile2 (~> 2.8.0)
stringio (3.1.0)
strscan (3.1.0)
thor (1.3.1)
thread_safe (0.3.6)
tilt (2.4.0)
tilt (2.3.0)
timeout (0.4.1)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.11)
thread_safe (~> 0.1)

tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (1.8.0)
web-console (4.2.1)
actionview (>= 6.0.0)
@@ -248,7 +286,9 @@ GEM
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket (1.2.11)

webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
@@ -262,12 +302,12 @@ PLATFORMS
DEPENDENCIES
bootsnap (>= 1.4.2)
byebug
capybara (>= 2.15)
capybara (>= 3.39)
graphlient
jbuilder (~> 2.7)
listen (>= 3.0.5, < 3.2)
puma (~> 4.1)
rails (~> 6.0.2, >= 6.0.2.2)
jbuilder (~> 2.12)
listen (~> 3.9)
puma (~> 6.1)
rails (~> 7.1)
rubocop (~> 0.89.1)
sass-rails (>= 6)
selenium-webdriver
@@ -276,7 +316,7 @@ DEPENDENCIES
sqlite3 (~> 1.4)
turbolinks (~> 5)
tzinfo-data
web-console (>= 3.3.0)
web-console (>= 4.2.1)
webdrivers
webpacker (~> 5.4, >= 5.4.4)

11 changes: 11 additions & 0 deletions app/controllers/errors_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# app/controllers/errors_controller.rb

class ErrorsController < ApplicationController
def not_found
render(status: 404)
end

def internal_server_error
render(status: 500)
end
end
4 changes: 2 additions & 2 deletions app/views/products/index.html.erb
Original file line number Diff line number Diff line change
@@ -18,9 +18,9 @@
<% all_product.items.each do |product| %>
<li>
<span class="thum-img moreBox blogBox">
<img src="<%= escape(product.featured_image_connection.edges[0].node.url) %>" alt="<%= escape(product.featured_image_connection.edges[0].node.filename) %>">
</span>

<%= image_tag product.featured_image_connection.edges[0].node.url, alt: product.featured_image_connection.edges[0].node.filename %>
</span>
<div class="thumbnail-detail">
<h3><a href="#"><%= product.title %> </a></h3>
</div>
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@

# Show full error reports and disable caching.
config.consider_all_requests_local = false

config.action_controller.perform_caching = false
config.cache_store = :null_store

5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -2,4 +2,9 @@
resources :products do
end
get '/', to: redirect('/products')

# Custom error routes
match '/404', to: 'errors#not_found', via: :all
match '/500', to: 'errors#internal_server_error', via: :all

end

0 comments on commit a6add47

Please sign in to comment.