Permalink
Browse files

sorting filenames for require loops to prevent dependency problems wi…

…th loading order

Signed-off-by: Sven Fuchs <svenfuchs@artweb-design.de>
  • Loading branch information...
1 parent 303d7ac commit 6190e1e7379db401d708fde15ee01a3ef7c4a07e Jan Friedrich committed with Sven Fuchs Aug 5, 2009
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/ripper/ruby_builder.rb
  2. +2 −2 lib/ruby.rb
View
4 lib/ripper/ruby_builder.rb
@@ -9,7 +9,7 @@
require 'erb/stripper'
-Dir[File.dirname(__FILE__) + '/ruby_builder/events/*.rb'].each { |file| require file }
+Dir[File.dirname(__FILE__) + '/ruby_builder/events/*.rb'].sort.each { |file| require file }
# Ripper::RubyBuilder extends Ripper's SexpBuilder and builds a rich, object
# oriented representation of Ruby code.
@@ -176,4 +176,4 @@ def build_xstring(token)
end
end
end
-end
+end
View
4 lib/ruby.rb
@@ -1,4 +1,4 @@
-Dir[File.dirname(__FILE__) + '/ruby/*.rb'].each do |file|
+Dir[File.dirname(__FILE__) + '/ruby/*.rb'].sort.each do |file|
require "ruby/#{File.basename(file)}"
end
@@ -25,4 +25,4 @@
module Ruby
include Conversions
-end
+end

1 comment on commit 6190e1e

@laserlemon

Ran into the same issue that this commit fixes. Can we release a new gem version?

Please sign in to comment.