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
1b6e63fb
Commit
1b6e63fb
authored
Sep 30, 2016
by
Danielle Tomlinson
Committed by
GitHub
Sep 30, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5951 from CocoaPods/dani_validator_errors
[Validator] Inform people of .swift-version on err
parents
a5a409a8
2f1c364d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
CHANGELOG.md
CHANGELOG.md
+5
-0
validator.rb
lib/cocoapods/validator.rb
+9
-1
validator_spec.rb
spec/unit/validator_spec.rb
+15
-0
No files found.
CHANGELOG.md
View file @
1b6e63fb
...
...
@@ -13,6 +13,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
#5934
](
https://github.com/CocoaPods/CocoaPods/pull/5934
)
*
Improve performance of PathList.read_file_system
*
Tell users about the .swift-version file on validation failures.
[
Danielle Tomlinson
](
https://github.com/dantoml
)
[
#5951
](
https://github.com/CocoaPods/CocoaPods/pull/5951
)
*
Improve performance of PathList.read_file_system
[
Heath Borders
](
https://github.com/hborders
)
[
#5890
](
https://github.com/CocoaPods/CocoaPods/issues/5890
)
...
...
lib/cocoapods/validator.rb
View file @
1b6e63fb
...
...
@@ -142,7 +142,15 @@ module Pod
reasons
<<
'all results apply only to public specs, but you can use '
\
'`--private` to ignore them if linting the specification for a private pod'
end
reasons
.
to_sentence
if
dot_swift_version
.
nil?
reasons
.
to_sentence
+
".
\n
[!] The validator for Swift projects uses "
\
'Swift 2.3 by default, if you are using a 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, run:
\n
"
\
' `echo "3.0" > .swift-version`'
else
reasons
.
to_sentence
end
end
#-------------------------------------------------------------------------#
...
...
spec/unit/validator_spec.rb
View file @
1b6e63fb
...
...
@@ -812,6 +812,21 @@ module Pod
validator
.
results
.
count
.
should
==
0
end
it
'tells users about the .swift-version file if the validation fails'
do
Specification
.
any_instance
.
stubs
(
:deployment_target
).
returns
(
'9.0'
)
validator
=
test_swiftpod
validator
.
stubs
(
:validated?
).
returns
(
false
)
result
=
Validator
::
Result
.
new
(
:error
,
'attribute'
,
'message'
)
validator
.
stubs
(
:results
).
returns
([
result
])
validator
.
failure_reason
.
should
==
"1 error.
\n
[!] The validator for "
\
'Swift projects uses Swift 2.3 by default, if you are using a '
\
'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, '
\
"run:
\n
`echo
\"
3.0
\"
> .swift-version`"
end
describe
'#swift_version'
do
it
'defaults to Swift 2.3'
do
validator
=
test_swiftpod
...
...
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