public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Check for EventMachine 0.11 only when using UNIX domain sockets and output 
a more helpful message.
macournoyer (author)
Wed Mar 05 18:24:12 -0800 2008
commit  050830515c72c273bbaf5fb4ffd49186e1c26eca
tree    c028af05628ef285ac8a46aeb85b3efc710279f7
parent  d44352acc6888df131bf0980c1d4c3324ba7a535
...
6
7
8
9
 
 
10
11
12
...
38
39
40
 
 
 
 
 
 
 
 
 
 
 
41
42
43
...
6
7
8
 
9
10
11
12
13
...
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
0
@@ -6,7 +6,8 @@ module Thin
0
       attr_accessor :socket
0
       
0
       def initialize(socket)
0
- raise PlatformNotSupported, 'UNIX sockets not available on Windows' if Thin.win?
0
+ raise PlatformNotSupported, 'UNIX domain sockets not available on Windows' if Thin.win?
0
+ check_event_machine_version
0
         @socket = socket
0
         super()
0
       end
0
@@ -38,6 +39,17 @@ module Thin
0
         def remove_socket_file
0
           File.delete(@socket) if @socket && File.exist?(@socket)
0
         end
0
+
0
+ def check_event_machine_version
0
+ # TODO remove this crap once eventmachine 0.11.0 is released
0
+ begin
0
+ gem 'eventmachine', '>= 0.11.0'
0
+ rescue Gem::LoadError
0
+ raise LoadError, "UNIX domain sockets require EventMachine version 0.11.0 or higher, " +
0
+ "install the (not yet released) gem with: " +
0
+ "gem install eventmachine --source http://code.macournoyer.com"
0
+ end
0
+ end
0
     end
0
   end
0
 
...
20
21
22
23
24
25
 
 
26
27
28
 
29
30
31
...
20
21
22
 
23
 
24
25
26
27
 
28
29
30
31
0
@@ -20,12 +20,12 @@ spec = Gem::Specification.new do |s|
0
   s.add_dependency 'rack', '>= 0.2.0'
0
   if WIN
0
     s.add_dependency 'eventmachine', '>= 0.8.1'
0
- s.add_dependency 'daemons', '>= 1.0.9'
0
   else
0
- s.add_dependency 'eventmachine', '>= 0.11.0'
0
+ s.add_dependency 'daemons', '>= 1.0.9'
0
+ s.add_dependency 'eventmachine', '>= 0.10.0' # TODO '>= 0.11.0' when it's released
0
   end
0
 
0
- s.files = %w(COPYING CHANGELOG README Rakefile) +
0
+ s.files = %w(COPYING CHANGELOG COMMITTERS README Rakefile) +
0
                             Dir.glob("{benchmark,bin,doc,example,lib,spec,tasks}/**/*") +
0
                             Dir.glob("ext/**/*.{h,c,rb,rl}")
0
   

Comments

    No one has commented yet.