Is it possible for one group to inherit another from the Gemfile

If I have a series of gems that are needed in several groups, can I inherit groups from the base group?

I know that I can:

gem "example", {:groups=>[:group_1, :group_2]}

Or:

 group :group_1, :group_2 do gem "example" end 

But is there a way to do something like:

 group :base do gem "example" end group :group_1 < :base do … end group :group_2 < :base do … end 
+4
source share
2 answers

You can declare the same group in several blocks. They are additive:

 group :group_1, :group_2 do gem "example" end group :group_1 do # extra stuff for group_1 end group :group_2 do # extra stuff for group_2 end 

Do not think of group blocks as a group declaration, think of them as a group or groups are automatically applied in statements within a block.

+3
source

No, I don’t think inheritance inheritance is allowed in Gemfile format.

0
source

Source: https://habr.com/ru/post/1501270/


All Articles