Sha256: 9a23f486387da7dec9d4e00f9ffe3a9b17449410b7bdad4b07c6704b85a72b3a
Contents?: true
Size: 999 Bytes
Versions: 3
Compression:
Stored size: 999 Bytes
Contents
#!/usr/bin/env ruby $LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__)) require 'rubygems' require 'rack' require 'web_tools' # HACK ARGV.each do |arg| ARGV.shift mirror_api = ARGV.first if arg == "-t" end mirror_api ||= RUBY_ENGINE begin require "#{mirror_api.downcase}/reflection" MirrorAPI = Object.const_get(mirror_api.capitalize) rescue LoadError require "ruby/reflection" MirrorAPI = Ruby end # HACK END ;) app = Rack::Builder.new do WebTools::UI.set :root, File.expand_path("../..", __FILE__) ui = WebTools::UI.new WebTools.constants.each { |c| WebTools.const_get(c) } redirect = proc { |env| [301, {'Content-Type' => 'text/html', 'Location' => '/webtools/'}, '<a href="/webtools">Moved permanently</a>'] } WebTools::Tool.subclasses.each do |cls| map('/webtools/' + cls.display_name) { run cls.new } end map('/webtools/') { run ui } map('/') { run redirect } end Rack::Handler.default.run(app, :Port => 9292)
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
maglev-webtools-1.0.2 | bin/webtools |
maglev-webtools-1.0.1 | bin/webtools |
maglev-webtools-1.0 | bin/webtools |