Commit e0e487bd authored by Luke Redpath's avatar Luke Redpath

The Sandbox should be able to list its installed pods.

parent de263101
...@@ -6,6 +6,10 @@ module Pod ...@@ -6,6 +6,10 @@ module Pod
@specification, @sandbox = specification, sandbox @specification, @sandbox = specification, sandbox
end end
def self.from_podspec(podspec, sandbox)
new(Specification.from_file(podspec), sandbox)
end
def root def root
@sandbox.root + specification.name @sandbox.root + specification.name
end end
......
require 'fileutils'
module Pod module Pod
class Sandbox class Sandbox
attr_reader :root attr_reader :root
def initialize(path) def initialize(path)
@root = path @root = Pathname.new(path)
@header_search_paths = [] @header_search_paths = []
FileUtils.mkdir_p(@root) FileUtils.mkdir_p(@root)
...@@ -41,5 +43,11 @@ module Pod ...@@ -41,5 +43,11 @@ module Pod
def prepare_for_install def prepare_for_install
headers_root.rmtree if headers_root.exist? headers_root.rmtree if headers_root.exist?
end end
def installed_pods
Dir[root + "**/*.podspec"].map do |podspec|
LocalPod.from_podspec(Pathname.new(podspec), self)
end
end
end end
end end
...@@ -72,5 +72,4 @@ describe Pod::Sandbox do ...@@ -72,5 +72,4 @@ describe Pod::Sandbox do
@sandbox.prepare_for_install @sandbox.prepare_for_install
@sandbox.headers_root.should.not.exist @sandbox.headers_root.should.not.exist
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