Add livereload

pull/1/head
rebuilt 3 years ago
parent 4509c157fa
commit b915c61476

@ -1,104 +1,107 @@
source 'https://rubygems.org' source "https://rubygems.org"
ruby '3.2.1' ruby "3.2.1"
git_source(:github) do |repo_name| git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/') repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git" "https://github.com/#{repo_name}.git"
end end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.4' gem "rails", "~> 7.0.4"
gem 'sprockets-rails' gem "sprockets-rails"
gem 'pg' gem "pg"
# Use Puma as the app server # Use Puma as the app server
gem 'puma', '>= 5.6.4' gem "puma", ">= 5.6.4"
# Use Uglifier as compressor for JavaScript assets # Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0' gem "uglifier", ">= 1.3.0"
# See https://github.com/rails/execjs#readme for more supported runtimes # See https://github.com/rails/execjs#readme for more supported runtimes
# Use jquery as the JavaScript library # Use jquery as the JavaScript library
gem 'jquery-rails' gem "jquery-rails"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5' gem "jbuilder", "~> 2.5"
# Use Redis adapter to run Action Cable in production # Use Redis adapter to run Action Cable in production
gem 'redis', '~> 3.0' gem "redis", "~> 3.0"
# Use ActiveModel has_secure_password # Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7' # gem 'bcrypt', '~> 3.1.7'
gem 'nokogiri', '>= 1.13.4' gem "nokogiri", ">= 1.13.4"
gem 'bootsnap', require: false gem "bootsnap", require: false
gem 'haml' gem "haml"
gem 'friendly_id', '~> 5.1.0' gem "friendly_id", "~> 5.1.0"
gem 'newrelic_rpm' gem "newrelic_rpm"
gem 'devise' gem "devise"
gem 'omniauth' gem "omniauth"
gem 'twilio-ruby', '~> 4.11.1' gem "twilio-ruby", "~> 4.11.1"
gem 'activerecord-import' gem "activerecord-import"
gem 'jsbundling-rails' gem "jsbundling-rails"
gem 'cssbundling-rails' gem "cssbundling-rails"
gem 'turbo-rails' gem "turbo-rails"
gem 'stimulus-rails' gem "stimulus-rails"
gem 'watir' gem "watir"
gem 'selenium-webdriver', '~> 4.4' gem "selenium-webdriver", "~> 4.4"
gem 'net-sftp' gem "net-sftp"
gem 'ed25519' gem "ed25519"
gem 'bcrypt_pbkdf' gem "bcrypt_pbkdf"
gem 'standard_deviation' gem "standard_deviation"
group :development, :test do group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri gem "byebug", platform: :mri
gem 'factory_bot_rails' gem "factory_bot_rails"
gem 'parallel_tests' gem "parallel_tests"
gem 'rack-mini-profiler' gem "rack-mini-profiler"
gem 'rspec-rails', '~> 5.1.0' gem "rspec-rails", "~> 5.1.0"
gem 'debug', platforms: %i[mri mingw x64_mingw] gem "debug", platforms: %i[mri mingw x64_mingw]
end end
group :development do group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code. # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'brakeman' gem "brakeman"
gem 'bullet' gem "bullet"
gem 'erb_lint', require: false gem "erb_lint", require: false
gem 'erblint-github' gem "erblint-github"
gem 'guard-rspec', require: false gem "guard"
gem 'listen', '~> 3.0.5' gem "guard-rspec", require: false
gem 'nested_scaffold' gem "guard-livereload", "~> 2.5", require: false
gem "rack-livereload"
gem "listen", "~> 3.0.5"
gem "nested_scaffold"
# gem 'reek', require: false # gem 'reek', require: false
gem 'rubocop', require: false gem "rubocop", require: false
gem 'seed_dump' gem "seed_dump"
gem 'solargraph-reek' gem "solargraph-reek"
gem 'spring' gem "spring"
gem 'web-console' gem "web-console"
end end
group 'test' do group "test" do
gem 'apparition', github: 'twalpole/apparition', ref: 'ca86be4d54af835d531dbcd2b86e7b2c77f85f34' gem "apparition", github: "twalpole/apparition", ref: "ca86be4d54af835d531dbcd2b86e7b2c77f85f34"
gem 'capybara' gem "capybara"
gem 'database_cleaner' gem "database_cleaner"
gem 'launchy' gem "launchy"
gem 'rails-controller-testing' gem "rails-controller-testing"
gem 'simplecov', require: false gem "simplecov", require: false
gem 'timecop' gem "timecop"
end end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
gem 'reline', '~> 0.3.2' gem "reline", "~> 0.3.2"

