diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-09-30 13:41:27 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-09-30 13:45:47 -0700 |
commit | 407724b49069ee539e9a918ce75e9d1290552471 (patch) | |
tree | 93769645f147b45e52081ee18a30741d5b07aaaf /lib | |
parent | 9cc4f87353b84f5229d4a8bae78260c24cd02154 (diff) | |
download | unicorn-407724b49069ee539e9a918ce75e9d1290552471.tar.gz |
It's compatible with both Ruby 1.8 and 1.9 without needing a Range object.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn.rb | 2 | ||||
-rw-r--r-- | lib/unicorn/app/exec_cgi.rb | 2 | ||||
-rw-r--r-- | lib/unicorn/socket_helper.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 6df58c1..4171d3f 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -123,7 +123,7 @@ module Unicorn def listeners=(listeners) cur_names, dead_names = [], [] listener_names.each do |name| - if "/" == name[0..0] + if ?/ == name[0] # mark unlinked sockets as dead so we can rebind them (File.socket?(name) ? cur_names : dead_names) << name else diff --git a/lib/unicorn/app/exec_cgi.rb b/lib/unicorn/app/exec_cgi.rb index 2262e4c..ef2a18e 100644 --- a/lib/unicorn/app/exec_cgi.rb +++ b/lib/unicorn/app/exec_cgi.rb @@ -36,7 +36,7 @@ module Unicorn::App self.args = args first = args[0] or raise ArgumentError, "need path to executable" - first[0..0] == "/" or args[0] = ::File.expand_path(first) + first[0] == ?/ or args[0] = ::File.expand_path(first) File.executable?(args[0]) or raise ArgumentError, "#{args[0]} is not executable" end diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb index e287955..f792562 100644 --- a/lib/unicorn/socket_helper.rb +++ b/lib/unicorn/socket_helper.rb @@ -76,7 +76,7 @@ module Unicorn def bind_listen(address = '0.0.0.0:8080', opt = {}) return address unless String === address - sock = if address[0..0] == "/" + sock = if address[0] == ?/ if File.exist?(address) if File.socket?(address) if self.respond_to?(:logger) |