Browse files

Change the CGI output generation environment variable name to "sprock…

…ets_generate_output_file" and use the right path in Concatenation#save_to.
  • Loading branch information...
1 parent 6ff59fc commit 9a89c253de497d9b84a665909044092262d782dd @sstephenson committed Feb 18, 2009
Showing with 7 additions and 4 deletions.
  1. +3 −0 CHANGELOG
  2. +4 −4 ext/nph-sprockets.cgi
View
3 CHANGELOG
@@ -1,5 +1,8 @@
+* Change the CGI output generation environment variable name to "sprockets_generate_output_file" and use the right path in Concatenation#save_to.
+
* Prefer "vendor/gems/sprockets/lib" to "vendor/sprockets/lib" when looking for an externaled Sprockets checkout in nph-sprockets.cgi.
+
*1.0.0* (February 17, 2009)
* Initial public release.
View
8 ext/nph-sprockets.cgi
@@ -6,7 +6,7 @@
# script will search its directory and parent directories for a YAML file named
# "config/sprockets.yml" in order to load configuration information.
#
-# If you set the environment variable "sprockets.generate_output_file" to
+# If you set the environment variable "sprockets_generate_output_file" to
# "true" the concatenation will be cached to disk. Use it in conjunction with
# URL rewriting to cache your Sprockets output on the first request.
#
@@ -59,7 +59,7 @@
# All requests to /sprockets.js will transparently proxy /nph-sprockets.cgi if
# mysite/public/sprockets.js does not exist. In production, you can add
#
-# SetEnv sprockets.generate_output_file true
+# SetEnv sprockets_generate_output_file true
#
# to your Apache configuration and mysites/public/sprockets.js will be cached
# on the first request to /sprockets.js.
@@ -90,7 +90,7 @@ ensure
end
def generate_output_file?
- (ENV["REDIRECT_sprockets.generate_output_file"] || ENV["sprockets.generate_output_file"]) =~ /true/i
+ (ENV["REDIRECT_sprockets_generate_output_file"] || ENV["sprockets_generate_output_file"]) =~ /true/i
end
configuration_file = search_upwards_for("config/sprockets.yml")
@@ -119,7 +119,7 @@ begin
:source_files => configuration[:source_files]
)
- secretary.concatenation.save_to(configuration[:output_file]) if generate_output_file?
+ secretary.concatenation.save_to(File.join(sprockets_root, configuration[:output_file])) if generate_output_file?
respond_with(:content => secretary.concatenation.to_s, :type => "text/javascript")
rescue Exception => e

0 comments on commit 9a89c25

Please sign in to comment.