Skip to content

Commit

Permalink
Update .pytemplate file with 1.8.7-related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Feb 12, 2011
1 parent 4a3055f commit 38cd8c1
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 134 deletions.
68 changes: 34 additions & 34 deletions lib/amq/protocol/client.rb
Expand Up @@ -10,9 +10,9 @@

module AMQ
module Protocol
PROTOCOL_VERSION = "0.9.1"
PREAMBLE = "AMQP\x00\x00\x09\x01"
DEFAULT_PORT = 5672
PROTOCOL_VERSION = "0.9.1".freeze
PREAMBLE = "AMQP\x00\x00\x09\x01".freeze
DEFAULT_PORT = 5672.freeze

# caching
EMPTY_STRING = "".freeze
Expand All @@ -24,7 +24,7 @@ module Protocol
# @version 0.0.1
# @return [Array] Collection of subclasses of AMQ::Protocol::Class.
def self.classes
Class.classes
Protocol::Class.classes
end

# @version 0.0.1
Expand Down Expand Up @@ -58,33 +58,33 @@ def initialize(message = self.class::DEFAULT_MESSAGE)
end
end

class FrameTypeError < Error
class FrameTypeError < Protocol::Error
def initialize(types)
super("Must be one of #{types.inspect}")
end
end

class EmptyResponseError < Error
class EmptyResponseError < Protocol::Error
DEFAULT_MESSAGE = "Empty response received from the server."

def initialize(message = self.class::DEFAULT_MESSAGE)
super(message)
end
end

class BadResponseError < Error
class BadResponseError < Protocol::Error
def initialize(argument, expected, actual)
super("Argument #{argument} has to be #{expected.inspect}, was #{data.inspect}")
end
end

class SoftError < Error
class SoftError < Protocol::Error
def self.inherited(subclass)
Error.inherited(subclass)
end # self.inherited(subclass)
end

class HardError < Error
class HardError < Protocol::Error
def self.inherited(subclass)
Error.inherited(subclass)
end # self.inherited(subclass)
Expand Down Expand Up @@ -178,7 +178,7 @@ class InternalError < HardError
# all these methods would become global which would
# be a bad, bad thing to do.
class Class
@@classes = Array.new
@classes = Array.new

def self.method_id
@method_id
Expand All @@ -189,18 +189,18 @@ def self.name
end

def self.inherited(base)
if self == Class
@@classes << base
if self == Protocol::Class
@classes << base
end
end

def self.classes
@@classes
@classes
end
end

class Method
@@methods = Array.new
@methods = Array.new
def self.method_id
@method_id
end
Expand All @@ -214,13 +214,13 @@ def self.index
end

def self.inherited(base)
if self == Method
@@methods << base
if self == Protocol::Method
@methods << base
end
end

def self.methods
@@methods
@methods
end

def self.split_headers(user_headers)
Expand Down Expand Up @@ -266,7 +266,7 @@ def self.instantiate(*args, &block)
end
end

class Connection < Class
class Connection < Protocol::Class
@name = "connection"
@method_id = 10

Expand Down Expand Up @@ -532,7 +532,7 @@ def self.encode()
end
end

class Channel < Class
class Channel < Protocol::Class
@name = "channel"
@method_id = 20

Expand Down Expand Up @@ -711,7 +711,7 @@ def self.encode(channel)
end
end

class Exchange < Class
class Exchange < Protocol::Class
@name = "exchange"
@method_id = 40

Expand All @@ -721,7 +721,7 @@ class Declare < Protocol::Method
@index = 0x0028000A # 40, 10, 2621450

# @return
# ["ticket = 0", "exchange = nil", "type = "direct"", "passive = false", "durable = false", "auto_delete = false", "internal = false", "nowait = false", "arguments = {}"]
# [u"ticket = 0", u"exchange = nil", u"type = u"direct"", u"passive = false", u"durable = false", u"auto_delete = false", u"internal = false", u"nowait = false", u"arguments = {}"]
def self.encode(channel, exchange, type, passive, durable, auto_delete, internal, nowait, arguments)
ticket = 0
pieces = []
Expand Down Expand Up @@ -765,7 +765,7 @@ class Delete < Protocol::Method
@index = 0x00280014 # 40, 20, 2621460

# @return
# ["ticket = 0", "exchange = nil", "if_unused = false", "nowait = false"]
# [u"ticket = 0", u"exchange = nil", u"if_unused = false", u"nowait = false"]
def self.encode(channel, exchange, if_unused, nowait)
ticket = 0
pieces = []
Expand Down Expand Up @@ -803,7 +803,7 @@ class Bind < Protocol::Method
@index = 0x0028001E # 40, 30, 2621470

# @return
# ["ticket = 0", "destination = nil", "source = nil", "routing_key = EMPTY_STRING", "nowait = false", "arguments = {}"]
# [u"ticket = 0", u"destination = nil", u"source = nil", u"routing_key = EMPTY_STRING", u"nowait = false", u"arguments = {}"]
def self.encode(channel, destination, source, routing_key, nowait, arguments)
ticket = 0
pieces = []
Expand Down Expand Up @@ -845,7 +845,7 @@ class Unbind < Protocol::Method
@index = 0x00280028 # 40, 40, 2621480

