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
4d615109
Commit
4d615109
authored
Mar 14, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Respect config.clean?
parent
cfd10bfb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
29 deletions
+20
-29
installer.rb
lib/cocoapods/installer.rb
+5
-1
pod_source_installer.rb
lib/cocoapods/installer/pod_source_installer.rb
+1
-13
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+0
-14
installer_spec.rb
spec/unit/installer_spec.rb
+14
-1
No files found.
lib/cocoapods/installer.rb
View file @
4d615109
...
@@ -243,7 +243,6 @@ module Pod
...
@@ -243,7 +243,6 @@ module Pod
@pod_installers
||=
[]
@pod_installers
||=
[]
pod_installer
=
PodSourceInstaller
.
new
(
sandbox
,
specs_by_platform
)
pod_installer
=
PodSourceInstaller
.
new
(
sandbox
,
specs_by_platform
)
pod_installer
.
clean
=
config
.
clean?
pod_installer
.
aggressive_cache
=
config
.
aggressive_cache?
pod_installer
.
aggressive_cache
=
config
.
aggressive_cache?
pod_installer
.
generate_docs
=
config
.
generate_docs?
pod_installer
.
generate_docs
=
config
.
generate_docs?
pod_installer
.
install_docs
=
config
.
install_docs?
pod_installer
.
install_docs
=
config
.
install_docs?
...
@@ -252,7 +251,12 @@ module Pod
...
@@ -252,7 +251,12 @@ module Pod
@installed_specs
.
concat
(
specs_by_platform
.
values
.
flatten
)
@installed_specs
.
concat
(
specs_by_platform
.
values
.
flatten
)
end
end
# Cleans the sources of the Pods if the config instructs to do so.
#
# @todo Why the @pod_installers might be empty?
#
def
clean_pod_sources
def
clean_pod_sources
return
unless
config
.
clean?
return
unless
@pod_installers
return
unless
@pod_installers
@pod_installers
.
each
do
|
pod_installer
|
@pod_installers
.
each
do
|
pod_installer
|
pod_installer
.
clean!
pod_installer
.
clean!
...
...
lib/cocoapods/installer/pod_source_installer.rb
View file @
4d615109
...
@@ -24,7 +24,6 @@ module Pod
...
@@ -24,7 +24,6 @@ module Pod
@sandbox
=
sandbox
@sandbox
=
sandbox
@specs_by_platform
=
specs_by_platform
@specs_by_platform
=
specs_by_platform
@clean
=
true
@generate_docs
=
false
@generate_docs
=
false
@install_docs
=
false
@install_docs
=
false
@aggressive_cache
=
false
@aggressive_cache
=
false
...
@@ -42,12 +41,6 @@ module Pod
...
@@ -42,12 +41,6 @@ module Pod
# @!group Configuration
# @!group Configuration
# @return [Bool] whether the file not used by CocoaPods should be
# removed.
#
attr_accessor
:clean
alias_method
:clean?
,
:clean
# @return [Bool] whether the documentation should be generated for the
# @return [Bool] whether the documentation should be generated for the
# Pod.
# Pod.
#
#
...
@@ -92,7 +85,7 @@ module Pod
...
@@ -92,7 +85,7 @@ module Pod
# @return [void]
# @return [void]
#
#
def
clean!
def
clean!
clean_installation
if
clean?
&&
!
local?
clean_installation
if
!
local?
end
end
# @return [Hash]
# @return [Hash]
...
@@ -133,10 +126,6 @@ module Pod
...
@@ -133,10 +126,6 @@ module Pod
# @return [void]
# @return [void]
#
#
def
generate_docs
def
generate_docs
if
@cleaned
raise
Informative
,
"Attempt to generate the documentation from a cleaned Pod."
end
if
documentation_generator
.
already_installed?
if
documentation_generator
.
already_installed?
UI
.
section
" > Using existing documentation"
UI
.
section
" > Using existing documentation"
else
else
...
@@ -153,7 +142,6 @@ module Pod
...
@@ -153,7 +142,6 @@ module Pod
#
#
def
clean_installation
def
clean_installation
clean_paths
.
each
{
|
path
|
FileUtils
.
rm_rf
(
path
)
}
clean_paths
.
each
{
|
path
|
FileUtils
.
rm_rf
(
path
)
}
@cleaned
=
true
end
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
4d615109
...
@@ -14,10 +14,6 @@ module Pod
...
@@ -14,10 +14,6 @@ module Pod
describe
"In General"
do
describe
"In General"
do
it
"cleans by default"
do
@installer
.
should
.
clean?
end
it
"doesn't generate docs by default"
do
it
"doesn't generate docs by default"
do
@installer
.
should
.
not
.
generate_docs?
@installer
.
should
.
not
.
generate_docs?
end
end
...
@@ -105,7 +101,6 @@ module Pod
...
@@ -105,7 +101,6 @@ module Pod
describe
"Cleaning"
do
describe
"Cleaning"
do
it
"cleans the paths non used by the installation"
do
it
"cleans the paths non used by the installation"
do
@installer
.
clean
=
true
@installer
.
install!
@installer
.
install!
@installer
.
clean!
@installer
.
clean!
unused_file
=
config
.
sandbox
.
root
+
'BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file
=
config
.
sandbox
.
root
+
'BananaLib/sub-dir/sub-dir-2/somefile.txt'
...
@@ -113,21 +108,12 @@ module Pod
...
@@ -113,21 +108,12 @@ module Pod
end
end
it
"preserves important files like the LICENSE and the README"
do
it
"preserves important files like the LICENSE and the README"
do
@installer
.
clean
=
true
@installer
.
install!
@installer
.
install!
@installer
.
clean!
@installer
.
clean!
readme_file
=
config
.
sandbox
.
root
+
'BananaLib/README'
readme_file
=
config
.
sandbox
.
root
+
'BananaLib/README'
readme_file
.
should
.
exist
readme_file
.
should
.
exist
end
end
it
"doesn't performs any cleaning if instructed to do so"
do
@installer
.
clean
=
false
@installer
.
install!
@installer
.
clean!
unused_file
=
config
.
sandbox
.
root
+
'BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file
.
should
.
exist
end
end
end
#--------------------------------------#
#--------------------------------------#
...
...
spec/unit/installer_spec.rb
View file @
4d615109
...
@@ -181,8 +181,21 @@ module Pod
...
@@ -181,8 +181,21 @@ module Pod
@installer
.
installed_specs
.
should
==
[
spec
]
@installer
.
installed_specs
.
should
==
[
spec
]
end
end
end
#--------------------------------------#
describe
"#clean"
do
it
"it cleans only if the config instructs to do it"
do
config
.
clean
=
false
@installer
.
send
(
:clean_pod_sources
)
Installer
::
PodSourceInstaller
.
any_instance
.
expects
(
:install!
).
never
end
end
#--------------------------------------#
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