forked from composite-primary-keys/composite_primary_keys
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloader.rb
More file actions
24 lines (19 loc) · 677 Bytes
/
loader.rb
File metadata and controls
24 lines (19 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Load local config files in /local
begin
local_file_supported = Dir[File.join(PROJECT_ROOT, 'local/*.sample')].map { |path| File.basename(path).sub(".sample","") }
local_file_supported.each do |file|
require "local/#{file}"
end
rescue LoadError
puts <<-EOS
This Gem supports local developer extensions in local/ folder.
Supported files:
#{local_file_supported.map { |f| "local/#{f}"}.join(', ')}
Setup default sample files:
rake local:setup
Current warning: #{$!}
EOS
end
# Now load Rake tasks from /tasks
rakefiles = Dir[File.join(File.dirname(__FILE__), "tasks/**/*.rake")]
rakefiles.each { |rakefile| load File.expand_path(rakefile) }