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
efb81a02
Commit
efb81a02
authored
Feb 16, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Sandbox] Clean up implementation
parent
d5f4684c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
255 additions
and
185 deletions
+255
-185
external_sources.rb
lib/cocoapods/external_sources.rb
+12
-39
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+1
-1
project.rb
lib/cocoapods/project.rb
+30
-30
sandbox.rb
lib/cocoapods/sandbox.rb
+81
-56
external_sources_spec.rb
spec/unit/external_sources_spec.rb
+24
-18
project_spec.rb
spec/unit/project_spec.rb
+63
-11
sandbox_spec.rb
spec/unit/sandbox_spec.rb
+44
-30
No files found.
lib/cocoapods/external_sources.rb
View file @
efb81a02
...
...
@@ -60,10 +60,10 @@ module Pod
#--------------------------------------#
# @!group Specifications
public
# @!group Specifications
# @return [Specification] returns the specification, either from the
# sandbox or by fetching the remote source, associated with the
# external source.
...
...
@@ -96,6 +96,8 @@ module Pod
#--------------------------------------#
public
# @!group Subclasses hooks
# Fetches the external source from the remote according to the params.
...
...
@@ -117,39 +119,10 @@ module Pod
#--------------------------------------#
# @! Subclasses helpers
private
# Stores a specification in the `Local Podspecs` folder.
#
# @param [Sandbox] sandbox
# the sandbox where the podspec should be stored.
#
# @param [String, Pathname] podspec
# The contents of the specification (String) or the path to a
# podspec file (Pathname).
#
# @todo This could be done by the sandbox.
# @todo Store all the specifications (including those not originating
# from external sources) so users can check them.
# @todo The check for the podspec string is a bit primitive.
#
def
store_podspec
(
sandbox
,
podspec
)
output_path
=
sandbox
.
root
+
"Local Podspecs/
#{
name
}
.podspec"
output_path
.
dirname
.
mkpath
if
podspec
.
is_a?
(
String
)
unless
podspec
.
include?
(
'Spec.new'
)
raise
Informative
,
"The `
#{
name
}
.podspec` from `
#{
description
}
` appears to be invalid."
end
output_path
.
open
(
'w'
)
{
|
f
|
f
.
puts
(
podspec
)
}
else
unless
podspec
.
exist?
raise
Informative
,
"No podspec found for `
#{
name
}
` in
#{
description
}
"
end
FileUtils
.
copy
(
podspec
,
output_path
)
end
end
# @! Subclasses helpers
# Pre-downloads a Pod passing the options to the downloader and informing
# the sandbox.
...
...
@@ -165,8 +138,8 @@ module Pod
target
.
rmtree
if
target
.
exist?
downloader
=
Downloader
.
for_target
(
target
,
@params
)
downloader
.
download
s
tore_podspec
(
sandbox
,
target
+
"
#{
name
}
.podspec"
)
sandbox
.
predownloaded_pods
<<
name
s
andbox
.
store_podspec
(
name
,
target
+
"
#{
name
}
.podspec"
,
true
)
sandbox
.
store_pre_downloaded_pod
(
name
)
if
downloader
.
options_specific?
source
=
@params
else
...
...
@@ -291,7 +264,7 @@ module Pod
path
=
@params
[
:podspec
]
path
=
Pathname
.
new
(
path
).
expand_path
if
path
.
to_s
.
start_with?
(
"~"
)
require
'open-uri'
open
(
path
)
{
|
io
|
s
tore_podspec
(
sandbox
,
io
.
read
)
}
open
(
path
)
{
|
io
|
s
andbox
.
store_podspec
(
name
,
io
.
read
,
true
)
}
end
end
...
...
@@ -314,7 +287,7 @@ module Pod
# @see AbstractExternalSource#copy_external_source_into_sandbox
#
def
copy_external_source_into_sandbox
(
sandbox
)
s
tore_podspec
(
sandbox
,
pod_spec_path
)
s
andbox
.
store_podspec
(
name
,
pod_spec_path
,
true
)
sandbox
.
store_local_path
(
name
,
@params
[
:local
])
end
...
...
@@ -349,10 +322,10 @@ module Pod
#--------------------------------------#
# @!group Helpers
private
# @!group Helpers
# @return [Pathname] the path of the podspec.
#
def
pod_spec_path
...
...
lib/cocoapods/installer/target_installer.rb
View file @
efb81a02
...
...
@@ -222,7 +222,7 @@ module Pod
def
create_copy_resources_script
path
=
library
.
copy_resources_script_path
UI
.
message
"- Generating copy resources script at
#{
UI
.
path
(
path
)
}
"
do
resources
=
library
.
file_accessors
.
map
{
|
accessor
|
accessor
.
resources
.
values
.
flatten
.
map
{
|
res
|
sandbox
.
relativize
(
res
)}
}.
flatten
resources
=
library
.
file_accessors
.
map
{
|
accessor
|
accessor
.
resources
.
values
.
flatten
.
map
{
|
res
|
project
.
relativize
(
res
)}
}.
flatten
resources
<<
bridge_support_file
if
bridge_support_file
generator
=
Generator
::
CopyResourcesScript
.
new
(
resources
)
generator
.
save_as
(
path
)
...
...
lib/cocoapods/project.rb
View file @
efb81a02
...
...
@@ -35,6 +35,35 @@ module Pod
@root
||=
path
.
dirname
end
# @return [Pathname] Returns the relative path from the project root.
#
# @param [Pathname] path
# The path that needs to be converted to the relative format.
#
# @note If the two absolute paths don't share the same root directory an
# extra `../` is added to the result of
# {Pathname#relative_path_from}.
#
# @example
#
# path = Pathname.new('/Users/dir')
# @sandbox.root #=> Pathname('/tmp/CocoaPods/Lint/Pods')
#
# @sandbox.relativize(path) #=> '../../../../Users/dir'
# @sandbox.relativize(path) #=> '../../../../../Users/dir'
#
def
relativize
(
path
)
unless
path
.
absolute?
raise
Informative
,
"Attempt to add relative path to the Pods project"
end
result
=
path
.
relative_path_from
(
root
)
unless
root
.
to_s
.
split
(
'/'
)[
1
]
==
path
.
to_s
.
split
(
'/'
)[
1
]
result
=
Pathname
.
new
(
'../'
)
+
result
end
result
end
# @return [String] a string representation suited for debugging.
#
def
inspect
...
...
@@ -107,7 +136,7 @@ module Pod
# Adds a file reference for each one of the given files in the specified
# group, namespaced by specification unless a file reference for the given
# path alrady exits.
# path alr
e
ady exits.
#
# @note With this set-up different subspecs might not reference the same
# file (i.e. the first will win). Not sure thought if this is a
...
...
@@ -149,35 +178,6 @@ module Pod
refs_by_absolute_path
[
absolute_path
]
end
# @return [Pathname] Returns the relative path from the project root.
#
# @param [Pathname] path
# The path that needs to be converted to the relative format.
#
# @note If the two absolute paths don't share the same root directory an
# extra `../` is added to the result of
# {Pathname#relative_path_from}.
#
# @example
#
# path = Pathname.new('/Users/dir')
# @sandbox.root #=> Pathname('/tmp/CocoaPods/Lint/Pods')
#
# @sandbox.relativize(path) #=> '../../../../Users/dir'
# @sandbox.relativize(path) #=> '../../../../../Users/dir'
#
def
relativize
(
path
)
unless
path
.
absolute?
raise
Informative
,
"Attempt to add relative path to the Pods project"
end
result
=
path
.
relative_path_from
(
root
)
unless
root
.
to_s
.
split
(
'/'
)[
1
]
==
path
.
to_s
.
split
(
'/'
)[
1
]
result
=
Pathname
.
new
(
'../'
)
+
result
end
result
end
# Adds a file reference to the podfile.
#
# @param [Pathname,String] podfile_path
...
...
lib/cocoapods/sandbox.rb
View file @
efb81a02
...
...
@@ -13,7 +13,7 @@ module Pod
# Pods
# |
# +-- Headers
# | +--
Build
# | +--
Private
# | | +-- [Pod Name]
# | +-- Public
# | +-- [Pod Name]
...
...
@@ -22,6 +22,8 @@ module Pod
# | +-- [Pod Name]
# |
# +-- Specifications
# | +-- External Sources
# | +-- Normal Sources
# |
# +-- Target Support Files
# | +-- [Target Name]
...
...
@@ -84,36 +86,6 @@ module Pod
root
.
rmtree
end
# @return [Pathname] Returns the relative path from the sandbox.
#
# @note If the two absolute paths don't share the same root directory an
# extra `../` is added to the result of {Pathname#relative_path_from}
#
#
# @example
#
# path = Pathname.new('/Users/dir')
# @sandbox.root #=> Pathname('/tmp/CocoaPods/Lint/Pods')
#
# @sandbox.relativize(path) #=> '../../../../Users/dir'
# @sandbox.relativize(path) #=> '../../../../../Users/dir'
#
def
relativize
(
path
)
result
=
path
.
relative_path_from
(
root
)
unless
root
.
to_s
.
split
(
'/'
)[
1
]
==
path
.
to_s
.
split
(
'/'
)[
1
]
result
=
Pathname
.
new
(
'../'
)
+
result
end
result
end
# Converts a list of paths to their relative variant.
#
# @return [Array<Pathname>] the relative paths.
#
def
relativize_paths
(
paths
)
paths
.
map
{
|
path
|
relativize
(
path
)
}
end
# @return [String] a string representation suitable for debugging.
#
def
inspect
...
...
@@ -122,6 +94,8 @@ module Pod
#-------------------------------------------------------------------------#
public
# @!group Paths
# @return [Pathname] the path of the manifest.
...
...
@@ -149,64 +123,115 @@ module Pod
root
end
# Returns the path where the Pod with the given name is stored, taking into
# account whether the Pod is locally sourced.
#
# @param [String] name
# The name of the Pod.
#
# @return [Pathname] the path of the Pod.
#
def
pod_dir
(
name
)
root_name
=
Specification
.
root_name
(
name
)
if
local?
(
root_name
)
Pathname
.
new
(
local_pods
[
root_name
])
else
# root + "Sources/#{name}"
root
+
root_name
end
end
#-------------------------------------------------------------------------#
public
# @!group Specification store
# Returns the specification for the Pod with the given name.
#
# @param [String] name
# the name of the Pod for which the specification is requested.
#
# @return [Specification] the specification if the file is found.
#
def
specification
(
name
)
if
file
=
specification_path
(
name
)
Specification
.
from_file
(
file
)
end
end
# @return [Pathname] the path for the directory where to store the
# specifications.
#
def
specifications_dir
# @todo Migrate old installations and store the for all the pods.
# Two folders should be created `External Sources` and `Podspecs`.
#
def
specifications_dir
(
external_source
=
false
)
# root + "Specifications"
root
+
"Local Podspecs"
end
# Returns the path of the specification for the Pod with the
# given name.
# given name
, if one is stored
.
#
# @param [String] name
# the name of the Pod for which the podspec file is requested.
#
# @return [Pathname] the path or nil.
# @return [Nil] if the podspec is not stored.
#
def
specification_path
(
name
)
path
=
specifications_dir
+
"
#{
name
}
.podspec"
path
.
exist?
?
path
:
nil
end
#-------------------------------------------------------------------------#
# @!group Pods storage & source
# Returns the specification for the Pod with the given name.
# Stores a specification in the `Local Podspecs` folder.
#
# @param [S
tring] name
# the
name of the Pod for which the specification is request
ed.
# @param [S
andbox] sandbox
# the
sandbox where the podspec should be stor
ed.
#
# @return [Specification] the specification if the file is found.
# @param [String, Pathname] podspec
# The contents of the specification (String) or the path to a
# podspec file (Pathname).
#
def
specification
(
name
)
if
file
=
specification_path
(
name
)
Specification
.
from_file
(
file
)
# @todo Store all the specifications (including those not originating
# from external sources) so users can check them.
#
def
store_podspec
(
name
,
podspec
,
external_source
=
false
)
output_path
=
specifications_dir
(
external_source
)
+
"
#{
name
}
.podspec"
output_path
.
dirname
.
mkpath
if
podspec
.
is_a?
(
String
)
output_path
.
open
(
'w'
)
{
|
f
|
f
.
puts
(
podspec
)
}
else
unless
podspec
.
exist?
raise
Informative
,
"No podspec found for `
#{
name
}
` in
#{
podspec
}
"
end
FileUtils
.
copy
(
podspec
,
output_path
)
end
spec
=
Specification
.
from_file
(
output_path
)
unless
spec
.
name
==
name
raise
Informative
,
"The name of the given podspec `
#{
spec
.
name
}
` doesn't match the expected one `
#{
name
}
`"
end
end
# Returns the path where the Pod with the given name is stored, taking into
# account whether the Pod is locally sourced.
#-------------------------------------------------------------------------#
public
# @!group Pods information
# Marks a Pod as pre-downloaded
#
# @param [String] name
# The name of the Pod.
#
# @return [
Pathname] the path of the Pod.
# @return [
void]
#
def
pod_dir
(
name
)
def
store_pre_downloaded_pod
(
name
)
root_name
=
Specification
.
root_name
(
name
)
if
local?
(
root_name
)
Pathname
.
new
(
local_pods
[
root_name
])
else
# root + "Sources/#{name}"
root
+
root_name
end
predownloaded_pods
<<
root_name
end
#--------------------------------------#
# @return [Array<String>] The names of the pods that have been
# pre-downloaded from an external source.
#
...
...
spec/unit/external_sources_spec.rb
View file @
efb81a02
...
...
@@ -20,6 +20,15 @@ module Pod
describe
ExternalSources
::
AbstractExternalSource
do
before
do
dependency
=
Dependency
.
new
(
"Reachability"
,
:git
=>
fixture
(
'integration/Reachability'
))
@external_source
=
ExternalSources
.
from_dependency
(
dependency
)
end
#--------------------------------------#
describe
"In general"
do
it
"compares to another"
do
dependency_1
=
Dependency
.
new
(
"Reachability"
,
:git
=>
'url'
)
dependency_2
=
Dependency
.
new
(
"Another_name"
,
:git
=>
'url'
)
...
...
@@ -30,27 +39,22 @@ module Pod
dependency_1
.
should
.
not
.
be
==
dependency_3
end
before
do
dependency
=
Dependency
.
new
(
"Reachability"
,
:git
=>
fixture
(
'integration/Reachability'
))
@external_source
=
ExternalSources
.
from_dependency
(
dependency
)
end
it
"returns the specification from the sandbox if available"
do
@external_source
.
specification_from_external
(
config
.
sandbox
)
config
.
sandbox
.
store_podspec
(
'Reachability'
,
fixture
(
'integration/Reachability/Reachability.podspec'
)
)
@external_source
.
expects
(
:specification_from_external
).
never
@external_source
.
specification
(
config
.
sandbox
).
name
.
should
==
'Reachability'
end
it
"returns the specification from the remote if needed
"
do
it
"fetches the remote if needed to return the specification
"
do
@external_source
.
specification
(
config
.
sandbox
).
name
.
should
==
'Reachability'
end
it
"returns the specification from
the sandbox if available"
do
it
"returns the specification as stored in
the sandbox if available"
do
@external_source
.
specification_from_external
(
config
.
sandbox
)
@external_source
.
specification_from_local
(
config
.
sandbox
).
name
.
should
==
'Reachability'
end
it
"returns nil if the specification from the sandbox is not available
"
do
it
"returns nil if the specification requested from local is not available in the sandbox
"
do
@external_source
.
specification_from_local
(
config
.
sandbox
).
should
.
be
.
nil
end
...
...
@@ -58,19 +62,21 @@ module Pod
@external_source
.
specification_from_external
(
config
.
sandbox
).
name
.
should
==
'Reachability'
end
#--------------------------------------#
describe
"Subclasses helpers"
do
it
"stores the podspec in the sandbox"
do
sandbox
=
config
.
sandbox
podspec_path
=
fixture
(
'integration/Reachability/Reachability.podspec'
)
@external_source
.
send
(
:store_podspec
,
sandbox
,
podspec_path
)
it
"stores the specification in the sandbox after fetching it from the remote"
do
path
=
config
.
sandbox
.
root
+
'Local Podspecs/Reachability.podspec'
path
.
should
.
not
.
exist?
@external_source
.
specification_from_external
(
config
.
sandbox
).
name
.
should
==
'Reachability'
path
=
config
.
sandbox
.
root
+
'Local Podspecs/Reachability.podspec'
path
.
should
.
exist?
end
it
"pre-downloads the Pod and store the relevant information in the sandbox"
do
end
#--------------------------------------#
describe
"Subclasses helpers"
do
it
"pre-downloads the Pod and stores the relevant information in the sandbox"
do
sandbox
=
config
.
sandbox
@external_source
.
send
(
:pre_download
,
sandbox
)
path
=
config
.
sandbox
.
root
+
'Local Podspecs/Reachability.podspec'
...
...
spec/unit/project_spec.rb
View file @
efb81a02
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
Pod
::
Project
do
describe
"In general"
do
module
Pod
describe
Project
do
before
do
@project
=
P
od
::
P
roject
.
new
(
config
.
sandbox
.
project_path
)
@project
=
Project
.
new
(
config
.
sandbox
.
project_path
)
end
#-------------------------------------------------------------------------#
describe
"In general"
do
it
"creates the support file group on initialization"
do
@project
.
support_files_group
.
name
.
should
==
'Targets Support Files'
end
it
"can return the relative path of a given absolute path"
do
path
=
temporary_directory
+
'Pods/BananaLib/file'
@project
.
relativize
(
path
).
should
==
Pathname
.
new
(
'BananaLib/file'
)
end
it
"can return the relative path of a given absolute path outside its root"
do
path
=
temporary_directory
+
'file'
@project
.
relativize
(
path
).
should
==
Pathname
.
new
(
'../file'
)
end
it
"can return the relative path of a given absolute path with another root directory"
do
path
=
Pathname
(
'/tmp/Lint'
)
expected
=
Pathname
.
new
(
'../../../tmp/Lint'
)
@project
.
instance_variable_set
(
:@root
,
Pathname
.
new
(
'/Users/sandbox'
))
@project
.
relativize
(
path
).
should
==
expected
end
end
#-------------------------------------------------------------------------#
describe
"Groups"
do
it
"returns the `Pods` group"
do
@project
.
pods
.
name
.
should
==
'Pods'
end
...
...
@@ -38,16 +66,11 @@ describe Pod::Project do
g
.
children
.
should
.
be
.
empty?
end
it
"adds the Podfile configured as a Ruby file"
do
@project
.
add_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
f
=
@project
[
'Podfile'
]
f
.
name
.
should
==
'Podfile'
f
.
source_tree
.
should
==
'SOURCE_ROOT'
f
.
xc_language_specification_identifier
.
should
==
'xcode.lang.ruby'
f
.
path
.
should
==
'../Podfile'
end
#--------------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
describe
"File references"
do
it
"adds the file references for the given source files"
do
source_files
=
[
config
.
sandbox
.
root
+
"A_POD/some_file.m"
]
...
...
@@ -72,6 +95,35 @@ describe Pod::Project do
file_reference
=
@project
.
file_reference
(
file
)
file_reference
.
path
.
should
==
"A_POD/some_file.m"
end
it
"adds the Podfile configured as a Ruby file"
do
@project
.
add_podfile
(
config
.
sandbox
.
root
+
'../Podfile'
)
f
=
@project
[
'Podfile'
]
f
.
name
.
should
==
'Podfile'
f
.
source_tree
.
should
==
'SOURCE_ROOT'
f
.
xc_language_specification_identifier
.
should
==
'xcode.lang.ruby'
f
.
path
.
should
==
'../Podfile'
end
end
#-------------------------------------------------------------------------#
describe
"File references"
do
it
"stores the references by absolute path"
do
file
=
config
.
sandbox
.
root
+
"A_POD/some_file.m"
@project
.
add_file_references
([
file
],
'BananaLib'
,
@project
.
pods
)
refs_by_absolute_path
=
@project
.
send
(
:refs_by_absolute_path
)
refs_by_absolute_path
.
should
==
{
file
=>
@project
.
file_reference
(
file
)
}
end
end
#-------------------------------------------------------------------------#
end
end
...
...
spec/unit/sandbox_spec.rb
View file @
efb81a02
...
...
@@ -7,6 +7,10 @@ module Pod
@sandbox
=
Pod
::
Sandbox
.
new
(
temporary_directory
+
'Sandbox'
)
end
#-------------------------------------------------------------------------#
describe
"In general"
do
it
"automatically creates its root if it doesn't exist"
do
File
.
directory?
(
temporary_directory
+
'Sandbox'
).
should
.
be
.
true
end
...
...
@@ -32,30 +36,12 @@ module Pod
File
.
directory?
(
temporary_directory
+
'Sandbox'
).
should
.
be
.
false
end
it
"can return the relative path of a given absolute path"
do
path
=
temporary_directory
+
'Sandbox/file'
@sandbox
.
relativize
(
path
).
should
==
Pathname
.
new
(
'file'
)
end
it
"can return the relative path of a given absolute path outside the sandbox root"
do
path
=
temporary_directory
+
'file'
@sandbox
.
relativize
(
path
).
should
==
Pathname
.
new
(
'../file'
)
end
it
"can return the relative path of a given absolute path with another root directory"
do
path
=
Pathname
(
'/tmp/Lint'
)
expected
=
Pathname
.
new
(
'../../../tmp/Lint'
)
@sandbox
.
instance_variable_set
(
:@root
,
Pathname
.
new
(
'/Users/sandbox'
))
@sandbox
.
relativize
(
path
).
should
==
expected
end
it
"converts a list of paths to the relative paths respect to the sandbox"
do
paths
=
[
temporary_directory
+
'Sandbox/file_1'
,
temporary_directory
+
'Sandbox/file_2'
]
@sandbox
.
relativize_paths
(
paths
).
should
==
[
Pathname
.
new
(
'file_1'
),
Pathname
.
new
(
'file_2'
)]
end
#-------------------------------------------------------------------------#
describe
"Paths"
do
it
"returns the path of the manifest"
do
@sandbox
.
manifest_path
.
should
==
temporary_directory
+
'Sandbox/Manifest.lock'
end
...
...
@@ -68,19 +54,15 @@ module Pod
@sandbox
.
library_support_files_dir
(
'Pods'
).
should
==
temporary_directory
+
'Sandbox'
end
it
"returns the directory where to store the specifications
"
do
@sandbox
.
specifications_dir
.
should
==
temporary_directory
+
'Sandbox/Local Podspecs
'
it
"returns the directory where a Pod is stored
"
do
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
temporary_directory
+
'Sandbox/JSONKit
'
end
it
"returns the path to a spec file in the 'Local Podspecs' dir"
do
(
@sandbox
.
root
+
'Local Podspecs'
).
mkdir
FileUtils
.
cp
(
fixture
(
'banana-lib/BananaLib.podspec'
),
@sandbox
.
root
+
'Local Podspecs'
)
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
@sandbox
.
root
+
'Local Podspecs/BananaLib.podspec'
end
#-------------------------------------------------------------------------#
describe
"
Pods storage & sourc
e"
do
describe
"
Specification stor
e"
do
it
"loads the stored specification with the given name"
do
(
@sandbox
.
root
+
'Local Podspecs'
).
mkdir
...
...
@@ -88,10 +70,37 @@ module Pod
@sandbox
.
specification
(
'BananaLib'
).
name
.
should
==
'BananaLib'
end
it
"returns the directory where a Pod is stored"
do
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
temporary_directory
+
'Sandbox/JSONKit'
it
"returns the directory where to store the specifications"
do
@sandbox
.
specifications_dir
.
should
==
temporary_directory
+
'Sandbox/Local Podspecs'
end
it
"returns the path to a spec file in the 'Local Podspecs' dir"
do
(
@sandbox
.
root
+
'Local Podspecs'
).
mkdir
FileUtils
.
cp
(
fixture
(
'banana-lib/BananaLib.podspec'
),
@sandbox
.
root
+
'Local Podspecs'
)
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
@sandbox
.
root
+
'Local Podspecs/BananaLib.podspec'
end
it
"stores a podspec with a given path into the sandbox"
do
@sandbox
.
store_podspec
(
'BananaLib'
,
fixture
(
'banana-lib/BananaLib.podspec'
))
path
=
@sandbox
.
root
+
'Local Podspecs/BananaLib.podspec'
path
.
should
.
exist
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
path
end
it
"stores a podspec with the given string into the sandbox"
do
podspec_string
=
fixture
(
'banana-lib/BananaLib.podspec'
).
read
@sandbox
.
store_podspec
(
'BananaLib'
,
podspec_string
)
path
=
@sandbox
.
root
+
'Local Podspecs/BananaLib.podspec'
path
.
should
.
exist
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
path
end
end
#-------------------------------------------------------------------------#
describe
"Pods information"
do
it
"returns the directory where a local Pod is stored"
do
@sandbox
.
store_local_path
(
'BananaLib'
,
Pathname
.
new
(
'Some Path'
))
@sandbox
.
pod_dir
(
'BananaLib'
).
should
.
be
==
Pathname
.
new
(
'Some Path'
)
...
...
@@ -100,7 +109,12 @@ module Pod
#--------------------------------------#
it
"stores the list of the names of the pre-downloaded pods"
do
@sandbox
.
predownloaded_pods
<<
'BananaLib'
@sandbox
.
store_pre_downloaded_pod
(
'BananaLib'
)
@sandbox
.
predownloaded_pods
.
should
==
[
'BananaLib'
]
end
it
"returns the checkout sources of the Pods"
do
@sandbox
.
store_pre_downloaded_pod
(
'BananaLib/Subspec'
)
@sandbox
.
predownloaded_pods
.
should
==
[
'BananaLib'
]
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