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
e515bb4d
Commit
e515bb4d
authored
Mar 01, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Acknowledgements] Don't crash if the license file doesn't exists.
Closes #828
parent
57ec4645
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
CHANGELOG.md
CHANGELOG.md
+2
-0
acknowledgements.rb
lib/cocoapods/generator/acknowledgements.rb
+11
-5
acknowledgements_spec.rb
spec/unit/generator/acknowledgements_spec.rb
+6
-0
No files found.
CHANGELOG.md
View file @
e515bb4d
...
...
@@ -4,6 +4,8 @@
###### Bug fixes
-
CocoaPods will not crash anymore if the license file indicated on the spec
doesn't exits.
-
Pre install hooks are called before the Pods are cleaned.
-
Fixed and issue which prevent the inclusion of OTHER_CFLAGS and
OTHER_CPLUSPLUSFLAGS in the release builds of the Pods project.
...
...
lib/cocoapods/generator/acknowledgements.rb
View file @
e515bb4d
...
...
@@ -72,13 +72,19 @@ module Pod
# @return [Nil] If not license text could be found.
#
def
license_text
(
spec
)
if
spec
.
license
if
text
=
spec
.
license
[
:text
]
text
elsif
license_file
=
file_accessor
(
spec
).
license
text
=
IO
.
read
(
license_file
)
return
nil
unless
spec
.
license
text
=
spec
.
license
[
:text
]
unless
text
if
license_file
=
file_accessor
(
spec
).
license
if
license_file
.
exist?
text
=
IO
.
read
(
license_file
)
else
UI
.
warn
"Unable to read the license file `
#{
license_file
}
` "
\
"for the spec `
#{
spec
}
`"
end
end
end
text
end
protected
...
...
spec/unit/generator/acknowledgements_spec.rb
View file @
e515bb4d
...
...
@@ -44,6 +44,12 @@ module Pod
text_from_spec
.
should
==
"post v1.0
\n
"
end
it
"warns the user if the file specified in the license doesn't exists"
do
@spec
.
stubs
(
:license
).
returns
({
:type
=>
'MIT'
,
:file
=>
'MISSING'
})
text_from_spec
=
@generator
.
send
(
:license_text
,
@spec
)
UI
.
warnings
.
should
.
include
"Unable to read the license file"
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