summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/ruby.rb
diff options
context:
space:
mode:
authorConrad Irwin <conrad.irwin@gmail.com>2011-12-23 08:33:21 -0800
committerConrad Irwin <conrad.irwin@gmail.com>2011-12-23 08:36:44 -0800
commitac2d6f1898a5aa1aad7cc254290ec9341d2cdf60 (patch)
tree9a7a912105879ad19b4012a4512aa7598d6bb15a /lib/coderay/scanners/ruby.rb
parent3d80f03434ba20544a410c13228738f4362d731b (diff)
downloadcoderay-ac2d6f1898a5aa1aad7cc254290ec9341d2cdf60.tar.gz
Remove assumption about a stable $:
In some environments (e.g. [1]) $: can change between loading the library and using it. To avoid this problem, we always pass an absolute path to autoload internal modules. [1] https://github.com/pry/pry/issues/280
Diffstat (limited to 'lib/coderay/scanners/ruby.rb')
-rw-r--r--lib/coderay/scanners/ruby.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb
index 4244ab7..e2e3d1b 100644
--- a/lib/coderay/scanners/ruby.rb
+++ b/lib/coderay/scanners/ruby.rb
@@ -13,8 +13,8 @@ module Scanners
register_for :ruby
file_extension 'rb'
- autoload :Patterns, 'coderay/scanners/ruby/patterns'
- autoload :StringState, 'coderay/scanners/ruby/string_state'
+ autoload :Patterns, CodeRay.abs_path('coderay/scanners/ruby/patterns')
+ autoload :StringState, CodeRay.abs_path('coderay/scanners/ruby/string_state')
def interpreted_string_state
StringState.new :string, true, '"'