Created
April 9, 2011 19:50
-
-
Save jonforums/911713 to your computer and use it in GitHub Desktop.
Support thin source gem builds on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/thin.rb b/lib/thin.rb | |
index 10b5ff3..83e96ba 100644 | |
--- a/lib/thin.rb | |
+++ b/lib/thin.rb | |
@@ -41,8 +41,14 @@ require "#{Thin::ROOT}/rack/adapter/loader" | |
if Thin.win? | |
# Select proper binary under Windows | |
- major_ruby_version = RUBY_VERSION[/^(\d+\.\d+)/] | |
- require "#{Thin::ROOT}/#{major_ruby_version}/thin_parser" | |
+ begin | |
+ # fat binary gem | |
+ major_ruby_version = RUBY_VERSION[/^(\d+\.\d+)/] | |
+ require "#{Thin::ROOT}/#{major_ruby_version}/thin_parser" | |
+ rescue LoadError | |
+ # source gem (eg - gem install thin --platform=ruby) | |
+ require "#{Thin::ROOT}/thin_parser" | |
+ end | |
else | |
require "#{Thin::ROOT}/thin_parser" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment