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
7b3c417e
Commit
7b3c417e
authored
Oct 25, 2015
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[InfoPlistFile] Ensure the version string is exactly three dot-separated numbers
parent
4c7ce87f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
info_plist_file.rb
lib/cocoapods/generator/info_plist_file.rb
+2
-1
info_plist_file_spec.rb
spec/unit/generator/info_plist_file_spec.rb
+37
-0
No files found.
lib/cocoapods/generator/info_plist_file.rb
View file @
7b3c417e
...
...
@@ -39,7 +39,8 @@ module Pod
#
def
target_version
if
target
&&
target
.
respond_to?
(
:root_spec
)
target
.
root_spec
.
version
.
to_s
version
=
target
.
root_spec
.
version
[
version
.
major
,
version
.
minor
,
version
.
patch
].
join
(
'.'
)
else
'1.0.0'
end
...
...
spec/unit/generator/info_plist_file_spec.rb
View file @
7b3c417e
...
...
@@ -7,6 +7,43 @@ describe Pod::Generator::InfoPlistFile do
generator
.
target_version
.
should
==
'1.0.0'
end
describe
'sanitization'
do
before
do
@root_spec
=
mock
(
'RootSpec'
)
pod_target
=
stub
(
'PodTarget'
,
:root_spec
=>
@root_spec
)
@generator
=
Pod
::
Generator
::
InfoPlistFile
.
new
(
pod_target
)
end
it
'handles when the version is HEAD'
do
version
=
Pod
::
Version
.
new
(
'0.2.0'
)
version
.
head
=
true
@root_spec
.
stubs
(
:version
).
returns
(
version
)
@generator
.
target_version
.
should
==
'0.2.0'
end
it
'handles when the version is more than 3 numeric parts'
do
version
=
Pod
::
Version
.
new
(
'0.2.0.1'
)
@root_spec
.
stubs
(
:version
).
returns
(
version
)
@generator
.
target_version
.
should
==
'0.2.0'
end
it
'handles when the version is less than 3 numeric parts'
do
version
=
Pod
::
Version
.
new
(
'0.2'
)
@root_spec
.
stubs
(
:version
).
returns
(
version
)
@generator
.
target_version
.
should
==
'0.2.0'
end
it
'handles when the version is a pre-release'
do
version
=
Pod
::
Version
.
new
(
'1.0.0-beta.1'
)
@root_spec
.
stubs
(
:version
).
returns
(
version
)
@generator
.
target_version
.
should
==
'1.0.0'
version
=
Pod
::
Version
.
new
(
'1.0-beta.5'
)
@root_spec
.
stubs
(
:version
).
returns
(
version
)
@generator
.
target_version
.
should
==
'1.0.0'
end
end
it
'returns the specification\'s version for the pod target'
do
generator
=
Pod
::
Generator
::
InfoPlistFile
.
new
(
fixture_pod_target
(
'orange-framework/OrangeFramework.podspec'
))
generator
.
target_version
.
should
==
'0.1.0'
...
...
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