Conversation
|
What about explicitly commenting out the optional gems? I think it's slightly less obscure. |
|
There's another option which is directly commenting out But that would mean relying on a what I think is a bundler's bug, so let's not do that 🤣 |
|
Exactly @deivid-rodriguez, I wanted to avoid relying on a bug, doesn't sound safe xDDD. Also the |
|
Yes, I was thinking about a less DRY but more explicit approach, like gsub_file "Gemfile", /gem "decidim-consultations".*/, "# gem \"decidim-consultations\", #{gem_modifier}" if current_gem == "decidim"But what you're doing here sounds good too! |
|
Let's see if we hit a wall with my approach. It's a bit more magical but it's useful and kinda low-friction too. |
|
Arrived late to the party but I think this is going to break external plugin test app For example, this is how the test app Gemfile looks in the # frozen_string_literal: true
source "https://rubygems.org"
ruby RUBY_VERSION
gem "decidim", git: "https://github.com/decidim/decidim", branch: "master"
gem "decidim-votings", path: ".."
gem "puma", "~> 3.0"
gem "uglifier", "~> 4.1"
group :development, :test do
gem "byebug", "~> 10.0", platform: :mri
gem "decidim-dev", git: "https://github.com/decidim/decidim", branch: "master"
end
group :development do
gem "faker", "~> 1.8"
gem "letter_opener_web", "~> 1.3"
gem "listen", "~> 3.1"
gem "spring", "~> 2.0"
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 3.5"
endWith this patch, the I think we need to go with my explicit approach... |
|
😢 😢 😢 😢 😢 😢 |
|
@deivid-rodriguez I'm afraid this will still happen if you happen to include I have a funny idea, let me open a PR 😆 |
|
No, because it's scoped to |
|
The |
|
Oh, but shouldn't my approach work if I scope it to |
|
Yeah, that should work too. |
|
My problem with this approach is that it's a bit hard to understand. First time I read the code I thought, why are you matching |
|
@josepjaume Just a friendly remainder about this, so we don't forget to fix it before |
🎩 What? Why?
This will comment out optional gems found on the project's
Gemfile, in order to indicate to the user they are available, but optional.So this will generate this gemfile:
When given a gemfile like this:
📌 Related Issues
None
📋 Subtasks
None
📷 Screenshots (optional)
None