Class: MavenPom::Sorter
- Inherits:
-
Object
- Object
- MavenPom::Sorter
- Defined in:
- lib/maven_pom/sorter.rb
Instance Attribute Summary collapse
-
#dag ⇒ Object
readonly
Returns the value of attribute dag.
Instance Method Summary collapse
-
#initialize(poms) ⇒ Sorter
constructor
A new instance of Sorter.
- #sort ⇒ Object
Constructor Details
#initialize(poms) ⇒ Sorter
Returns a new instance of Sorter.
9 10 11 12 |
# File 'lib/maven_pom/sorter.rb', line 9 def initialize(poms) @poms = poms build_graph end |
Instance Attribute Details
#dag ⇒ Object (readonly)
Returns the value of attribute dag.
7 8 9 |
# File 'lib/maven_pom/sorter.rb', line 7 def dag @dag end |
Instance Method Details
#sort ⇒ Object
14 15 16 17 |
# File 'lib/maven_pom/sorter.rb', line 14 def sort sorted_keys = @dag.topsort_iterator.to_a.reverse sorted_keys.map { |key| @map[key] }.compact end |