Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
c251474b
Commit
c251474b
authored
Feb 27, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FileAccessor] Add #root and clean up interface
parent
9d9e4a53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
file_accessor.rb
lib/cocoapods/sandbox/file_accessor.rb
+10
-2
file_accessor_spec.rb
spec/unit/sandbox/file_accessor_spec.rb
+12
-8
No files found.
lib/cocoapods/sandbox/file_accessor.rb
View file @
c251474b
...
...
@@ -5,6 +5,8 @@ module Pod
# taking into account any exclude pattern and the default extensions to use
# for directories.
#
# @note The FileAccessor always returns absolute paths.
#
class
FileAccessor
HEADER_EXTENSIONS
=
Xcodeproj
::
Constants
::
HEADER_FILES_EXTENSIONS
...
...
@@ -31,6 +33,12 @@ module Pod
end
end
# @return [Pathname] the directory which contains the files of the Pod.
#
def
root
path_list
.
root
end
# @return [Specification] the specification.
#
def
spec
...
...
@@ -39,8 +47,8 @@ module Pod
# @return [Specification] the platform used to consume the specification.
#
def
platform
spec_consumer
.
platform
def
platform
_name
spec_consumer
.
platform
_name
end
# @return [String] A string suitable for debugging.
...
...
spec/unit/sandbox/file_accessor_spec.rb
View file @
c251474b
...
...
@@ -13,14 +13,6 @@ module Pod
describe
"In general"
do
it
"returns the root"
do
@accessor
.
path_list
.
should
==
@path_list
end
it
"returns the specification"
do
@accessor
.
spec_consumer
.
should
==
@spec_consumer
end
it
"raises if the consumer is nil"
do
e
=
lambda
{
FileAccessor
.
new
(
@path_list
,
nil
)
}.
should
.
raise
Informative
e
.
message
.
should
.
match
/without a specification consumer/
...
...
@@ -34,6 +26,18 @@ module Pod
e
.
message
.
should
.
match
/non existent folder/
end
it
"returns the root"
do
@accessor
.
root
.
should
==
@path_list
.
root
end
it
"returns the specification"
do
@accessor
.
spec
.
should
==
@spec
end
it
"returns the platform for which the spec is being consumed"
do
@accessor
.
platform_name
.
should
==
:ios
end
end
#-------------------------------------------------------------------------#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment