mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
21 lines
No EOL
555 B
Ruby
21 lines
No EOL
555 B
Ruby
module Middleman::Features::LiveReload
|
|
class << self
|
|
def registered(app)
|
|
return unless Middleman::Server.environment == :development
|
|
|
|
begin
|
|
require 'livereload'
|
|
rescue LoadError
|
|
puts "Livereload not available. Install it with: gem install livereload"
|
|
end
|
|
|
|
new_config = ::LiveReload::Config.new do |config|
|
|
config.exts = ::Tilt.mappings.keys
|
|
end
|
|
|
|
# Middleman::Server.public
|
|
::LiveReload.run [Middleman::Server.views], new_config
|
|
end
|
|
alias :included :registered
|
|
end
|
|
end |