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
b2fcbbb2
Commit
b2fcbbb2
authored
Feb 04, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodSourceInstaller] Minor tweaks
parent
1168e907
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
38 deletions
+94
-38
pod_source_installer.rb
lib/cocoapods/installer/pod_source_installer.rb
+21
-18
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+73
-20
No files found.
lib/cocoapods/installer/pod_source_installer.rb
View file @
b2fcbbb2
...
...
@@ -8,9 +8,6 @@ module Pod
#
class
PodSourceInstaller
# TODO: local option specs.
# TODO: add tests for multi platform / subspecs issues.
# @return [Sandbox]
#
attr_reader
:sandbox
...
...
@@ -27,10 +24,16 @@ module Pod
@sandbox
=
sandbox
@specs_by_platform
=
specs_by_platform
@clean
=
true
@generate_docs
=
false
@install_docs
=
false
@agressive_cache
=
false
@clean
=
true
@generate_docs
=
false
@install_docs
=
false
@aggressive_cache
=
false
end
# @return [String] A string suitable for debugging.
#
def
inspect
"<
#{
self
.
class
}
sandbox=
#{
sandbox
.
root
}
pod=
#{
root_spec
.
name
}
"
end
#-----------------------------------------------------------------------#
...
...
@@ -57,15 +60,6 @@ module Pod
attr_accessor
:clean
alias_method
:clean?
,
:clean
# @return [Bool] whether the downloader should always check against the
# remote if issues might be generated (mostly useful to speed up
# testing).
#
# @note This might be removed in future.
#
attr_accessor
:agressive_cache
alias_method
:agressive_cache?
,
:agressive_cache
# @return [Bool] whether the documentation should be generated for the
# Pod.
#
...
...
@@ -78,6 +72,15 @@ module Pod
attr_accessor
:install_docs
alias_method
:install_docs?
,
:install_docs
# @return [Bool] whether the downloader should always check against the
# remote if issues might be generated (mostly useful to speed up
# testing).
#
# @note This might be removed in future.
#
attr_accessor
:aggressive_cache
alias_method
:aggressive_cache?
,
:aggressive_cache
#-----------------------------------------------------------------------#
public
...
...
@@ -195,7 +198,7 @@ module Pod
@downloader
=
self
.
class
.
downloader_class
.
for_target
(
root
,
root_spec
.
source
.
dup
)
@downloader
.
cache_root
=
CACHE_ROOT
@downloader
.
max_cache_size
=
MAX_CACHE_SIZE
@downloader
.
ag
ressive_cache
=
a
gressive_cache?
@downloader
.
ag
gressive_cache
=
ag
gressive_cache?
@downloader
end
...
...
@@ -324,7 +327,7 @@ module Pod
#
def
header_mappings
(
headers_sandbox
,
consumer
,
headers
)
dir
=
headers_sandbox
dir
=
base_
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
dir
=
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
mappings
=
{}
headers
.
each
do
|
header
|
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
b2fcbbb2
...
...
@@ -3,9 +3,32 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Installer
::
PodSourceInstaller
do
before
do
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
)
}
specs_by_platform
=
{
:ios
=>
[
@spec
]
}
@installer
=
Installer
::
PodSourceInstaller
.
new
(
config
.
sandbox
,
specs_by_platform
)
end
#-------------------------------------------------------------------------#
describe
"In General"
do
# TODO: describe defaults
it
"cleans by default"
do
@installer
.
should
.
clean?
end
it
"doesn't generate docs by default"
do
@installer
.
should
.
not
.
generate_docs?
end
it
"doesn't installs the docs by default"
do
@installer
.
should
.
not
.
install_docs?
end
it
"doesn't use an aggressive cache by default"
do
@installer
.
should
.
not
.
aggressive_cache?
end
end
...
...
@@ -13,13 +36,6 @@ module Pod
describe
"Installation"
do
before
do
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
)
}
specs_by_platform
=
{
:ios
=>
[
@spec
]
}
@installer
=
Installer
::
PodSourceInstaller
.
new
(
config
.
sandbox
,
specs_by_platform
)
end
describe
"Download"
do
it
"downloads the source"
do
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
...
...
@@ -40,7 +56,7 @@ module Pod
it
"returns the checkout options of the downloader if any"
do
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:branch
=>
'topicbranch'
}
@installer
.
install!
@installer
.
install!
@installer
.
specific_source
[
:commit
].
should
==
"446b22414597f1bb4062a62c4eed7af9627a3f1b"
pod_folder
=
config
.
sandbox
.
root
+
'BananaLib'
pod_folder
.
should
.
exist
...
...
@@ -124,35 +140,72 @@ module Pod
end
end
#--------------------------------------#
#-------------------------------------------------------------------------#
describe
"Options"
do
describe
"Private Helpers"
do
it
"doesn't downloads the source if the pod was already downloaded"
do
@installer
.
stubs
(
:predownloaded?
).
returns
(
true
)
@installer
.
expects
(
:download_source
).
never
@installer
.
stubs
(
:clean_installation
)
@installer
.
stubs
(
:link_headers
)
@installer
.
install!
end
#--------------------------------------#
it
"doesn't downloads the source if the pod has a local source"
do
@installer
.
local_path
=
'Some Path'
@installer
.
expects
(
:download_source
).
never
@installer
.
stubs
(
:clean_installation
)
@installer
.
stubs
(
:link_headers
)
@installer
.
install!
end
describe
"#clean_paths"
do
it
"doesn't clean the installation if the pod has a local source"
do
@installer
.
local_path
=
'Some Path'
@installer
.
expects
(
:clean_installation
).
never
@installer
.
stubs
(
:link_headers
)
@installer
.
install!
end
end
#--------------------------------------#
describe
"#used_files"
do
describe
"Specifications details"
do
xit
"handles Pods which return different file patterns per platform"
do
end
xit
"handles Pods with multiple subspecs activated"
do
end
end
#--------------------------------------#
end
describe
"#header_mappings"
do
#-------------------------------------------------------------------------#
xit
"can handle the mappings headers of subspec
s"
do
describe
"Private Helper
s"
do
end
xit
"returns the clean paths"
do
@installer
.
send
(
:download_source
)
@installer
.
send
(
:clean_paths
).
should
==
[]
end
xit
"returns the used files"
do
@installer
.
send
(
:download_source
)
@installer
.
send
(
:used_files
).
should
==
[]
end
#--------------------------------------#
xit
"returns the header mappings"
do
end
xit
"returns the header mappings including subspecs"
do
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