Commit 0e98d37d authored by Samuel Giddins's avatar Samuel Giddins

[SpecsState] Ensure only root names are stored

parent 55b24295
...@@ -10,6 +10,8 @@ module Pod ...@@ -10,6 +10,8 @@ module Pod
# subspecs are added instead of the name of the Pods. # subspecs are added instead of the name of the Pods.
# #
class SpecsState class SpecsState
STATES = %i(added removed changed unchanged).freeze
# Initialize a new instance # Initialize a new instance
# #
# @param [Hash{Symbol=>String}] pods_by_state # @param [Hash{Symbol=>String}] pods_by_state
...@@ -23,10 +25,11 @@ module Pod ...@@ -23,10 +25,11 @@ module Pod
@unchanged = [] @unchanged = []
if pods_by_state if pods_by_state
@added = pods_by_state[:added] || [] STATES.each do |state|
@deleted = pods_by_state[:removed] || [] Array(pods_by_state[state]).each do |name|
@changed = pods_by_state[:changed] || [] add_name(name, state)
@unchanged = pods_by_state[:unchanged] || [] end
end
end end
end end
...@@ -68,7 +71,7 @@ module Pod ...@@ -68,7 +71,7 @@ module Pod
# @return [void] # @return [void]
# #
def add_name(name, state) def add_name(name, state)
send(state) << name send(state) << Specification.root_name(name)
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment