Permalink
Browse files

Updates the proxy_stack to 0.2.0 and includes numerous fixes

  • Loading branch information...
1 parent b8b0134 commit 3989906927583e9208728b0f3aad462a4a5d8f34 @hassox committed Nov 23, 2009
Showing with 38 additions and 17 deletions.
  1. +1 −1 LICENSE
  2. +1 −1 README
  3. +1 −1 Rakefile
  4. +1 −1 VERSION
  5. +29 −8 lib/proxy_stack/proxy_stack.rb
  6. +5 −5 proxy_stack.gemspec
View
@@ -1,4 +1,4 @@
-Copyright (c) 2009 <YOUR NAME HERE>
+Copyright (c) 2009 Daniel Neighman & Lincoln Stoll
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
2 README
@@ -4,4 +4,4 @@ Description goes here.
== Copyright
-Copyright (c) 2009 <YOUR NAME HERE>. See LICENSE for details.
+Copyright (c) 2009 Daniel Neighman & Lincoln Stoll. See LICENSE for details.
View
@@ -10,7 +10,7 @@ begin
gem.email = "has.sox@gmail.com"
gem.homepage = "http://github.com/hassox/proxy_stack"
gem.authors = ["Daniel Neighman", "Lincoln Stoll"]
- gem.add_dependency "pancake", ">=0.1.24"
+ gem.add_dependency "pancake", ">=0.1.25"
gem.files = FileList["[A-Z]*", "pancake.init", "{lib,spec,rails}/**/*"]
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
View
@@ -1 +1 @@
-0.1.0
+0.2.0
@@ -66,6 +66,35 @@ class self::Controller
@before_proxy = []
@after_proxy = []
+ def proxy_request
+ execute_blocks!(self.class.before_proxy)
+ @proxy_result = proxy_request!
+ execute_blocks!(self.class.after_proxy)
+ @proxy_result
+ end
+
+ def dispatch!
+ begin
+ result = super
+ if result[0] == 404
+ Rack::Response.new(proxy_request, status, headers).finish
+ else
+ result
+ end
+ rescue Pancake::Errors::NotFound
+ Rack::Response.new(proxy_request, status, headers).finish
+ end
+ end
+
+ def log_http_error?(error)
+ case error
+ when Pancake::Errors::NotFound
+ false
+ else
+ true
+ end
+ end
+
private
def execute_blocks!(blks)
blks.each{|b| instance_eval(&b)}
@@ -75,13 +104,5 @@ def proxy_result
@proxy_result
end
end
-
- publish :provides => [:any]
- any "(/{*proxy_path_segements,.*}" do
- execute_blocks!(self.class.before_proxy)
- @proxy_result = proxy_request!
- execute_blocks!(self.class.after_proxy)
- @proxy_result
- end
end
View
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{proxy_stack}
- s.version = "0.1.0"
+ s.version = "0.2.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Daniel Neighman", "Lincoln Stoll"]
- s.date = %q{2009-11-22}
+ s.date = %q{2009-11-23}
s.email = %q{has.sox@gmail.com}
s.extra_rdoc_files = [
"LICENSE",
@@ -43,12 +43,12 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<pancake>, [">= 0.1.24"])
+ s.add_runtime_dependency(%q<pancake>, [">= 0.1.25"])
else
- s.add_dependency(%q<pancake>, [">= 0.1.24"])
+ s.add_dependency(%q<pancake>, [">= 0.1.25"])
end
else
- s.add_dependency(%q<pancake>, [">= 0.1.24"])
+ s.add_dependency(%q<pancake>, [">= 0.1.25"])
end
end

0 comments on commit 3989906

Please sign in to comment.