Skip to content
Browse files

debugging

  • Loading branch information...
1 parent 427891f commit acac7fcfc04b5ad85642ac17386f4f80080a9e9b @rradonic committed
Showing with 31 additions and 20 deletions.
  1. +31 −20 lib/heroku_asset_packager.rb
View
51 lib/heroku_asset_packager.rb
@@ -23,6 +23,8 @@ def initialize(app)
def call(env)
@env = env
if ENV["HEROKU"]
+ puts '*****************************************'
+ puts env['REQUEST_PATH']
return render_css if env['REQUEST_PATH'] =~ /\/stylesheets\/.*_packaged.css/i
return render_js if env['REQUEST_PATH'] =~ /\/javascripts\/.*_packaged.js/i
end
@@ -31,32 +33,41 @@ def call(env)
end
def render_js
- file_name = @@regex_pattern.match(@env['REQUEST_PATH'])[1]
+ file_name = @@regex_pattern.match(@env['REQUEST_PATH'])[1]
+ file = "#{heroku_file_location}/#{file_name}_packaged.js"
+
+ puts file_name
+ puts file
+ puts '*****************************************(render_js)'
- file = "#{heroku_file_location}/#{file_name}_packaged.js"
- [
- 200,
- {
- 'Cache-Control' => 'public, max-age=86400',
- 'Content-Length' => File.size(file).to_s,
- 'Content-Type' => 'text/javascript'
- },
- File.read(file)
- ]
+ [
+ 200,
+ {
+ 'Cache-Control' => 'public, max-age=86400',
+ 'Content-Length' => File.size(file).to_s,
+ 'Content-Type' => 'text/javascript'
+ },
+ File.read(file)
+ ]
end
def render_css
file_name = @@regex_pattern.match(@env['REQUEST_PATH'])[1]
file = "#{heroku_file_location}/#{file_name}_packaged.css"
- [
- 200,
- {
- 'Cache-Control' => 'public, max-age=86400',
- 'Content-Length' => File.size(file).to_s,
- 'Content-Type' => 'text/css'
- },
- File.read(file)
- ]
+
+ puts file_name
+ puts file
+ puts '*****************************************(render_css)'
+
+ [
+ 200,
+ {
+ 'Cache-Control' => 'public, max-age=86400',
+ 'Content-Length' => File.size(file).to_s,
+ 'Content-Type' => 'text/css'
+ },
+ File.read(file)
+ ]
end
def heroku_file_location

0 comments on commit acac7fc

Please sign in to comment.
Something went wrong with that request. Please try again.