class_dependencies 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/class_dependencies.rb +4 -0
- data/spec/class_dependencies_spec.rb +4 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/lib/class_dependencies.rb
CHANGED
@@ -134,6 +134,10 @@ module ClassDependencies
|
|
134
134
|
find_dependencies_of(from_sym, Set.new()).delete(from_sym).to_a
|
135
135
|
end
|
136
136
|
|
137
|
+
def all_dependencies_of_classes(from)
|
138
|
+
all_dependencies_of(from).map{|sym| sym_to_class(sym)}
|
139
|
+
end
|
140
|
+
|
137
141
|
def ordered_dependencies
|
138
142
|
class_dependencies.tsort
|
139
143
|
end
|
@@ -40,6 +40,10 @@ describe "ClassDependencies" do
|
|
40
40
|
BaseDep.all_dependencies_of(:b).should == [:c]
|
41
41
|
end
|
42
42
|
|
43
|
+
it "should return classes in all_dependencies_of_classes" do
|
44
|
+
BaseDep.all_dependencies_of_classes(A).to_set.should == [B,C].to_set
|
45
|
+
end
|
46
|
+
|
43
47
|
module AnotherDep
|
44
48
|
include ClassDependencies
|
45
49
|
|