Skip to content

Commit

Permalink
Merge pull request #960 from realm/jp-fix-specs
Browse files Browse the repository at this point in the history
Fix crash when specifying empty Swift version & update specs
  • Loading branch information
jpsim authored Apr 27, 2018
2 parents deb0f3a + ffa5151 commit c0ba84b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

##### Bug Fixes

* None.
* Fix crash when specifying empty Swift version. Now correctly uses the default
Swift version.
[JP Simard](https://github.com/jpsim)

## 0.9.2

Expand Down
9 changes: 6 additions & 3 deletions lib/jazzy/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,12 @@ def expand_path(path)
command_line: '--swift-version VERSION',
default: nil,
parse: ->(v) do
return nil if v.to_s.empty?
raise 'jazzy only supports Swift 2.0 or later.' if v.to_f < 2
v
if v.to_s.empty?
nil
else
raise 'jazzy only supports Swift 2.0 or later.' if v.to_f < 2
v
end
end

# ──────── Metadata ────────
Expand Down
5 changes: 3 additions & 2 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ def configure_cocoapods
behaves_like cli_spec 'document_siesta',
# Siesta already has Docs/
'--output api-docs',
# Use Swift 4.1 rather than the specified 3.0.2
'--swift-version=4.1'
# Use the default Swift version rather than the
# specified 4.0
'--swift-version='
end

describe 'Creates docs for Swift project with a variety of contents' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs
Submodule integration_specs updated 123 files

0 comments on commit c0ba84b

Please sign in to comment.