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
1ed10b71
Commit
1ed10b71
authored
Apr 28, 2012
by
Will Pragnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify Acknowledgement file saving
parent
20419920
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
20 deletions
+9
-20
acknowledgements.rb
lib/cocoapods/generator/acknowledgements.rb
+3
-12
installer.rb
lib/cocoapods/installer.rb
+4
-1
acknowledgements_spec.rb
spec/unit/generator/acknowledgements_spec.rb
+2
-7
No files found.
lib/cocoapods/generator/acknowledgements.rb
View file @
1ed10b71
...
...
@@ -8,17 +8,8 @@ module Pod
@target_definition
,
@pods
=
target_definition
,
pods
end
def
save_in_directory
(
pathname
)
Xcodeproj
.
write_plist
(
plist
,
pathname
+
filename
)
end
def
filename
result
=
"
#{
@target_definition
.
label
}
-Acknowledgements.plist"
if
result
.
start_with?
"Pods-"
result
else
"Pods-"
+
result
end
def
save_as
(
path
)
Xcodeproj
.
write_plist
(
plist
,
path
)
end
def
plist
...
...
@@ -41,7 +32,7 @@ module Pod
def
hash_for_pod
(
pod
)
if
(
license
=
pod
.
license
)
license_hash
=
{
{
:Type
=>
"PSGroupSpecifier"
,
:Title
=>
pod
.
name
,
:FooterText
=>
license
[
:text
]
...
...
lib/cocoapods/installer.rb
View file @
1ed10b71
...
...
@@ -80,7 +80,10 @@ module Pod
target_installers
.
each
do
|
target_installer
|
pods_for_target
=
activated_pods_by_target
[
target_installer
.
target_definition
]
target_installer
.
install!
(
pods_for_target
,
@sandbox
)
Generator
::
Acknowledgements
.
new
(
target_installer
.
target_definition
,
pods_for_target
).
save_in_directory
(
config
.
project_pods_root
)
acknowledgements_path
=
config
.
project_pods_root
+
"
#{
target_installer
.
target_definition
.
label
}
-Acknowledgements.plist"
Generator
::
Acknowledgements
.
new
(
target_installer
.
target_definition
,
pods_for_target
).
save_as
(
acknowledgements_path
)
end
generate_lock_file!
(
pods
)
...
...
spec/unit/generator/acknowledgements_spec.rb
View file @
1ed10b71
...
...
@@ -35,13 +35,8 @@ describe Pod::Generator::Acknowledgements do
}
end
# TODO Test with a target_definition whose label isn't "Pods"
it
"adds
\"
Pods-
\"
to the beginning of the filename only if necessary"
do
(
@acknowledgements
.
filename
.
start_with?
"Pods-"
).
should
.
be
.
true
(
@acknowledgements
.
filename
.
start_with?
"Pods-Pods-"
).
should
.
be
.
false
end
it
"writes a plist to disk"
do
@acknowledgements
.
save_in_directory
(
@sandbox
.
root
).
should
.
be
.
true
path
=
@sandbox
.
root
+
"
#{
@target_definition
.
label
}
-Acknowledgements.plist"
@acknowledgements
.
save_as
(
path
).
should
.
be
.
true
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