Guard Livereload

Install live reloads rails views/assets using guard
Icons/chart bar
Used 81 times
Created by
F Fajarullah

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/X6ksg9"
Template Source

Review the code before running this template on your machine.

def add_gem(gem, **options)
  gem(gem, **options) unless Gem.loaded_specs.has_key?(gem)
end

gem_group :development do
  add_gem("guard-livereload", require: false)
  add_gem "rack-livereload"
end

Bundler.with_unbundled_env { run "bundle install" }
run "bundle exec guard init"
run "bundle binstub guard"

environment(
  "config.middleware.insert_after ActionDispatch::Static, Rack::LiveReload",
  env: "development"
)
Comments

Sign up or Login to leave a comment.