Sha256: 75b2ca01ce250ead304633e7091a2cc25254e8c45331bf9dfc5aa35a3aa881dd

Contents?: true

Size: 981 Bytes

Versions: 3

Compression:

Stored size: 981 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
guard-livereload-2.5.2 lib/guard/livereload/templates/Guardfile
guard-livereload-2.5.1 lib/guard/livereload/templates/Guardfile
guard-livereload-2.5.0 lib/guard/livereload/templates/Guardfile