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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
32 deletions
+88
-32
pod_source_installer.rb
lib/cocoapods/installer/pod_source_installer.rb
+18
-15
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+70
-17
No files found.
lib/cocoapods/installer/pod_source_installer.rb
View file @
b2fcbbb2
...
@@ -8,9 +8,6 @@ module Pod
...
@@ -8,9 +8,6 @@ module Pod
#
#
class
PodSourceInstaller
class
PodSourceInstaller
# TODO: local option specs.
# TODO: add tests for multi platform / subspecs issues.
# @return [Sandbox]
# @return [Sandbox]
#
#
attr_reader
:sandbox
attr_reader
:sandbox
...
@@ -30,7 +27,13 @@ module Pod
...
@@ -30,7 +27,13 @@ module Pod
@clean
=
true
@clean
=
true
@generate_docs
=
false
@generate_docs
=
false
@install_docs
=
false
@install_docs
=
false
@agressive_cache
=
false
@aggressive_cache
=
false
end
# @return [String] A string suitable for debugging.
#
def
inspect
"<
#{
self
.
class
}
sandbox=
#{
sandbox
.
root
}
pod=
#{
root_spec
.
name
}
"
end
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
...
@@ -57,15 +60,6 @@ module Pod
...
@@ -57,15 +60,6 @@ module Pod
attr_accessor
:clean
attr_accessor
:clean
alias_method
:clean?
,
: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
# @return [Bool] whether the documentation should be generated for the
# Pod.
# Pod.
#
#
...
@@ -78,6 +72,15 @@ module Pod
...
@@ -78,6 +72,15 @@ module Pod
attr_accessor
:install_docs
attr_accessor
:install_docs
alias_method
:install_docs?
,
: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
public
...
@@ -195,7 +198,7 @@ module Pod
...
@@ -195,7 +198,7 @@ module Pod
@downloader
=
self
.
class
.
downloader_class
.
for_target
(
root
,
root_spec
.
source
.
dup
)
@downloader
=
self
.
class
.
downloader_class
.
for_target
(
root
,
root_spec
.
source
.
dup
)
@downloader
.
cache_root
=
CACHE_ROOT
@downloader
.
cache_root
=
CACHE_ROOT
@downloader
.
max_cache_size
=
MAX_CACHE_SIZE
@downloader
.
max_cache_size
=
MAX_CACHE_SIZE
@downloader
.
ag
ressive_cache
=
a
gressive_cache?
@downloader
.
ag
gressive_cache
=
ag
gressive_cache?
@downloader
@downloader
end
end
...
@@ -324,7 +327,7 @@ module Pod
...
@@ -324,7 +327,7 @@ module Pod
#
#
def
header_mappings
(
headers_sandbox
,
consumer
,
headers
)
def
header_mappings
(
headers_sandbox
,
consumer
,
headers
)
dir
=
headers_sandbox
dir
=
headers_sandbox
dir
=
base_
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
dir
=
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
mappings
=
{}
mappings
=
{}
headers
.
each
do
|
header
|
headers
.
each
do
|
header
|
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
b2fcbbb2
...
@@ -3,23 +3,39 @@ require File.expand_path('../../../spec_helper', __FILE__)
...
@@ -3,23 +3,39 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
module
Pod
describe
Installer
::
PodSourceInstaller
do
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
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
end
#-------------------------------------------------------------------------#
it
"doesn't installs the docs by default"
do
@installer
.
should
.
not
.
install_docs?
end
describe
"Installation"
do
it
"doesn't use an aggressive cache by default"
do
@installer
.
should
.
not
.
aggressive_cache?
end
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
end
#-------------------------------------------------------------------------#
describe
"Installation"
do
describe
"Download"
do
describe
"Download"
do
it
"downloads the source"
do
it
"downloads the source"
do
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
...
@@ -124,35 +140,72 @@ module Pod
...
@@ -124,35 +140,72 @@ module Pod
end
end
#--------------------------------------#
describe
"Options"
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
end
#-------------------------------------------------------------------------#
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
describe
"Private Helpers"
do
end
#--------------------------------------#
#--------------------------------------#
describe
"#clean_paths"
do
describe
"Specifications details"
do
xit
"handles Pods which return different file patterns per platform"
do
end
end
#--------------------------------------#
xit
"handles Pods with multiple subspecs activated"
do
describe
"#used_files"
do
end
end
end
#--------------------------------------#
end
#-------------------------------------------------------------------------#
describe
"#header_mapping
s"
do
describe
"Private Helper
s"
do
xit
"can handle the mappings headers of subspecs"
do
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
end
xit
"returns the header mappings"
do
end
end
#--------------------------------------#
xit
"returns the header mappings including subspecs"
do
end
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