Skip to content

Commit

Permalink
Stop adding to the load path, use File.expand_path instead
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Feb 20, 2010
1 parent 4fbb28c commit c844886
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
4 changes: 3 additions & 1 deletion amqp.gemspec
@@ -1,6 +1,8 @@
require File.expand_path('../lib/amqp/version', __FILE__)

spec = Gem::Specification.new do |s|
s.name = 'amqp'
s.version = '0.6.6'
s.version = AMQP::VERSION
s.date = '2009-12-29'
s.summary = 'AMQP client implementation in Ruby/EventMachine'
s.email = "amqp@tmm1.net"
Expand Down
17 changes: 6 additions & 11 deletions lib/amqp.rb
@@ -1,16 +1,11 @@
module AMQP
VERSION = '0.5.9'

DIR = File.expand_path(File.dirname(File.expand_path(__FILE__)))
$:.unshift DIR

require 'ext/em'
require 'ext/blankslate'
require File.expand_path('../ext/em', __FILE__)
require File.expand_path('../ext/blankslate', __FILE__)

%w[ buffer spec protocol frame client ].each do |file|
require "amqp/#{file}"
end
%w[ version buffer spec protocol frame client ].each do |file|
require File.expand_path("../amqp/#{file}", __FILE__)
end

module AMQP
class << self
@logging = false
attr_accessor :logging
Expand Down
2 changes: 1 addition & 1 deletion lib/amqp/client.rb
@@ -1,4 +1,4 @@
require 'amqp/frame'
require File.expand_path('../frame', __FILE__)

module AMQP
class Error < StandardError; end
Expand Down
6 changes: 3 additions & 3 deletions lib/amqp/frame.rb
@@ -1,6 +1,6 @@
require 'amqp/spec'
require 'amqp/buffer'
require 'amqp/protocol'
require File.expand_path('../spec', __FILE__)
require File.expand_path('../buffer', __FILE__)
require File.expand_path('../protocol', __FILE__)

module AMQP
class Frame #:nodoc: all
Expand Down
4 changes: 2 additions & 2 deletions lib/amqp/protocol.rb
@@ -1,5 +1,5 @@
require 'amqp/spec'
require 'amqp/buffer'
require File.expand_path('../spec', __FILE__)
require File.expand_path('../buffer', __FILE__)

module AMQP
module Protocol
Expand Down
2 changes: 1 addition & 1 deletion lib/amqp/server.rb
@@ -1,4 +1,4 @@
require 'amqp/frame'
require File.expand_path('../frame', __FILE__)

module AMQP
module Server
Expand Down

0 comments on commit c844886

Please sign in to comment.