Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 7efc397

Browse files
committed
Merge pull request #66 from codeclimate/ia-sort-paths-before-requiring
Sort paths before requiring them
2 parents 4e2f98b + c600e45 commit 7efc397

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/cc/service.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ class Service
88
require "axiom/types/password"
99

1010
dir = File.expand_path '../helpers', __FILE__
11-
Dir["#{dir}/*_helper.rb"].each do |helper|
11+
Dir["#{dir}/*_helper.rb"].sort.each do |helper|
1212
require helper
1313
end
1414

1515
dir = File.expand_path '../formatters', __FILE__
16-
Dir["#{dir}/*_formatter.rb"].each do |formatter|
16+
Dir["#{dir}/*_formatter.rb"].sort.each do |formatter|
1717
require formatter
1818
end
1919

2020
def self.load_services
2121
path = File.expand_path("../services/**/*.rb", __FILE__)
22-
Dir[path].each { |lib| require(lib) }
22+
Dir[path].sort.each { |lib| require(lib) }
2323
end
2424

2525
Error = Class.new(StandardError)

test/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
cwd = File.expand_path(File.dirname(__FILE__))
99
require "#{cwd}/../config/load"
1010
require "#{cwd}/fixtures"
11-
Dir["#{cwd}/support/*.rb"].each do |helper|
11+
Dir["#{cwd}/support/*.rb"].sort.each do |helper|
1212
require helper
1313
end
1414
CC::Service.load_services

0 commit comments

Comments
 (0)