Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 86
- Log:
Initial import of I2, an Instiki clone.
- Author:
- adh
- Date:
- Mon Oct 16 10:40:36 +0100 2006
- Size:
- 2143 Bytes
- Properties:
- Property svn:executable is set
1 | #!/usr/local/bin/ruby |
2 | |
3 | require 'webrick' |
4 | require 'optparse' |
5 | |
6 | OPTIONS = { |
7 | :port => 3000, |
8 | :ip => "0.0.0.0", |
9 | :environment => "development", |
10 | :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"), |
11 | :server_type => WEBrick::SimpleServer, |
12 | :charset => "UTF-8", |
13 | :mime_types => WEBrick::HTTPUtils::DefaultMimeTypes |
14 | } |
15 | |
16 | ARGV.options do |opts| |
17 | script_name = File.basename($0) |
18 | opts.banner = "Usage: ruby #{script_name} [options]" |
19 | |
20 | opts.separator "" |
21 | |
22 | opts.on("-p", "--port=port", Integer, |
23 | "Runs Rails on the specified port.", |
24 | "Default: 3000") { |OPTIONS[:port]| } |
25 | opts.on("-b", "--binding=ip", String, |
26 | "Binds Rails to the specified ip.", |
27 | "Default: 0.0.0.0") { |OPTIONS[:ip]| } |
28 | opts.on("-e", "--environment=name", String, |
29 | "Specifies the environment to run this server under (test/development/production).", |
30 | "Default: development") { |OPTIONS[:environment]| } |
31 | opts.on("-m", "--mime-types=filename", String, |
32 | "Specifies an Apache style mime.types configuration file to be used for mime types", |
33 | "Default: none") { |mime_types_file| OPTIONS[:mime_types] = WEBrick::HTTPUtils::load_mime_types(mime_types_file) } |
34 | |
35 | opts.on("-d", "--daemon", |
36 | "Make Rails run as a Daemon (only works if fork is available -- meaning on *nix)." |
37 | ) { OPTIONS[:server_type] = WEBrick::Daemon } |
38 | |
39 | opts.on("-c", "--charset=charset", String, |
40 | "Set default charset for output.", |
41 | "Default: UTF-8") { |OPTIONS[:charset]| } |
42 | |
43 | opts.separator "" |
44 | |
45 | opts.on("-h", "--help", |
46 | "Show this help message.") { puts opts; exit } |
47 | |
48 | opts.parse! |
49 | end |
50 | |
51 | ENV["RAILS_ENV"] = OPTIONS[:environment] |
52 | require File.dirname(__FILE__) + "/../config/environment" |
53 | require 'webrick_server' |
54 | |
55 | OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT) |
56 | |
57 | puts "=> Rails application started on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}" |
58 | puts "=> Ctrl-C to shutdown server; call with --help for options" if OPTIONS[:server_type] == WEBrick::SimpleServer |
59 | DispatchServlet.dispatch(OPTIONS) |