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
16c7d9c9
Commit
16c7d9c9
authored
Sep 08, 2016
by
Samuel Giddins
Committed by
GitHub
Sep 08, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5827 from marcelofabri/acknowledgements-crash
[Acknowledgements] Prevent crash when license type is nil
parents
62f140f1
af66f439
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
CHANGELOG.md
CHANGELOG.md
+3
-1
plist.rb
lib/cocoapods/generator/acknowledgements/plist.rb
+4
-2
plist_spec.rb
spec/unit/generator/acknowledgements/plist_spec.rb
+9
-0
No files found.
CHANGELOG.md
View file @
16c7d9c9
...
@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
None.
*
Prevent crash when generating acknowledgements when license type is not specified.
[
Marcelo Fabri
](
https://github.com/marcelofabri
)
[
#5826
](
https://github.com/CocoaPods/CocoaPods/issues/5826
)
## 1.1.0.beta.2 (2016-09-03)
## 1.1.0.beta.2 (2016-09-03)
...
...
lib/cocoapods/generator/acknowledgements/plist.rb
View file @
16c7d9c9
...
@@ -33,12 +33,14 @@ module Pod
...
@@ -33,12 +33,14 @@ module Pod
def
hash_for_spec
(
spec
)
def
hash_for_spec
(
spec
)
if
(
license
=
license_text
(
spec
))
if
(
license
=
license_text
(
spec
))
{
hash
=
{
:Type
=>
'PSGroupSpecifier'
,
:Type
=>
'PSGroupSpecifier'
,
:Title
=>
sanitize_encoding
(
spec
.
name
),
:Title
=>
sanitize_encoding
(
spec
.
name
),
:FooterText
=>
sanitize_encoding
(
license
),
:FooterText
=>
sanitize_encoding
(
license
),
:License
=>
sanitize_encoding
(
spec
.
license
[
:type
]),
}
}
hash
[
:License
]
=
sanitize_encoding
(
spec
.
license
[
:type
])
if
spec
.
license
[
:type
]
hash
end
end
end
end
...
...
spec/unit/generator/acknowledgements/plist_spec.rb
View file @
16c7d9c9
...
@@ -29,6 +29,15 @@ describe Pod::Generator::Plist do
...
@@ -29,6 +29,15 @@ describe Pod::Generator::Plist do
}
}
end
end
it
'skips license type in hash when it is nil'
do
@spec
.
stubs
(
:license
).
returns
(
:type
=>
nil
)
@generator
.
hash_for_spec
(
@spec
).
should
==
{
:Type
=>
'PSGroupSpecifier'
,
:Title
=>
'POD_NAME'
,
:FooterText
=>
'LICENSE_TEXT'
,
}
end
it
'returns a correctly sanitized license hash for each pod'
do
it
'returns a correctly sanitized license hash for each pod'
do
license_text
=
'Copyright © 2013–2014 Boris Bügling'
license_text
=
'Copyright © 2013–2014 Boris Bügling'
@generator
.
stubs
(
:license_text
).
returns
(
license_text
)
@generator
.
stubs
(
:license_text
).
returns
(
license_text
)
...
...
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