fir 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +5 -1
- data/bin/fir +0 -1
- data/example/public/dispatch.cgi +1 -1
- data/lib/fir.rb +1 -0
- data/lib/fir/pages.rb +5 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -103,7 +103,11 @@ Fir's API uses HTTP basic authentication. The users list is stored in `users.yml
|
|
103
103
|
Webserver Support
|
104
104
|
=================
|
105
105
|
|
106
|
-
Fir is designed primarily for Phusion Passenger. As a Rack-based framework, it theoretically supports Mongrel, CGI, FastCGI, and a host of others.
|
106
|
+
Fir is designed primarily for Phusion Passenger. As a Rack-based framework, it theoretically supports Mongrel, CGI, FastCGI, and a host of others.
|
107
|
+
|
108
|
+
As of this writing, Fir has only been tested with Rackup, Passenger, and CGI. If you get Fir working with anything else, please visit Fir's GitHub repository and let us know how you did it.
|
109
|
+
|
110
|
+
By the way, using CGI in production is **not** recommended. CGI boots a new Fir instance on every request. Fir is a pretty lightweight framework, so the load time isn't huge, but that doesn't mean CGI is a good idea. If you understand the issues with CGI and still want to use it, go ahead and take a look at [`dispatch.cgi`](http://github.com/jarrett/fir-example/blob/master/public/dispatch.cgi) in the example.
|
107
111
|
|
108
112
|
Unicode and Others
|
109
113
|
==================
|
data/bin/fir
CHANGED
data/example/public/dispatch.cgi
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
#
|
6
6
|
# This script will not be operational unless the webserver is configured properly.
|
7
7
|
# In Apache, you need to enable mod_rewrite in .htaccess files for this directory.
|
8
|
-
# That usually means setting AllowOverride to All
|
8
|
+
# That usually means setting AllowOverride to All (http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride).
|
9
9
|
# Apache must also be told that CGI is allowed in this directory. This is done with the ExecCGI option
|
10
10
|
# (http://httpd.apache.org/docs/1.3/mod/core.html#options).
|
11
11
|
#
|
data/lib/fir.rb
CHANGED
data/lib/fir/pages.rb
CHANGED
@@ -79,7 +79,11 @@ module Fir
|
|
79
79
|
|
80
80
|
def cache_result(path, body)
|
81
81
|
directory, filename, ext = Fir.split_path(path)
|
82
|
-
|
82
|
+
cache_dir = File.join(FIR_ROOT, 'public/cache', directory)
|
83
|
+
unless File.exists?(cache_dir)
|
84
|
+
FileUtils.mkdir_p(cache_dir)
|
85
|
+
end
|
86
|
+
path = File.join(cache_dir, filename + '.html')
|
83
87
|
File.open(path, 'w') do |file|
|
84
88
|
file.write(body)
|
85
89
|
end
|