42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/iron_worker_ng/feature/ruby/merge_gem_dependency.rb', line 42
def merge_gem_dependency_fixate
if not full_remote_build
IronCore::Logger.info 'IronWorkerNG', 'Fixating gems dependencies'
@features.reject! { |f| f.class == IronWorkerNG::Feature::Ruby::MergeGem::Feature }
deps = @features.reject { |f| f.class != IronWorkerNG::Feature::Ruby::MergeGemDependency::Feature }
if deps.length > 0
deps = deps.map { |dep| Bundler::DepProxy.new(Bundler::Dependency.new(dep.name, dep.version.split(', ')), Gem::Platform::RUBY) }
source = nil
begin
source = Bundler::Source::Rubygems.new
rescue Bundler::GemfileNotFound
ENV['BUNDLE_GEMFILE'] = 'Gemfile'
source = Bundler::Source::Rubygems.new
end
index = Bundler::Index.build { |index| index.use source.specs }
spec_set = Bundler::Resolver.resolve(deps, index)
spec_set.to_a.each do |spec|
spec.__materialize__
IronCore::Logger.info 'IronWorkerNG', "Merging ruby gem with name='#{spec.name}' and version='#{spec.version}'"
@features << IronWorkerNG::Feature::Ruby::MergeGem::Feature.new(self, spec)
end
end
end
end
|