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 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. But as of this writing, Fir has only been tested with Rackup and Passenger. If you get Fir working with anything else, please visit Fir's GitHub repository and let us know how you did it.
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
@@ -3,7 +3,6 @@
3
3
  $:.unshift '/Users/jarrettcolby/apps/fir/lib'
4
4
  require 'rubygems'
5
5
  require 'fir'
6
- require 'fileutils'
7
6
  include FileUtils
8
7
 
9
8
  unless ARGV.length >= 1
@@ -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. (http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride)
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
@@ -5,6 +5,7 @@ require 'digest'
5
5
  require 'erb'
6
6
  require 'builder'
7
7
  require 'maruku'
8
+ require 'fileutils'
8
9
 
9
10
  require 'fir/admin.rb'
10
11
  require 'fir/boot.rb'
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
- path = File.join(FIR_ROOT, 'public/cache', directory, filename + '.html')
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - jarrett