bin/slidehero in slide_hero-0.0.7 vs bin/slidehero in slide_hero-0.0.8
- old
+ new
@@ -35,14 +35,14 @@
desc "serve FILENAME", "starts a server running your presentation on port 9292"
def serve(name = 'presentation.rb')
compile(name, '.tmp')
puts "Go checkout your awesome presentation at http://localhost:9292!"
- rackupPid = Process.spawn("rackup #{Gem.loaded_specs['slide_hero'].full_gem_path}/config.ru")
+ serverPid = Process.spawn("ruby -run -e httpd .tmp -p 9292")
last_update = Time.now
- loop do
+ loop do
if File.mtime(name) > last_update
puts "File change noted!"
puts "Recompiling"
move_slide_files(name, '.tmp')
last_update = File.mtime(name)
@@ -50,10 +50,10 @@
sleep 1
end
rescue Exception => e
puts e
- Process.kill(9, rackupPid) rescue Errno::ESRCH
+ Process.kill(9, serverPid) rescue Errno::ESRCH
remove_dir '.tmp'
puts "GOING DOWN!"
exit 0
end
end