You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's very unlikely that development OR development, test groups are not present in the Gemfile but there is a chance for them not to present. I want to minimize that possibility and add a new helper method like the following (already in work):
def add_gem_content_to_group(*names, &block)
symbolized_group_names = Array.wrap(names).flatten.map(&:to_sym)
formatted_group_names = symbolized_group_names.join(", ")
group_regex = /group #{formatted_group_names} do/
if File.read("Gemfile").match?(group_regex)
&block
else
gem_group *names do
&block
end
end
end
This code will check and add to the group if present. Else create the group and execute the block that has been passed which includes gem related content.
(Code hasn't been tested so it won't work as it is for sure)
The text was updated successfully, but these errors were encountered:
We have a code like this in our generators
It's very unlikely that development OR development, test groups are not present in the Gemfile but there is a chance for them not to present. I want to minimize that possibility and add a new helper method like the following (already in work):
This code will check and add to the group if present. Else create the group and execute the block that has been passed which includes gem related content.
(Code hasn't been tested so it won't work as it is for sure)
The text was updated successfully, but these errors were encountered: