clone 1.0.0.alpha → 1.0.0.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Gemfile +1 -0
- data/LICENSE.txt +22 -0
- data/README.md +22 -1
- data/VERSION +1 -1
- data/bin/clone +7 -0
- data/clone.gemspec +4 -0
- data/docs/readme +16 -0
- data/docs/readme.txt +5 -0
- data/lib/clone.rb +13 -2
- data/lib/clone/config/config.rb +19 -0
- data/lib/clone/config/config.yml +22 -0
- data/lib/clone/config/default_config.yml +20 -0
- data/lib/clone/config/require.rb +3 -0
- data/lib/clone/config/version.rb +10 -0
- data/lib/clone/config/yml.rb +22 -0
- data/lib/clone/config/z_defaults.rb +28 -0
- data/lib/clone/generator/engine.rb +581 -0
- data/lib/clone/generator/terminal.rb +104 -0
- data/lib/clone/helpers/helper_methods.rb +251 -0
- data/lib/clone/helpers/local_methods.rb +150 -0
- data/lib/clone/helpers/require.rb +37 -0
- data/module/Marshal.4.8 +0 -0
- data/module/Marshal.4.8.Z +0 -0
- data/module/gems/commander-4.1.3/.gitignore +6 -0
- data/module/gems/commander-4.1.3/.travis.yml +11 -0
- data/module/gems/commander-4.1.3/DEVELOPMENT +15 -0
- data/module/gems/commander-4.1.3/Gemfile +3 -0
- data/module/gems/commander-4.1.3/History.rdoc +345 -0
- data/module/gems/commander-4.1.3/Manifest +38 -0
- data/module/gems/commander-4.1.3/README.rdoc +375 -0
- data/module/gems/commander-4.1.3/Rakefile +10 -0
- data/module/gems/commander-4.1.3/bin/commander +55 -0
- data/module/gems/commander-4.1.3/commander.gemspec +26 -0
- data/module/gems/commander-4.1.3/lib/commander.rb +32 -0
- data/module/gems/commander-4.1.3/lib/commander/blank.rb +8 -0
- data/module/gems/commander-4.1.3/lib/commander/command.rb +213 -0
- data/module/gems/commander-4.1.3/lib/commander/core_ext.rb +3 -0
- data/module/gems/commander-4.1.3/lib/commander/core_ext/array.rb +26 -0
- data/module/gems/commander-4.1.3/lib/commander/core_ext/object.rb +11 -0
- data/module/gems/commander-4.1.3/lib/commander/delegates.rb +13 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters.rb +8 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/base.rb +18 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal.rb +20 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/command_help.erb +35 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/help.erb +36 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact.rb +12 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/command_help.erb +27 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/help.erb +29 -0
- data/module/gems/commander-4.1.3/lib/commander/import.rb +10 -0
- data/module/gems/commander-4.1.3/lib/commander/platform.rb +8 -0
- data/module/gems/commander-4.1.3/lib/commander/runner.rb +411 -0
- data/module/gems/commander-4.1.3/lib/commander/user_interaction.rb +521 -0
- data/module/gems/commander-4.1.3/lib/commander/version.rb +3 -0
- data/module/gems/commander-4.1.3/spec/command_spec.rb +157 -0
- data/module/gems/commander-4.1.3/spec/core_ext/array_spec.rb +20 -0
- data/module/gems/commander-4.1.3/spec/core_ext/object_spec.rb +21 -0
- data/module/gems/commander-4.1.3/spec/help_formatters/terminal_spec.rb +67 -0
- data/module/gems/commander-4.1.3/spec/runner_spec.rb +526 -0
- data/module/gems/commander-4.1.3/spec/spec_helper.rb +59 -0
- data/module/gems/commander-4.1.3/spec/ui_spec.rb +30 -0
- data/module/gems/hello.rb +1 -0
- data/module/gems/highline-1.6.19/.gitignore +2 -0
- data/module/gems/highline-1.6.19/AUTHORS +3 -0
- data/module/gems/highline-1.6.19/CHANGELOG +346 -0
- data/module/gems/highline-1.6.19/COPYING +340 -0
- data/module/gems/highline-1.6.19/INSTALL +55 -0
- data/module/gems/highline-1.6.19/LICENSE +7 -0
- data/module/gems/highline-1.6.19/README.rdoc +63 -0
- data/module/gems/highline-1.6.19/Rakefile +50 -0
- data/module/gems/highline-1.6.19/TODO +6 -0
- data/module/gems/highline-1.6.19/examples/ansi_colors.rb +38 -0
- data/module/gems/highline-1.6.19/examples/asking_for_arrays.rb +18 -0
- data/module/gems/highline-1.6.19/examples/basic_usage.rb +75 -0
- data/module/gems/highline-1.6.19/examples/color_scheme.rb +32 -0
- data/module/gems/highline-1.6.19/examples/get_character.rb +12 -0
- data/module/gems/highline-1.6.19/examples/limit.rb +12 -0
- data/module/gems/highline-1.6.19/examples/menus.rb +65 -0
- data/module/gems/highline-1.6.19/examples/overwrite.rb +19 -0
- data/module/gems/highline-1.6.19/examples/page_and_wrap.rb +322 -0
- data/module/gems/highline-1.6.19/examples/password.rb +7 -0
- data/module/gems/highline-1.6.19/examples/repeat_entry.rb +21 -0
- data/module/gems/highline-1.6.19/examples/trapping_eof.rb +22 -0
- data/module/gems/highline-1.6.19/examples/using_readline.rb +17 -0
- data/module/gems/highline-1.6.19/highline.gemspec +37 -0
- data/module/gems/highline-1.6.19/lib/highline.rb +1012 -0
- data/module/gems/highline-1.6.19/lib/highline/color_scheme.rb +134 -0
- data/module/gems/highline-1.6.19/lib/highline/compatibility.rb +16 -0
- data/module/gems/highline-1.6.19/lib/highline/import.rb +41 -0
- data/module/gems/highline-1.6.19/lib/highline/menu.rb +398 -0
- data/module/gems/highline-1.6.19/lib/highline/question.rb +475 -0
- data/module/gems/highline-1.6.19/lib/highline/simulate.rb +48 -0
- data/module/gems/highline-1.6.19/lib/highline/string_extensions.rb +131 -0
- data/module/gems/highline-1.6.19/lib/highline/style.rb +181 -0
- data/module/gems/highline-1.6.19/lib/highline/system_extensions.rb +222 -0
- data/module/gems/highline-1.6.19/setup.rb +1360 -0
- data/module/gems/highline-1.6.19/site/.cvsignore +1 -0
- data/module/gems/highline-1.6.19/site/highline.css +65 -0
- data/module/gems/highline-1.6.19/site/images/logo.png +0 -0
- data/module/gems/highline-1.6.19/site/index.html +58 -0
- data/module/gems/highline-1.6.19/test/string_methods.rb +32 -0
- data/module/gems/highline-1.6.19/test/tc_color_scheme.rb +96 -0
- data/module/gems/highline-1.6.19/test/tc_highline.rb +1128 -0
- data/module/gems/highline-1.6.19/test/tc_import.rb +52 -0
- data/module/gems/highline-1.6.19/test/tc_menu.rb +439 -0
- data/module/gems/highline-1.6.19/test/tc_string_extension.rb +20 -0
- data/module/gems/highline-1.6.19/test/tc_string_highline.rb +38 -0
- data/module/gems/highline-1.6.19/test/tc_style.rb +567 -0
- data/module/gems/highline-1.6.19/test/ts_all.rb +16 -0
- data/module/latest_specs.4.8 +0 -0
- data/module/latest_specs.4.8.gz +0 -0
- data/module/prerelease_specs.4.8 +0 -0
- data/module/prerelease_specs.4.8.gz +0 -0
- data/module/specs.4.8 +0 -0
- data/module/specs.4.8.gz +0 -0
- data/samples/blather/restlike/Gemfile +4 -0
- data/samples/blather/restlike/cmd.yml +1 -0
- data/samples/blather/restlike/lib/blather.rb +9 -0
- data/samples/blather/restlike/lib/blather/dsl/api.rb +78 -0
- data/samples/blather/restlike/lib/blather/dsl/call.rb +13 -0
- data/samples/blather/restlike/lib/blather/dsl/client.rb +58 -0
- data/samples/blather/restlike/lib/blather/dsl/config.rb +11 -0
- data/samples/blather/restlike/lib/blather/dsl/extraDSL.rb +163 -0
- data/samples/blather/restlike/lib/blather/meta/require.rb +8 -0
- data/samples/blather/restlike/lib/blather/meta/xmpp.yml +5 -0
- data/samples/blather/restlike/lib/blather/vendors/xmpp_default.rb +27 -0
- data/samples/blather/restlike/readme +2 -0
- data/samples/grape/init/Gemfile +2 -0
- data/samples/grape/init/cmd.yml +3 -0
- data/samples/grape/init/config.ru +2 -0
- data/samples/grape/init/docs/grape/documentation.txt +939 -0
- data/samples/grape/init/docs/grape/generate_rest_routes.rb +37 -0
- data/samples/grape/init/docs/grape/ls_routes.rb +31 -0
- data/samples/grape/init/lib/grape.rb +4 -0
- data/samples/grape/init/lib/grape/meta/subclasses.rb +20 -0
- data/samples/grape/init/lib/grape/xpath/app.rb +30 -0
- data/samples/grape/init/lib/grape/xpath/ruotes.rb +6 -0
- data/samples/grape/init/readme +1 -0
- data/samples/grape/readme +29 -0
- data/samples/grape/vendor/lib/grape/vendors/v1/rest.rb +57 -0
- data/samples/mongoid/cmd.yml +1 -0
- data/samples/mongoid/init/Gemfile +3 -0
- data/samples/mongoid/init/cmd.yml +2 -0
- data/samples/mongoid/init/docs/mongoid/ModelsRelations.rb +11 -0
- data/samples/mongoid/init/docs/mongoid/documents.xls +0 -0
- data/samples/mongoid/init/docs/mongoid/generate_modelsToDocs.rb +25 -0
- data/samples/mongoid/init/docs/mongoid/modelsToDocs.rb +25 -0
- data/samples/mongoid/init/docs/mongoid/relations.txt +1354 -0
- data/samples/mongoid/init/lib/mongoid.rb +44 -0
- data/samples/mongoid/init/lib/mongoid/dsl/extraDSL_CRUD.rb +446 -0
- data/samples/mongoid/init/lib/mongoid/dsl/extraDSL_MP.rb +517 -0
- data/samples/mongoid/init/lib/mongoid/dsl/init.rb +37 -0
- data/samples/mongoid/init/lib/mongoid/dsl/params.rb +67 -0
- data/samples/mongoid/init/lib/mongoid/meta/banned.rb +147 -0
- data/samples/mongoid/init/lib/mongoid/meta/control.yml +13 -0
- data/samples/mongoid/init/lib/mongoid/meta/mongoid.yml +6 -0
- data/samples/mongoid/init/lib/mongoid/meta/mpatch.rb +14 -0
- data/samples/mongoid/model/lib/mongoid/models/model.rb +28 -0
- data/samples/mongoid/readme +33 -0
- data/samples/rack/init/Gemfile +10 -0
- data/samples/rack/init/cmd.yml +2 -0
- data/samples/rack/init/config.ru +1 -0
- data/samples/rack/init/docs/rack/rake introducing.txt +60 -0
- data/samples/rack/init/docs/rack/webservers/Thin +43 -0
- data/samples/rack/init/docs/rack/webservers/ebb +72 -0
- data/samples/rack/init/docs/rack/webservers/fcgi +103 -0
- data/samples/rack/init/docs/rack/webservers/mongrel +74 -0
- data/samples/rack/init/docs/rack/webservers/passenger +37 -0
- data/samples/rack/init/docs/rack/webservers/scgi +188 -0
- data/samples/rack/init/lib/rack.rb +1 -0
- data/samples/rack/init/lib/rack/meta/webserver/thin.rb +45 -0
- data/samples/rack/init/lib/rack/meta/webserver/thin.yml +6 -0
- data/samples/rack/init/server.rb +0 -0
- data/samples/rack/readme +13 -0
- data/samples/rest_client/init/Gemfile +5 -0
- data/samples/rest_client/init/boot.rb +2 -0
- data/samples/rest_client/init/cmd.yml +1 -0
- data/samples/rest_client/init/config/rest_client/defaults.rb +16 -0
- data/samples/rest_client/init/docs/rest_client/simple overlook +251 -0
- data/samples/rest_client/init/test/rest_client/rest_dsl.rb +5 -0
- data/samples/rest_client/readme +7 -0
- data/samples/scripts/lines_counter/lines_number.rb +32 -0
- data/samples/scripts/lines_counter/readme +5 -0
- data/samples/scripts/readme +1 -0
- metadata +197 -7
- data/lib/clone/cms.rb +0 -56
- data/lib/clone/ext.rb +0 -77
- data/sample/test.rb +0 -30
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
(this is only for HEAD - old docs are found in the git repo)
|
|
2
|
+
|
|
3
|
+
# A Web Server Called *Ebb*
|
|
4
|
+
|
|
5
|
+
Ebb aims to be a small and fast web server specifically for hosting
|
|
6
|
+
dynamic Ruby language web applications.
|
|
7
|
+
|
|
8
|
+
It is a binding to [libebb](http://tinyclouds.org/libebb)
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
The Ruby binding is available as a Ruby Gem. It can be install by executing
|
|
13
|
+
|
|
14
|
+
gem install ebb
|
|
15
|
+
|
|
16
|
+
If you want SSL support you must install GnuTLS.
|
|
17
|
+
Ebb has no other dependencies.
|
|
18
|
+
|
|
19
|
+
## Running
|
|
20
|
+
|
|
21
|
+
Use Ebb.start_server()
|
|
22
|
+
|
|
23
|
+
## Speed
|
|
24
|
+
|
|
25
|
+
(these stats are out of date)
|
|
26
|
+
|
|
27
|
+
Because Ebb handles most of the processing in C, it is able to do work
|
|
28
|
+
often times more efficiently than other Ruby language web servers.
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
Ebb-Ruby can handle threaded processing better than the other 'evented'
|
|
33
|
+
servers. This won't be of any benefit to Rails applications because Rails
|
|
34
|
+
places a lock around each request that wouldn't allow concurrent processing
|
|
35
|
+
anyway. In Merb, for example, Ebb's thread handling will allow Ebb instances
|
|
36
|
+
to handle larger loads. [More](http://four.livejournal.com/848525.html)
|
|
37
|
+
|
|
38
|
+
## Contributions
|
|
39
|
+
|
|
40
|
+
Contributions (patches, criticism, advice) are very welcome!
|
|
41
|
+
Please send all to to
|
|
42
|
+
[the mailing list](http://groups.google.com/group/ebbebb).
|
|
43
|
+
|
|
44
|
+
The source code is hosted [github](http://github.com/ry/ebb/tree/master). It
|
|
45
|
+
can be retrieved by executing
|
|
46
|
+
|
|
47
|
+
git clone git://github.com/ry/ebb.git
|
|
48
|
+
|
|
49
|
+
## (The MIT) License
|
|
50
|
+
|
|
51
|
+
Copyright (c) 2008 [Ryah Dahl](http://tinyclouds.org) (ry at tiny clouds dot org)
|
|
52
|
+
|
|
53
|
+
<div id="license">
|
|
54
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
55
|
+
a copy of this software and associated documentation files (the
|
|
56
|
+
"Software"), to deal in the Software without restriction, including
|
|
57
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
58
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
59
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
60
|
+
the following conditions:
|
|
61
|
+
|
|
62
|
+
The above copyright notice and this permission notice shall be
|
|
63
|
+
included in all copies or substantial portions of the Software.
|
|
64
|
+
|
|
65
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
66
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
67
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
68
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
69
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
70
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
71
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
72
|
+
</div>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
fcgi - FastCGI library for Ruby
|
|
2
|
+
Version 0.9.0
|
|
3
|
+
|
|
4
|
+
Depends
|
|
5
|
+
|
|
6
|
+
C version
|
|
7
|
+
|
|
8
|
+
* ((<libfcgi|URL:http://www.fastcgi.com/#TheDevKit>))(FastCGI Developer's Kit)
|
|
9
|
+
Pure Ruby Version
|
|
10
|
+
|
|
11
|
+
* StringIO
|
|
12
|
+
Install
|
|
13
|
+
|
|
14
|
+
$ gem install fcgi
|
|
15
|
+
(Pure Ruby Version: gem install fcgi -- --without-ext)
|
|
16
|
+
(With custom FCGI lib paths: gem install fcgi -- --with-fcgi-include=/usr/local/include --with-fcgi-lib=/usr/local/lib)
|
|
17
|
+
Usage
|
|
18
|
+
|
|
19
|
+
Class Method
|
|
20
|
+
|
|
21
|
+
— FCGI.accept
|
|
22
|
+
|
|
23
|
+
Returns FCGI instance
|
|
24
|
+
— FCGI.each
|
|
25
|
+
|
|
26
|
+
— FCGI.each_request
|
|
27
|
+
|
|
28
|
+
— FCGI.is_cgi?
|
|
29
|
+
|
|
30
|
+
— FCGI.each_cgi
|
|
31
|
+
|
|
32
|
+
Automatically detects whether this program is running under the FastCGI
|
|
33
|
+
environment, and generates a 'CGI' type object for each request. Also
|
|
34
|
+
installs signal handlers for graceful handling of SIGPIPE (which may
|
|
35
|
+
occur if a client gives up on a request before it is complete) and
|
|
36
|
+
SIGUSR1 (generated by Apache for a 'graceful' exit)
|
|
37
|
+
|
|
38
|
+
If you are using the HTML output methods you can also pass the HTML type
|
|
39
|
+
e.g. FCGI.each_cgi('html3') do ... end
|
|
40
|
+
|
|
41
|
+
However, you should beware that the CGI library is quite slow when
|
|
42
|
+
used in this way, as it dynamically adds a large number of methods
|
|
43
|
+
to itself each time a new instance is created.
|
|
44
|
+
Instance Method
|
|
45
|
+
|
|
46
|
+
— FCGI#finish
|
|
47
|
+
|
|
48
|
+
Finish
|
|
49
|
+
— FCGI#in
|
|
50
|
+
|
|
51
|
+
Returns Stream or StringIO
|
|
52
|
+
— FCGI#out
|
|
53
|
+
|
|
54
|
+
Returns Stream or StringIO
|
|
55
|
+
— FCGI#err
|
|
56
|
+
|
|
57
|
+
Returns Stream or StringIO
|
|
58
|
+
— FCGI#env
|
|
59
|
+
|
|
60
|
+
Returns Environment(Hash)
|
|
61
|
+
Sample
|
|
62
|
+
|
|
63
|
+
Using the FastCGI native interface:
|
|
64
|
+
|
|
65
|
+
#!/usr/bin/ruby
|
|
66
|
+
require "fcgi"
|
|
67
|
+
|
|
68
|
+
FCGI.each {|request|
|
|
69
|
+
out = request.out
|
|
70
|
+
out.print "Content-Type: text/plain\r\n"
|
|
71
|
+
out.print "\r\n"
|
|
72
|
+
out.print Time.now.to_s
|
|
73
|
+
request.finish
|
|
74
|
+
}
|
|
75
|
+
Using the CGI-compatible interface, which works both as a standalone CGI and under FastCGI with no modifications:
|
|
76
|
+
|
|
77
|
+
#!/usr/bin/ruby
|
|
78
|
+
require "fcgi"
|
|
79
|
+
|
|
80
|
+
FCGI.each_cgi {|cgi|
|
|
81
|
+
name = cgi['name'][0]
|
|
82
|
+
puts cgi.header
|
|
83
|
+
puts "You are #{name} " if name
|
|
84
|
+
puts "Connecting from #{cgi.remote_addr}"
|
|
85
|
+
}
|
|
86
|
+
Note: you can’t reference CGI environment variables using ENV when under FastCGI. It is recommended that you use the CGI-generated methods, e.g. cgi.remote_addr as above.
|
|
87
|
+
|
|
88
|
+
If you need to access environment variables directly, perhaps extra ones set in your Apache config, then use cgi.env_table[‘REMOTE_ADDR’] instead. This isn’t quite as portable because env_table is a private method in the standard CGI library.
|
|
89
|
+
|
|
90
|
+
License
|
|
91
|
+
|
|
92
|
+
((<URL:www.ruby-lang.org/ja/LICENSE.txt>)) (Japanese)
|
|
93
|
+
|
|
94
|
+
((<URL:www.ruby-lang.org/en/LICENSE.txt>)) (English)
|
|
95
|
+
|
|
96
|
+
Copyright
|
|
97
|
+
|
|
98
|
+
fcgi.c 0.1 Copyright (C) 1998-1999 Network Applied Communication Laboratory, Inc.
|
|
99
|
+
0.8 Copyright (C) 2002 MoonWolf <moonwolf@moonwolf.com>
|
|
100
|
+
|
|
101
|
+
fastcgi.rb 0.7 Copyright (C) 2001 Eli Green
|
|
102
|
+
fcgi.rb 0.8 Copyright (C) 2002 MoonWolf <moonwolf@moonwolf.com>
|
|
103
|
+
fcgi.rb 0.8.5 Copyright (C) 2004 Minero Aoki
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
= Mongrel: Simple Fast Mostly Ruby Web Server
|
|
2
|
+
|
|
3
|
+
Mongrel is a small library that provides a very fast HTTP 1.1 server for Ruby web applications. It is not particular to any framework, and is intended to be just enough to get a web application running behind a more complete and robust web server.
|
|
4
|
+
|
|
5
|
+
What makes Mongrel so fast is the careful use of an Ragel extension to provide fast, accurate HTTP 1.1 protocol parsing. This makes the server scream without too many portability issues.
|
|
6
|
+
|
|
7
|
+
See http://mongrel.rubyforge.org for more information.
|
|
8
|
+
|
|
9
|
+
== License
|
|
10
|
+
|
|
11
|
+
Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under the Ruby license and the GPL2. See the include LICENSE file for details.
|
|
12
|
+
|
|
13
|
+
== Quick Start
|
|
14
|
+
|
|
15
|
+
The easiest way to get started with Mongrel is to install it via RubyGems and then run a Ruby on Rails application. You can do this easily:
|
|
16
|
+
|
|
17
|
+
$ gem install mongrel
|
|
18
|
+
|
|
19
|
+
Now you should have the mongrel_rails command available in your PATH, so just do the following:
|
|
20
|
+
|
|
21
|
+
$ cd myrailsapp
|
|
22
|
+
$ mongrel_rails start
|
|
23
|
+
|
|
24
|
+
This will start it in the foreground so you can play with it. It runs your application in production mode. To get help do:
|
|
25
|
+
|
|
26
|
+
$ mongrel_rails start -h
|
|
27
|
+
|
|
28
|
+
Finally, you can then start in background mode:
|
|
29
|
+
|
|
30
|
+
$ mongrel_rails start -d
|
|
31
|
+
|
|
32
|
+
And you can stop it whenever you like with:
|
|
33
|
+
|
|
34
|
+
$ mongrel_rails stop
|
|
35
|
+
|
|
36
|
+
All of which should be done from your application's directory. It writes the PID of the process you ran into log/mongrel.pid.
|
|
37
|
+
|
|
38
|
+
There are also many more new options for configuring the rails runner including changing to a different directory, adding more MIME types, and setting processor threads and timeouts.
|
|
39
|
+
|
|
40
|
+
== Install
|
|
41
|
+
|
|
42
|
+
It doesn't explicitly require Camping, but if you want to run the examples/camping/ examples then you'll need to install Camping 1.2 at least (and redcloth I think). These are all available from RubyGems.
|
|
43
|
+
|
|
44
|
+
The library consists of a C extension so you'll need a C compiler or at least a friend who can build it for you.
|
|
45
|
+
|
|
46
|
+
Finally, the source includes a setup.rb for those who hate RubyGems.
|
|
47
|
+
|
|
48
|
+
== Usage
|
|
49
|
+
|
|
50
|
+
The examples/simpletest.rb file has the following code as the simplest example:
|
|
51
|
+
|
|
52
|
+
require 'mongrel'
|
|
53
|
+
|
|
54
|
+
class SimpleHandler < Mongrel::HttpHandler
|
|
55
|
+
def process(request, response)
|
|
56
|
+
response.start(200) do |head,out|
|
|
57
|
+
head["Content-Type"] = "text/plain"
|
|
58
|
+
out.write("hello!\n")
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
h = Mongrel::HttpServer.new("0.0.0.0", "3000")
|
|
64
|
+
h.register("/test", SimpleHandler.new)
|
|
65
|
+
h.register("/files", Mongrel::DirHandler.new("."))
|
|
66
|
+
h.run.join
|
|
67
|
+
|
|
68
|
+
If you run this and access port 3000 with a browser it will say "hello!". If you access it with any url other than "/test" it will give a simple 404. Check out the Mongrel::Error404Handler for a basic way to give a more complex 404 message.
|
|
69
|
+
|
|
70
|
+
This also shows the DirHandler with directory listings. This is still rough but it should work for basic hosting. *File extension to mime type mapping is missing though.*
|
|
71
|
+
|
|
72
|
+
== Contact
|
|
73
|
+
|
|
74
|
+
E-mail the Mongrel list at http://rubyforge.org/mailman/listinfo/mongrel-users and someone will help you. Comments about the API are welcome.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
A modern web server and application server for Ruby,
|
|
2
|
+
Python and Node.js, optimized for performance,
|
|
3
|
+
low memory usage and ease of use.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Phusion Passenger: a fast and robust web server and application server for Ruby, Python and Node.js
|
|
8
|
+
Phusion Passenger is a web server and application server, designed to be fast, robust and lightweight. It runs your web apps with the least amount of hassle by taking care of almost all administrative heavy lifting for you. Advanced administration tools allow you to gain deep insight into your web applications' operations and to keep your servers healthy. Phusion Passenger is polyglot by design, and currently supports Ruby (Rack), Python (WSGI) and Node.js.
|
|
9
|
+
|
|
10
|
+
Regular installation
|
|
11
|
+
|
|
12
|
+
You can install either Phusion Passenger for Apache or for Nginx. Run either of the following programs as root:
|
|
13
|
+
|
|
14
|
+
./bin/passenger-install-apache2-module
|
|
15
|
+
-OR-
|
|
16
|
+
|
|
17
|
+
./bin/passenger-install-nginx-module
|
|
18
|
+
That's it. :)
|
|
19
|
+
|
|
20
|
+
For troubleshooting, configuration and tips, please read the corresponding Users Guide:
|
|
21
|
+
|
|
22
|
+
doc/Users guide Apache.html
|
|
23
|
+
doc/Users guide Nginx.html
|
|
24
|
+
These files are included in the source tarball, and may also be viewed online on our website.
|
|
25
|
+
|
|
26
|
+
Installing as a gem
|
|
27
|
+
|
|
28
|
+
gem build passenger.gemspec
|
|
29
|
+
gem install passenger-x.x.x.gem
|
|
30
|
+
Further reading
|
|
31
|
+
|
|
32
|
+
The doc/ directory.
|
|
33
|
+
CONTRIBUTING.md.
|
|
34
|
+
https://www.phusionpassenger.com/support
|
|
35
|
+
Legal
|
|
36
|
+
|
|
37
|
+
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
= ruby-scgi
|
|
2
|
+
|
|
3
|
+
ruby-scgi is a Ruby library for running Ruby on Rails (and possibly other
|
|
4
|
+
web applications) for high-speed deployment of your applications in production.
|
|
5
|
+
It is intended as a replacement for the ancient FastCGI code base and bring
|
|
6
|
+
some big advantages to Rails deployment for production operations.
|
|
7
|
+
|
|
8
|
+
SCGI (Simple Common Gateway Interface) is a project to replace CGI and FastCGI
|
|
9
|
+
with a simpler protocol to both implement and manage. It was written by Neil
|
|
10
|
+
Schemenauer and adopted by many Python developers as a hosting option.
|
|
11
|
+
|
|
12
|
+
ruby-scgi is distributed as a gem, and can be installed with:
|
|
13
|
+
|
|
14
|
+
sudo gem install scgi
|
|
15
|
+
|
|
16
|
+
Feedback/Bugs/Support Requests should be handled through RubyForge at
|
|
17
|
+
http://rubyforge.org/projects/scgi/.
|
|
18
|
+
|
|
19
|
+
The RDoc is available at http://scgi.rubyforge.org
|
|
20
|
+
Source control access is available at github
|
|
21
|
+
(http://github.com/jeremyevans/ruby-scgi).
|
|
22
|
+
|
|
23
|
+
== Advantages
|
|
24
|
+
|
|
25
|
+
* Same performance as FastCGI and better performance than other methods.
|
|
26
|
+
* Can be used to run Rails with style (sudo gem install style)
|
|
27
|
+
* Gives out limited status information to help manage your application's
|
|
28
|
+
resources.
|
|
29
|
+
* You can set a maximum concurrent connections limit, which causes any
|
|
30
|
+
connections over the limit to get redirected to a /busy.html file. This can
|
|
31
|
+
help keep your site alive under heavy load.
|
|
32
|
+
* Simple to configure with your web server.
|
|
33
|
+
* Completely free code licensed under Rails's own license.
|
|
34
|
+
* No external dependencies other than Ruby
|
|
35
|
+
|
|
36
|
+
== Comparison With FastCGI
|
|
37
|
+
|
|
38
|
+
SCGI and FastCGI have similar goals: To keep Ruby running between requests and
|
|
39
|
+
process the requests as fast as possible. The difference is that SCGI is much
|
|
40
|
+
simpler and easier to implement so there's less chance to get it wrong.
|
|
41
|
+
|
|
42
|
+
Specifically, ruby-scgi is written in pure Ruby so it doesn't leak memory,
|
|
43
|
+
runs everywhere, and is easy to install (no compilers needed).
|
|
44
|
+
|
|
45
|
+
One thing that SCGI doesn't support is using UNIX Domain sockets in addition to
|
|
46
|
+
TCP/IP sockets. This isn't really needed, but it is handy in a shared hosting
|
|
47
|
+
situation where you don't want others connecting to your processes or if you
|
|
48
|
+
have to request open ports. Sorry, no UNIX Domain sockets in SCGI.
|
|
49
|
+
|
|
50
|
+
== Comparison With WEBrick
|
|
51
|
+
|
|
52
|
+
In theory WEBrick should be able to run just as fast as ruby-scgi. They are
|
|
53
|
+
both written in pure Ruby. They both do similar processing (although WEBrick's
|
|
54
|
+
are a little more complicated). They both return about the same amount of
|
|
55
|
+
data.
|
|
56
|
+
|
|
57
|
+
In practice WEBrick in production mode runs much slower than ruby-scgi in
|
|
58
|
+
production mode. The (dis)advantage (depending on your point of view) is that
|
|
59
|
+
you have to manage your webserver differently than you manage your application.
|
|
60
|
+
|
|
61
|
+
== Comparison With CGI
|
|
62
|
+
|
|
63
|
+
CGI is where every time a request comes in for rails the whole Ruby on Rails
|
|
64
|
+
framework is loaded. This is very slow, but it's easy to install.
|
|
65
|
+
|
|
66
|
+
An alternative is to use the cgi2scgi program distributed with the SCGI source
|
|
67
|
+
available from http://www.mems-exchange.org/software/scgi/ along with the
|
|
68
|
+
Apache modules. This program basically is a small little C program that runs
|
|
69
|
+
quickly as a CGI, but passes it's requests to your ruby-scgi backend. It's not
|
|
70
|
+
all that fast, but if you're stuck with cgi-bin only access then this might be
|
|
71
|
+
just the way to go. Since SCGI runs over TCP/IP you can even host your
|
|
72
|
+
ruby-scgi on a totally different machine with this.
|
|
73
|
+
|
|
74
|
+
== Running and Configuration
|
|
75
|
+
|
|
76
|
+
ruby-scgi is now just a library and doesn't come with a tool to run Rails. The
|
|
77
|
+
previous command line tool (scgi_ctrl) has been greatly enhanced and is now
|
|
78
|
+
available as a standalone gem called ruby-style.
|
|
79
|
+
|
|
80
|
+
== Example configurations
|
|
81
|
+
|
|
82
|
+
Note that ruby-scgi is only tested on Lighttpd. Also, note that Lighttpd
|
|
83
|
+
1.4.16 has a bug which breaks redirects using server.error-handler-404, so
|
|
84
|
+
either use mod_magnet, use 1.4.18, or apply the patch in ticket 1270 on
|
|
85
|
+
Lighttpd's Trac.
|
|
86
|
+
|
|
87
|
+
Lighttpd:
|
|
88
|
+
|
|
89
|
+
server.modules = ( ... "mod_scgi" ... )
|
|
90
|
+
server.error-handler-404 = "/dispatch.scgi"
|
|
91
|
+
|
|
92
|
+
# For Single Process or Single-Port Clustering
|
|
93
|
+
scgi.server = ( "dispatch.scgi" => (
|
|
94
|
+
"server1" => (
|
|
95
|
+
"host" => "127.0.0.1",
|
|
96
|
+
"port" => 9999,
|
|
97
|
+
"check-local" => "disable",
|
|
98
|
+
"disable-time" => 0)
|
|
99
|
+
))
|
|
100
|
+
|
|
101
|
+
# For Multi-Port Clustering
|
|
102
|
+
scgi.server = ( "dispatch.scgi" => (
|
|
103
|
+
"server1" => (
|
|
104
|
+
"host" => "127.0.0.1",
|
|
105
|
+
"port" => 9997,
|
|
106
|
+
"check-local" => "disable",
|
|
107
|
+
"disable-time" => 0),
|
|
108
|
+
"server2" => (
|
|
109
|
+
"host" => "127.0.0.1",
|
|
110
|
+
"port" => 9998,
|
|
111
|
+
"check-local" => "disable",
|
|
112
|
+
"disable-time" => 0),
|
|
113
|
+
"server3" => (
|
|
114
|
+
"host" => "127.0.0.1",
|
|
115
|
+
"port" => 9999,
|
|
116
|
+
"check-local" => "disable",
|
|
117
|
+
"disable-time" => 0)
|
|
118
|
+
))
|
|
119
|
+
|
|
120
|
+
Apache:
|
|
121
|
+
|
|
122
|
+
<VirtualHost your-ip:80>
|
|
123
|
+
AddDefaultCharset utf-8
|
|
124
|
+
ServerName www.yourdomain
|
|
125
|
+
DocumentRoot /your-switchtower-root/current/public
|
|
126
|
+
ErrorDocument 500 /500.html
|
|
127
|
+
ErrorDocument 404 /404.html
|
|
128
|
+
# handle all requests throug SCGI
|
|
129
|
+
SCGIMount / 127.0.0.1:9999
|
|
130
|
+
# matches locations with a dot following at least one more characters,
|
|
131
|
+
# that is, things like *,html, *.css, *.js, which should be delivered
|
|
132
|
+
# directly from the filesystem
|
|
133
|
+
<LocationMatch \..+$>
|
|
134
|
+
# don't handle those with SCGI
|
|
135
|
+
SCGIHandler Off
|
|
136
|
+
</LocationMatch>
|
|
137
|
+
<Directory /your-switchtower-root/current/public/>
|
|
138
|
+
Options +FollowSymLinks
|
|
139
|
+
Order allow,deny
|
|
140
|
+
allow from all
|
|
141
|
+
</Directory>
|
|
142
|
+
</VirtualHost>
|
|
143
|
+
|
|
144
|
+
== Changes from version 0.9.0
|
|
145
|
+
|
|
146
|
+
* The library should now run on Windows, though there may be issues shutting
|
|
147
|
+
it down.
|
|
148
|
+
|
|
149
|
+
== Changes from version 0.8.0
|
|
150
|
+
|
|
151
|
+
* You can pass a socket to SCGI::Processor.new via settings[:socket]
|
|
152
|
+
* You can have a socket created for you in new if you pass
|
|
153
|
+
settings[:host] and settings[:port]
|
|
154
|
+
* You can pass an existing logger to new via settings[:log]
|
|
155
|
+
* Passing a socket to listen is now optional, if you passed a socket or
|
|
156
|
+
had one created in new
|
|
157
|
+
* Improved RDoc for new
|
|
158
|
+
* Most SCGI::Processor methods are now private
|
|
159
|
+
* SCGI::Processor is easier to subclass because it will use preexisting
|
|
160
|
+
instance variables
|
|
161
|
+
|
|
162
|
+
== Changes from version 0.7.0
|
|
163
|
+
|
|
164
|
+
* Command line tool is now in a seperate gem called ruby-style
|
|
165
|
+
* You now must pass a socket to SCGI::Processor#listen
|
|
166
|
+
* SCGI::Processor's @log and @maxconns now have defaults
|
|
167
|
+
* SCGI::Processor's @host and @port are no longer used
|
|
168
|
+
|
|
169
|
+
== Changes from SCGI Rails Runner by Zed Shaw
|
|
170
|
+
|
|
171
|
+
* Single-port clustering is back
|
|
172
|
+
* scgi_ctrl is fully configurable on the command line
|
|
173
|
+
* Clustering and processing are now built into scgi_ctrl
|
|
174
|
+
* DRb, Win32, and throttling are no longer supported
|
|
175
|
+
* Soft reconfiguration has changed (no SIGUSR1)
|
|
176
|
+
* Restarting via SIGHUP is only supported in supervise mode
|
|
177
|
+
* The only commands available to scgi_ctrl are start, stop, and restart
|
|
178
|
+
|
|
179
|
+
== FAQ
|
|
180
|
+
|
|
181
|
+
Q: Have you been living under a rock for the last two years? Mongrel/Nginx is
|
|
182
|
+
the new hotness!
|
|
183
|
+
|
|
184
|
+
A: Well, aren't you snotty. You can certainly use Mongrel if you want. The
|
|
185
|
+
memory/performance differences are small, and it is probably better maintained.
|
|
186
|
+
ruby-scgi is a simpler version of SCGI Rails Runner, and may be useful for
|
|
187
|
+
certain legacy setups. Also, it works well and it's been working for me for
|
|
188
|
+
the last few years.
|