Last active
August 29, 2015 14:21
-
-
Save jmlrt/a67e30bfa7f89be79a8a to your computer and use it in GitHub Desktop.
Gem Web server Rakefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rakefile | |
# use web.rb to run web server | |
task generate: [:clean] do | |
sh "gem generate_index --no-modern -d ." | |
end | |
task :clean do | |
sh "rm -fr latest_specs.4.8* prerelease_specs.4.8* quick specs.4.8*" | |
end | |
task :webserver do | |
ruby "./web.rb" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# web.rb | |
require 'webrick' | |
root = File.expand_path '.' | |
server = WEBrick::HTTPServer.new :Port => 8808, :DocumentRoot => root | |
trap 'INT' do server.shutdown end | |
server.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a Rakefile used to generate gem index and run a web server for gem in current directory