Permalink
Browse files

Stop adding to the load path, use File.expand_path instead

  • Loading branch information...
1 parent 4fbb28c commit c844886431ce20d7e10d88399f2f11d3a627ce49 @tmm1 committed Feb 20, 2010
Showing with 16 additions and 19 deletions.
  1. +3 −1 amqp.gemspec
  2. +6 −11 lib/amqp.rb
  3. +1 −1 lib/amqp/client.rb
  4. +3 −3 lib/amqp/frame.rb
  5. +2 −2 lib/amqp/protocol.rb
  6. +1 −1 lib/amqp/server.rb
View
4 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"
View
17 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
View
2 lib/amqp/client.rb
@@ -1,4 +1,4 @@
-require 'amqp/frame'
+require File.expand_path('../frame', __FILE__)
module AMQP
class Error < StandardError; end
View
6 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
View
4 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
View
2 lib/amqp/server.rb
@@ -1,4 +1,4 @@
-require 'amqp/frame'
+require File.expand_path('../frame', __FILE__)
module AMQP
module Server

0 comments on commit c844886

Please sign in to comment.