Skip to content

Commit

Permalink
- use $LOAD_PATH, not $: for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Jul 4, 2013
1 parent 65651aa commit 96765a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/logstash/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main(args)
@startup_interruption_trap = Stud::trap("INT") { puts "Interrupted"; exit 0 }

LogStash::Util::set_thread_name(self.class.name)
$: << File.join(File.dirname(__FILE__), "..")
$LOAD_PATH << File.join(File.dirname(__FILE__), "..")

if RUBY_VERSION < "1.9.2"
$stderr.puts "Ruby 1.9.2 or later is required. (You are running: " + RUBY_VERSION + ")"
Expand Down Expand Up @@ -99,7 +99,7 @@ def run(args)
return kibana.run(args)
end,
"test" => lambda do
$: << File.join(File.dirname(__FILE__), "..", "..", "test")
$LOAD_PATH << File.join(File.dirname(__FILE__), "..", "..", "test")
require "logstash/test"
test = LogStash::Test.new
@runners << test
Expand All @@ -122,7 +122,7 @@ def run(args)
if File.exists?(newpath)
# Add the 'spec' dir to the load path so specs can run
specpath = File.join(jar_root, "spec")
$: << specpath unless $:.include?(specpath)
$LOAD_PATH << specpath unless $LOAD_PATH.include?(specpath)
next newpath
end
end
Expand All @@ -146,7 +146,7 @@ def wait
end
end

$: << File.expand_path("#{File.dirname(__FILE__)}/../../spec")
$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/../../spec")
require "test_utils"
#p :args => fixedargs
rspec = runner.new(fixedargs)
Expand Down

0 comments on commit 96765a1

Please sign in to comment.