@ -134,7 +134,10 @@ GEM
docile (1.4.0) docile (1.4.0)
e2mmap (0.1.0) e2mmap (0.1.0)
ed25519 (1.3.0) ed25519 (1.3.0)
erb_lint (0.4.0) em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
erb_lint (0.3.1)
activesupport activesupport
better_html (>= 2.0.1) better_html (>= 2.0.1)
parser (>= 2.7.1.4) parser (>= 2.7.1.4)
@ -143,6 +146,7 @@ GEM
smart_properties smart_properties
erblint-github (0.2.1) erblint-github (0.2.1)
erubi (1.12.0) erubi (1.12.0)
eventmachine (1.2.7)
execjs (2.8.1) execjs (2.8.1)
factory_bot (6.2.1) factory_bot (6.2.1)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
@ -165,6 +169,11 @@ GEM
shellany (~> 0.0) shellany (~> 0.0)
thor (>= 0.18.1) thor (>= 0.18.1)
guard-compat (1.2.1) guard-compat (1.2.1)
guard-livereload (2.5.2)
em-websocket (~> 0.5)
guard (~> 2.8)
guard-compat (~> 1.0)
multi_json (~> 1.8)
guard-rspec (4.7.3) guard-rspec (4.7.3)
guard (~> 2.1) guard (~> 2.1)
guard-compat (~> 1.1) guard-compat (~> 1.1)
@ -174,6 +183,7 @@ GEM
thor thor
tilt tilt
hashie (5.0.0) hashie (5.0.0)
http_parser.rb (0.8.0)
i18n (1.12.0) i18n (1.12.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
io-console (0.6.0) io-console (0.6.0)
@ -261,6 +271,8 @@ GEM
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.6.2) racc (1.6.2)
rack (2.2.6.4) rack (2.2.6.4)
rack-livereload (0.3.17)
rack
rack-mini-profiler (3.0.0) rack-mini-profiler (3.0.0)
rack (>= 1.2.0) rack (>= 1.2.0)
rack-protection (3.0.5) rack-protection (3.0.5)
@ -458,6 +470,8 @@ DEPENDENCIES
erblint-github erblint-github
factory_bot_rails factory_bot_rails
friendly_id (~> 5.1.0) friendly_id (~> 5.1.0)
guard
guard-livereload (~> 2.5)
guard-rspec guard-rspec
haml haml
jbuilder (~> 2.5) jbuilder (~> 2.5)
@ -473,6 +487,7 @@ DEPENDENCIES
parallel_tests parallel_tests
pg pg
puma (>= 5.6.4) puma (>= 5.6.4)
rack-livereload
rack-mini-profiler rack-mini-profiler
rails (~> 7.0.4) rails (~> 7.0.4)
rails-controller-testing rails-controller-testing

@ -68,3 +68,42 @@ guard :rspec, cmd: "bundle exec rspec" do
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance" Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
end end
end end
guard 'livereload' do
extensions = {
css: :css,
scss: :css,
sass: :css,
js: :js,
coffee: :js,
html: :html,
png: :png,
gif: :gif,
jpg: :jpg,
jpeg: :jpeg,
# less: :less, # uncomment if you want LESS stylesheets done in browser
}
rails_view_exts = %w(erb haml slim)
# file types LiveReload may optimize refresh for
compiled_exts = extensions.values.uniq
watch(%r{public/.+\.(#{compiled_exts * '|'})})
extensions.each do |ext, type|
watch(%r{
(?:app|vendor)
(?:/assets/\w+/(?<path>[^.]+) # path+base without extension
(?<ext>\.#{ext})) # matching extension (must be first encountered)
(?:\.\w+|$) # other extensions
}x) do |m|
path = m[1]
"/assets/#{path}.#{type}"
end
end
# file needing a full reload of the page anyway
watch(%r{app/views/.+\.(#{rails_view_exts * '|'})$})
watch(%r{app/helpers/.+\.rb})
watch(%r{config/locales/.+\.yml})
end

@ -1,12 +1,12 @@
Rails.application.configure do Rails.application.configure do
config.after_initialize do config.after_initialize do
Bullet.enable = true Bullet.enable = true
Bullet.alert = false Bullet.alert = false
Bullet.bullet_logger = true Bullet.bullet_logger = true
Bullet.console = true Bullet.console = true
# Bullet.growl = true # Bullet.growl = true
Bullet.rails_logger = true Bullet.rails_logger = true
Bullet.add_footer = true Bullet.add_footer = true
end end
# Settings specified here will take precedence over those in config/application.rb. # Settings specified here will take precedence over those in config/application.rb.
@ -71,4 +71,6 @@ Rails.application.configure do
config.file_watcher = ActiveSupport::EventedFileUpdateChecker config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.action_controller.include_all_helpers = false config.action_controller.include_all_helpers = false
config.middleware.insert_before Rack::Runtime, Rack::LiveReload
end end

Loading…
Cancel
Save