Commit ff7a7196 authored by Fabio Pelosin's avatar Fabio Pelosin

[Source] The name should be an attribute.

parent 47655826
......@@ -18,10 +18,6 @@ module Pod
end
end
def names
dirs.map { |repo| repo.basename.to_s }.sort
end
def all_sets
all.map(&:pod_sets).flatten
end
......@@ -58,16 +54,16 @@ module Pod
Aggregate.new.search_by_name(name, full_text_search)
end
def self.names
Aggregate.new.names
end
attr_reader :repo
def initialize(repo)
@repo = repo
end
def name
@repo.basename.to_s
end
def pod_sets
@repo.children.map do |child|
if child.directory? && child.basename.to_s != '.git'
......
......@@ -38,6 +38,6 @@ describe "Pod::Source" do
end
it "return the names of the repos" do
Pod::Source.names.should == %w| repo1 repo2 |
Pod::Source.all.map(&:name).should == %w| repo1 repo2 |
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