Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Commit

Permalink
Change the CGI output generation environment variable name to "sprock…
Browse files Browse the repository at this point in the history
…ets_generate_output_file" and use the right path in Concatenation#save_to.
  • Loading branch information
sstephenson committed Feb 18, 2009
1 parent 6ff59fc commit 9a89c25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Original file line Diff line number Diff line change
@@ -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. * 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) *1.0.0* (February 17, 2009)


* Initial public release. * Initial public release.
8 changes: 4 additions & 4 deletions ext/nph-sprockets.cgi
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# script will search its directory and parent directories for a YAML file named # script will search its directory and parent directories for a YAML file named
# "config/sprockets.yml" in order to load configuration information. # "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 # "true" the concatenation will be cached to disk. Use it in conjunction with
# URL rewriting to cache your Sprockets output on the first request. # URL rewriting to cache your Sprockets output on the first request.
# #
Expand Down Expand Up @@ -59,7 +59,7 @@
# All requests to /sprockets.js will transparently proxy /nph-sprockets.cgi if # All requests to /sprockets.js will transparently proxy /nph-sprockets.cgi if
# mysite/public/sprockets.js does not exist. In production, you can add # 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 # to your Apache configuration and mysites/public/sprockets.js will be cached
# on the first request to /sprockets.js. # on the first request to /sprockets.js.
Expand Down Expand Up @@ -90,7 +90,7 @@ ensure
end end


def generate_output_file? 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 end


configuration_file = search_upwards_for("config/sprockets.yml") configuration_file = search_upwards_for("config/sprockets.yml")
Expand Down Expand Up @@ -119,7 +119,7 @@ begin
:source_files => configuration[:source_files] :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") respond_with(:content => secretary.concatenation.to_s, :type => "text/javascript")


rescue Exception => e rescue Exception => e
Expand Down

0 comments on commit 9a89c25

Please sign in to comment.