File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed
Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -13,5 +13,18 @@ def matches_current_ruby?
1313 def matches_current_rubygems?
1414 @required_rubygems_version . satisfied_by? ( Gem . rubygems_version )
1515 end
16+
17+ def expanded_dependencies
18+ runtime_dependencies + [
19+ metadata_dependency ( "Ruby" , required_ruby_version ) ,
20+ metadata_dependency ( "RubyGems" , required_rubygems_version ) ,
21+ ] . compact
22+ end
23+
24+ def metadata_dependency ( name , requirement )
25+ return if requirement . nil? || requirement . none?
26+
27+ Gem ::Dependency . new ( "#{ name } \0 " , requirement )
28+ end
1629 end
1730end
Original file line number Diff line number Diff line change @@ -39,9 +39,7 @@ def to_s
3939 end
4040
4141 def dependencies
42- @dependencies ||= @specs . flat_map do |spec |
43- spec . runtime_dependencies + metadata_dependencies ( spec )
44- end . uniq . sort
42+ @dependencies ||= @specs . flat_map ( &:expanded_dependencies ) . uniq . sort
4543 end
4644
4745 def ==( other )
@@ -71,19 +69,6 @@ def equivalent?(other)
7169 def exemplary_spec
7270 @specs . first
7371 end
74-
75- def metadata_dependencies ( spec )
76- [
77- metadata_dependency ( "Ruby" , spec . required_ruby_version ) ,
78- metadata_dependency ( "RubyGems" , spec . required_rubygems_version ) ,
79- ] . compact
80- end
81-
82- def metadata_dependency ( name , requirement )
83- return if requirement . nil? || requirement . none?
84-
85- Gem ::Dependency . new ( "#{ name } \0 " , requirement )
86- end
8772 end
8873 end
8974end
You can’t perform that action at this time.
0 commit comments