From c4d92b384dd3f926fa12eb704eeef663a9cb7b66 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 26 Dec 2010 23:52:43 +0000 Subject: more :: prefix elimination This should make things easier on the eyes. --- lib/rainbows/fiber.rb | 4 ++-- lib/rainbows/fiber_pool.rb | 2 +- lib/rainbows/rev/deferred_response.rb | 2 +- lib/rainbows/revactor.rb | 16 ++++++++-------- lib/rainbows/revactor/body.rb | 2 +- lib/rainbows/thread_timeout.rb | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/rainbows/fiber.rb b/lib/rainbows/fiber.rb index b516fb9..ed01147 100644 --- a/lib/rainbows/fiber.rb +++ b/lib/rainbows/fiber.rb @@ -24,8 +24,8 @@ module Rainbows::Fiber # right?). Calling this directly is deprecated, use # Rainbows.sleep(seconds) instead. def self.sleep(seconds) - ZZ[::Fiber.current] = Time.now + seconds - ::Fiber.yield + ZZ[Fiber.current] = Time.now + seconds + Fiber.yield end autoload :Base, 'rainbows/fiber/base' diff --git a/lib/rainbows/fiber_pool.rb b/lib/rainbows/fiber_pool.rb index e178154..c62345d 100644 --- a/lib/rainbows/fiber_pool.rb +++ b/lib/rainbows/fiber_pool.rb @@ -19,7 +19,7 @@ module Rainbows::FiberPool worker_connections.times { Fiber.new { process(Fiber.yield) while pool << Fiber.current - }.resume # resume to hit ::Fiber.yield so it waits on a client + }.resume # resume to hit Fiber.yield so it waits on a client } Rainbows::Fiber::Base.setup(self.class, app) diff --git a/lib/rainbows/rev/deferred_response.rb b/lib/rainbows/rev/deferred_response.rb index 7420631..146f505 100644 --- a/lib/rainbows/rev/deferred_response.rb +++ b/lib/rainbows/rev/deferred_response.rb @@ -3,7 +3,7 @@ # # this is class is specific to Rev for writing large static files # or proxying IO-derived objects -class Rainbows::Rev::DeferredResponse < ::Rev::IO +class Rainbows::Rev::DeferredResponse < Rev::IO def initialize(io, client, body) super(io) @client, @body = client, body diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb index a181df1..1e4d3b2 100644 --- a/lib/rainbows/revactor.rb +++ b/lib/rainbows/revactor.rb @@ -27,7 +27,7 @@ module Rainbows::Revactor include Rainbows::Base LOCALHOST = Kgio::LOCALHOST - TCP = ::Revactor::TCP::Socket + TCP = Revactor::TCP::Socket # once a client is accepted, it is processed in its entirety here # in 3 easy steps: read request, call app, write app response @@ -73,7 +73,7 @@ module Rainbows::Revactor end write_body(client, body, range) end while alive - rescue ::Revactor::TCP::ReadError + rescue Revactor::TCP::ReadError rescue => e Rainbows::Error.write(io, e) ensure @@ -136,13 +136,13 @@ module Rainbows::Revactor LISTENERS.map do |s| case s when TCPServer - l = ::Revactor::TCP.listen(s, nil) - [ l, T[:tcp_closed, ::Revactor::TCP::Socket], - T[:tcp_connection, l, ::Revactor::TCP::Socket] ] + l = Revactor::TCP.listen(s, nil) + [ l, T[:tcp_closed, Revactor::TCP::Socket], + T[:tcp_connection, l, Revactor::TCP::Socket] ] when UNIXServer - l = ::Revactor::UNIX.listen(s) - [ l, T[:unix_closed, ::Revactor::UNIX::Socket ], - T[:unix_connection, l, ::Revactor::UNIX::Socket] ] + l = Revactor::UNIX.listen(s) + [ l, T[:unix_closed, Revactor::UNIX::Socket ], + T[:unix_connection, l, Revactor::UNIX::Socket] ] end end end diff --git a/lib/rainbows/revactor/body.rb b/lib/rainbows/revactor/body.rb index 1dd01f2..ad2bc55 100644 --- a/lib/rainbows/revactor/body.rb +++ b/lib/rainbows/revactor/body.rb @@ -9,7 +9,7 @@ module Rainbows::Revactor::Body if IO.method_defined?(:sendfile_nonblock) def write_body_file(client, body, range) sock = client.instance_variable_get(:@_io) - pfx = ::Revactor::TCP::Socket === client ? :tcp : :unix + pfx = Revactor::TCP::Socket === client ? :tcp : :unix write_complete = T[:"#{pfx}_write_complete", client] closed = T[:"#{pfx}_closed", client] offset, count = range ? range : [ 0, body.stat.size ] diff --git a/lib/rainbows/thread_timeout.rb b/lib/rainbows/thread_timeout.rb index 18f400b..dc34804 100644 --- a/lib/rainbows/thread_timeout.rb +++ b/lib/rainbows/thread_timeout.rb @@ -33,7 +33,7 @@ require 'thread' class Rainbows::ThreadTimeout # :stopdoc: - class ExecutionExpired < ::Exception + class ExecutionExpired < Exception end def initialize(app, opts) -- cgit v1.2.3-24-ge0c7