Skip to content

Instantly share code, notes, and snippets.

@jmlrt
Last active August 29, 2015 14:21
Show Gist options
  • Save jmlrt/a67e30bfa7f89be79a8a to your computer and use it in GitHub Desktop.
Save jmlrt/a67e30bfa7f89be79a8a to your computer and use it in GitHub Desktop.
Gem Web server Rakefile
# 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
#!/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
@jmlrt
Copy link
Author

jmlrt commented May 26, 2015

This is a Rakefile used to generate gem index and run a web server for gem in current directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment