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
a57411ef
Unverified
Commit
a57411ef
authored
Oct 19, 2016
by
Danielle Tomlinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Strip newlines from .swift-version files
parent
670952b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
validator.rb
lib/cocoapods/validator.rb
+1
-1
validator_spec.rb
spec/unit/validator_spec.rb
+7
-0
No files found.
lib/cocoapods/validator.rb
View file @
a57411ef
...
@@ -259,7 +259,7 @@ module Pod
...
@@ -259,7 +259,7 @@ module Pod
#
#
def
dot_swift_version
def
dot_swift_version
swift_version_path
=
file
.
dirname
+
'.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
end
# @return [String] A string representing the Swift version used during linting
# @return [String] A string representing the Swift version used during linting
...
...
spec/unit/validator_spec.rb
View file @
a57411ef
...
@@ -867,6 +867,13 @@ module Pod
...
@@ -867,6 +867,13 @@ module Pod
Pathname
.
any_instance
.
expects
(
:read
).
returns
(
'1.0'
)
Pathname
.
any_instance
.
expects
(
:read
).
returns
(
'1.0'
)
validator
.
dot_swift_version
.
should
==
'1.0'
validator
.
dot_swift_version
.
should
==
'1.0'
end
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
end
describe
'Getting the Swift value used by the validator'
do
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