-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for adding just the gems in a particular bundle group #127
base: master
Are you sure you want to change the base?
Add support for adding just the gems in a particular bundle group #127
Conversation
I understand about bundle groups, And I can see how that might be a useful feature. What I don't understand is your comment about using pre-installed gems in your doctor container. As you well know many ruby gems require native extensions to be built in C. Those extensions are heavily operating system dependent. If you build a local gem on OS X you cannot copy the result straight into a docker container and expect them to work, unless the gem is pure ruby, OR you are on the same linux variant as the docker container itself. In any other situation you would still need to run Finally there an error on CI:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing, and needs to be fixed.
…s55/rules_ruby into support_bundle_groups
@@ -223,6 +241,13 @@ def generate! | |||
.gsub('{bundle_deps}', gems.map { |g| ":#{g}" }.to_s) | |||
.gsub('{exclude}', DEFAULT_EXCLUDES.to_s) | |||
|
|||
gems_by_group.each do |key, value| | |||
template_out.puts GEM_GROUP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to do GEM_GROUP.dup
to bypass the frozen constant error. The way it's written right now, the code is attempting to modify the frozen constant.
bundle_deps = Bundler::Definition.build(gemfile_lock.chomp('.lock'), gemfile_lock, {}).dependencies | ||
groups = bundle_deps.map{|dep| dep.groups}.flatten.uniq | ||
gems_by_group = groups.map{ |g| {g => bundle_deps | ||
.select{|dep| dep.groups.include?(g)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please annotate with comments each line here and explain what it's doing.
.reject{|dep| dep.source.path? unless dep.source.nil?} | ||
.map(&:name)} | ||
} | ||
.reduce Hash.new, :merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What?
Interested in feedback for this. I'm trying to take the downloaded/installed gems and use them within a container image; and we make pretty extensive use of bundle groups.