google-code-export / rubycas-server

Automatically exported from code.google.com/p/rubycas-server
GNU Lesser General Public License v2.1
1 stars 1 forks source link

Sinatra 1.2.6 is not fully supported #119

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Specify a public_dir option in the configuration file.
2. Use Sinatra 1.2.6.
3. See that static files are not served from the location specified by the 
public_dir option.

What version of RubyCAS-Server are you using? How is it installed (rubygem,
manual install)? How are you running it (webrick, mongrel, passenger,
etc.)?

Running rubycas-server commit 69000222539610813130e0c1f6f3936707dfd325 manually 
installed under Apache + Passenger.

The CHANGELOG states:
* Compatibilty with Sinatra 1.3 (:public changed to :public_folder).

This adds support for Sinatra 1.3, but breaks when using Sinatra 1.2.6, yet the 
rubycas-server.gemspec file states:
s.add_dependency("sinatra", "~> 1.0")

which indicates 1.2.6 should still be supported.

Reverting :public_folder to :public fixes the problem when using Sinatra 1.2.6. 
It would be nice if both 1.2.x and 1.3.x versions of Sinatra were supported.

Original issue reported on code.google.com by lif...@puppetlabs.com on 4 Feb 2012 at 5:06

GoogleCodeExporter commented 9 years ago
Verified using Sinatra 1.2.6.

To fix, go to {rubycas-server}\lib\casserver\server.rb
1. Open the file and edit the line 23:
    set :public_folder, Proc.new { settings.config[:public_dir] || File.join(root, "..", "..", "public") }
to
    set :public, Proc.new { settings.config[:public_dir] || File.join(root, "..", "..", "public") }
2. Go to line 41 and change the following:
      return if (public_dir = settings.public_folder).nil?
to
      return if (public_dir = settings.public).nil?

Original comment by hansheng...@gmail.com on 7 Feb 2012 at 3:47

GoogleCodeExporter commented 9 years ago
Wasn't this fixed in 
https://github.com/rubycas/rubycas-server/commit/5b5ffd0d265e2555f278db76b5c81f7
44699807e

Or is this something extra that needs to be done to satisfy 1.2.6?

Original comment by matt.zuk...@gmail.com on 7 Feb 2012 at 4:00

GoogleCodeExporter commented 9 years ago
Commit 
https://github.com/rubycas/rubycas-server/commit/5b5ffd0d265e2555f278db76b5c81f7
44699807e is what caused this issue in the first place. That commit fixes 
compatibility with Sinatra 1.3, but it breaks compatibility with Sinatra 1.2.6 
(and probably all of 1.2, though I haven't checked).

I just submitted a pull request to fix this issue.

Original comment by lif...@puppetlabs.com on 7 Feb 2012 at 9:40