Skip to content

Commit

Permalink
HTTP server for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnall committed Dec 20, 2010
1 parent 9262130 commit 4814b1c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README
Expand Up @@ -120,3 +120,9 @@ Testing is done manually. Patches for automated testing are welcome. While
developing a change, use test/index.html to verify that the editor still works
as intended. When done with your change, do a build and use test/prod.html to
ensure that the minified version of NextEditor works as well.

Most of the time, using file:// URLs will do the trick. For the few times when
it won't, the following command will start a HTTP server that you can access at
http://localhost:3000/test/index.html

rake server
9 changes: 9 additions & 0 deletions Rakefile
Expand Up @@ -14,3 +14,12 @@ end

# Build everything by default.
task :default => 'bin/next_editor.min.js'

task :server do
require 'rubygems'
require 'webrick'

server = WEBrick::HTTPServer.new :Port => 3000, :DocumentRoot => '.'
['INT', 'TERM'].each { |signal| trap(signal) { server.shutdown } }
server.start
end

0 comments on commit 4814b1c

Please sign in to comment.