1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/lib/middleman/features/live_reload.rb
2010-09-21 18:30:17 -07:00

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