21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/mona/package/initializer.rb', line 21
def call(package_name, env:, prevent_eager_load: false)
package = repo.find!(package_name.to_sym)
sorted_packages = nil
time = Benchmark.realtime do
sorted_packages = dependency_bypasser
.call(package_name: package.name, env: env)
.map { |name| repo.find(name) }
sorted_packages.each do |sorted_package|
Mona.current_project.loader.push_dir(sorted_package.workdir_path)
Mona.current_project.loader.loader.do_not_eager_load(sorted_package.workdir_path) if prevent_eager_load
end
Mona.current_project.loader.setup
sorted_packages.each do |package|
require package.entrypoint_file if File.exist?(package.entrypoint_file)
end
end
puts "imported package '#{package_name}' with #{sorted_packages.size} dependencies in #{'%.2f' % time} seconds for env: #{env}"
nil
end
|