Permalink
Browse files

Do not use require_relative because it is not built in to Ruby

  • Loading branch information...
1 parent a6e2bd1 commit 855308cd071032e5bcd67ef7530129fe5b04fc51 @gcao committed Jan 23, 2013
@@ -8,7 +8,9 @@ def save
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class ActiveRecordHooks < Aspector::Base
logger.level = Aspector::Logging::TRACE
@@ -8,7 +8,9 @@ def test
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
aspector(A) do
target do
@@ -6,7 +6,9 @@ def test
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
aspect = Aspector do
target do
@@ -6,7 +6,9 @@ def test
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
aspector(A) do
target do
View
@@ -39,7 +39,9 @@ def self.cache key, ttl
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class CacheAspect < Aspector::Base
default :ttl => 60
@@ -21,7 +21,9 @@ def sell price
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class Object
def assert bool, message = 'Assertion failure'
@@ -8,7 +8,9 @@ def test input
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class ExceptionHandler < Aspector::Base
@@ -12,11 +12,13 @@ def test input
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class ExceptionHandler < Aspector::Base
- module ToBeIncluded
+ target do
def handle_exception proxy, *args, &block
proxy.call *args, &block
rescue => e
@@ -6,7 +6,9 @@ def test
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class ImplicitMethodOptionTest < Aspector::Base
# Apply advice to options[:method] and options[:methods] if no target method is given
@@ -8,7 +8,9 @@ def test input
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class LoggingAspect < Aspector::Base
View
@@ -9,11 +9,13 @@ def test
##############################
-require_relative '../lib/aspector'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+require 'aspector'
class RetryAspect < Aspector::Base
- module ToBeIncluded
+ target do
def retry_this proxy, &block
proxy.call &block
rescue => e
View
@@ -1,16 +1,16 @@
-require_relative 'aspector/logging'
-require_relative 'aspector/logger'
+require 'aspector/logging'
+require 'aspector/logger'
-require_relative 'aspector/object_extension'
-require_relative 'aspector/module_extension'
+require 'aspector/object_extension'
+require 'aspector/module_extension'
-require_relative 'aspector/base'
-require_relative 'aspector/base_class_methods'
-require_relative 'aspector/advice'
-require_relative 'aspector/advice_metadata'
-require_relative 'aspector/method_matcher'
-require_relative 'aspector/deferred_logic'
-require_relative 'aspector/deferred_option'
+require 'aspector/base'
+require 'aspector/base_class_methods'
+require 'aspector/advice'
+require 'aspector/advice_metadata'
+require 'aspector/method_matcher'
+require 'aspector/deferred_logic'
+require 'aspector/deferred_option'
-require_relative 'aspector/aspect_instances'
+require 'aspector/aspect_instances'

0 comments on commit 855308c

Please sign in to comment.