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
c55f92bc
Unverified
Commit
c55f92bc
authored
Oct 15, 2016
by
Danielle Tomlinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Use Swift 3.0 by default
parent
1e3e9ae1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
validator.rb
lib/cocoapods/validator.rb
+4
-4
validator_spec.rb
spec/unit/validator_spec.rb
+5
-5
No files found.
lib/cocoapods/validator.rb
View file @
c55f92bc
...
@@ -144,10 +144,10 @@ module Pod
...
@@ -144,10 +144,10 @@ module Pod
end
end
if
dot_swift_version
.
nil?
if
dot_swift_version
.
nil?
reasons
.
to_sentence
+
".
\n
[!] The validator for Swift projects uses "
\
reasons
.
to_sentence
+
".
\n
[!] The validator for Swift projects uses "
\
'Swift
2.3
by default, if you are using a different version of '
\
'Swift
3.0
by default, if you are using a different version of '
\
'swift you can use a `.swift-version` file to set the version for '
\
'swift you can use a `.swift-version` file to set the version for '
\
"your Pod. For example to use Swift
3.0
, run:
\n
"
\
"your Pod. For example to use Swift
2.3
, run:
\n
"
\
' `echo "
3.0
" > .swift-version`'
' `echo "
2.3
" > .swift-version`'
else
else
reasons
.
to_sentence
reasons
.
to_sentence
end
end
...
@@ -248,7 +248,7 @@ module Pod
...
@@ -248,7 +248,7 @@ module Pod
# @return [String] the SWIFT_VERSION to use for validation.
# @return [String] the SWIFT_VERSION to use for validation.
#
#
def
swift_version
def
swift_version
@swift_version
||=
dot_swift_version
||
'
2.3
'
@swift_version
||=
dot_swift_version
||
'
3.0
'
end
end
# Set the SWIFT_VERSION that should be used to validate the pod.
# Set the SWIFT_VERSION that should be used to validate the pod.
...
...
spec/unit/validator_spec.rb
View file @
c55f92bc
...
@@ -821,17 +821,17 @@ module Pod
...
@@ -821,17 +821,17 @@ module Pod
validator
.
stubs
(
:results
).
returns
([
result
])
validator
.
stubs
(
:results
).
returns
([
result
])
validator
.
failure_reason
.
should
==
"1 error.
\n
[!] The validator for "
\
validator
.
failure_reason
.
should
==
"1 error.
\n
[!] The validator for "
\
'Swift projects uses Swift
2.3
by default, if you are using a '
\
'Swift projects uses Swift
3.0
by default, if you are using a '
\
'different version of swift you can use a `.swift-version` file '
\
'different version of swift you can use a `.swift-version` file '
\
'to set the version for your Pod. For example to use Swift
3.0
, '
\
'to set the version for your Pod. For example to use Swift
2.3
, '
\
"run:
\n
`echo
\"
3.0
\"
> .swift-version`"
"run:
\n
`echo
\"
2.3
\"
> .swift-version`"
end
end
describe
'#swift_version'
do
describe
'#swift_version'
do
it
'defaults to Swift
2.3
'
do
it
'defaults to Swift
3.0
'
do
validator
=
test_swiftpod
validator
=
test_swiftpod
validator
.
stubs
(
:dot_swift_version
).
returns
(
nil
)
validator
.
stubs
(
:dot_swift_version
).
returns
(
nil
)
validator
.
swift_version
.
should
==
'
2.3
'
validator
.
swift_version
.
should
==
'
3.0
'
end
end
it
'allows the user to set the version'
do
it
'allows the user to set the version'
do
...
...
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