Skip to content
Browse files

Extract rails check to settings.

  • Loading branch information...
1 parent 122986c commit f2c5ee65052d36f3d5410daa3790bb7f5cd9690f @xaviershay xaviershay committed Jan 25, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −1 bin/jetpack
  2. +4 −0 lib/jetpack/settings.rb
View
2 bin/jetpack
@@ -159,7 +159,7 @@ if @settings.jetty?
web_inf_dir = File.join(@path_to_project, "WEB-INF")
mkdir_p web_inf_dir
- @listener = if File.exists?(File.join(@path_to_project, "config/environment.rb"))
+ @listener = if @settings.rails?
"org.jruby.rack.rails.RailsServletContextListener"
else
# Rails does this for us, but jetty won't load if there is no log dir.
View
4 lib/jetpack/settings.rb
@@ -37,6 +37,10 @@ def jetty?
respond_to?(:jetty)
end
+ def rails?
+ File.exists?(File.join(app_root, "config/environment.rb"))
+ end
+
def jetty_pid_path
File.join(app_root, "/vendor/jetty/run/jetty.pid")
end

0 comments on commit f2c5ee6

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