# @return
# ["ticket = 0", "destination = nil", "source = nil", "routing_key = EMPTY_STRING", "nowait = false", "arguments = {}"]
# [u"ticket = 0", u"destination = nil", u"source = nil", u"routing_key = EMPTY_STRING", u"nowait = false", u"arguments = {}"]
def self.encode(channel, destination, source, routing_key, nowait, arguments)
ticket = 0
pieces = []
Expand Down Expand Up @@ -882,7 +882,7 @@ def initialize()
end
end

class Queue < Class
class Queue < Protocol::Class
@name = "queue"
@method_id = 50

Expand All @@ -892,7 +892,7 @@ class Declare < Protocol::Method
@index = 0x0032000A # 50, 10, 3276810

# @return
# ["ticket = 0", "queue = EMPTY_STRING", "passive = false", "durable = false", "exclusive = false", "auto_delete = false", "nowait = false", "arguments = {}"]
# [u"ticket = 0", u"queue = EMPTY_STRING", u"passive = false", u"durable = false", u"exclusive = false", u"auto_delete = false", u"nowait = false", u"arguments = {}"]
def self.encode(channel, queue, passive, durable, exclusive, auto_delete, nowait, arguments)
ticket = 0
pieces = []
Expand Down Expand Up @@ -946,7 +946,7 @@ class Bind < Protocol::Method
@index = 0x00320014 # 50, 20, 3276820

# @return
# ["ticket = 0", "queue = EMPTY_STRING", "exchange = nil", "routing_key = EMPTY_STRING", "nowait = false", "arguments = {}"]
# [u"ticket = 0", u"queue = EMPTY_STRING", u"exchange = nil", u"routing_key = EMPTY_STRING", u"nowait = false", u"arguments = {}"]
def self.encode(channel, queue, exchange, routing_key, nowait, arguments)
ticket = 0
pieces = []
Expand Down Expand Up @@ -988,7 +988,7 @@ class Purge < Protocol::Method
@index = 0x0032001E # 50, 30, 3276830

# @return
# ["ticket = 0", "queue = EMPTY_STRING", "nowait = false"]
# [u"ticket = 0", u"queue = EMPTY_STRING", u"nowait = false"]
def self.encode(channel, queue, nowait)
ticket = 0
pieces = []
Expand Down Expand Up @@ -1029,7 +1029,7 @@ class Delete < Protocol::Method
@index = 0x00320028 # 50, 40, 3276840

# @return
# ["ticket = 0", "queue = EMPTY_STRING", "if_unused = false", "if_empty = false", "nowait = false"]
# [u"ticket = 0", u"queue = EMPTY_STRING", u"if_unused = false", u"if_empty = false", u"nowait = false"]
def self.encode(channel, queue, if_unused, if_empty, nowait)
ticket = 0
pieces = []
Expand Down Expand Up @@ -1106,7 +1106,7 @@ def initialize()
end
end

class Basic < Class
class Basic < Protocol::Class
@name = "basic"
@method_id = 60

Expand Down Expand Up @@ -1395,7 +1395,7 @@ class Consume < Protocol::Method
@index = 0x003C0014 # 60, 20, 3932180

# @return
# ["ticket = 0", "queue = EMPTY_STRING", "consumer_tag = EMPTY_STRING", "no_local = false", "no_ack = false", "exclusive = false", "nowait = false", "arguments = {}"]
# [u"ticket = 0", u"queue = EMPTY_STRING", u"consumer_tag = EMPTY_STRING", u"no_local = false", u"no_ack = false", u"exclusive = false", u"nowait = false", u"arguments = {}"]
def self.encode(channel, queue, consumer_tag, no_local, no_ack, exclusive, nowait, arguments)
ticket = 0
pieces = []
Expand Down Expand Up @@ -1444,7 +1444,7 @@ class Cancel < Protocol::Method
@index = 0x003C001E # 60, 30, 3932190

# @return
# ["consumer_tag = nil", "nowait = false"]
# [u"consumer_tag = nil", u"nowait = false"]
def self.encode(channel, consumer_tag, nowait)
pieces = []
pieces << [60, 30].pack(PACK_CACHE[:n2])
Expand Down Expand Up @@ -1791,7 +1791,7 @@ def self.encode(channel, delivery_tag, multiple, requeue)
end
end

class Confirm < Class
class Confirm < Protocol::Class
@name = "confirm"
@method_id = 85

Expand All @@ -1815,7 +1815,7 @@ def initialize(nowait)
end

# @return
# ["nowait = false"]
# [u"nowait = false"]
def self.encode(channel, nowait)
pieces = []
pieces << [85, 10].pack(PACK_CACHE[:n2])
Expand Down

0 comments on commit 38cd8c1

Please sign in to comment.