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
5b21047e
Commit
5b21047e
authored
Oct 20, 2016
by
Danielle Tomlinson
Committed by
GitHub
Oct 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6059 from CocoaPods/dani_strip_newlines
[Validator] Strip newlines from .swift-version files
parents
670952b5
cc982424
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
CHANGELOG.md
CHANGELOG.md
+3
-1
validator.rb
lib/cocoapods/validator.rb
+1
-1
validator_spec.rb
spec/unit/validator_spec.rb
+7
-0
No files found.
CHANGELOG.md
View file @
5b21047e
...
...
@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
None.
*
Strip newlines from .swift-version files.
[
Danielle Tomlinson
](
https://github.com/dantoml
)
[
#6059
](
https://github.com/CocoaPods/CocoaPods/pull/6059
)
## 1.1.0 (2016-10-19)
...
...
lib/cocoapods/validator.rb
View file @
5b21047e
...
...
@@ -259,7 +259,7 @@ module Pod
#
def
dot_swift_version
swift_version_path
=
file
.
dirname
+
'.swift-version'
swift_version_path
.
read
if
swift_version_path
.
exist?
swift_version_path
.
read
.
strip
if
swift_version_path
.
exist?
end
# @return [String] A string representing the Swift version used during linting
...
...
spec/unit/validator_spec.rb
View file @
5b21047e
...
...
@@ -867,6 +867,13 @@ module Pod
Pathname
.
any_instance
.
expects
(
:read
).
returns
(
'1.0'
)
validator
.
dot_swift_version
.
should
==
'1.0'
end
it
'strips newlines from .swift-version files'
do
validator
=
test_swiftpod
Pathname
.
any_instance
.
stubs
(
:exist?
).
returns
(
true
)
Pathname
.
any_instance
.
stubs
(
:read
).
returns
(
"2.1
\n
"
)
validator
.
swift_version
.
should
==
'2.1'
end
end
describe
'Getting the Swift value used by the validator'
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