Build Status Coverage Status Gem Version Code Climate

Grenouille uses Apple's swift-update tool to determine the version of Swift used in a set of files automatically.


You can use it on the commandline:

$ grenouille Stargate.swift 

or programmatically:

su =
# 1.2

You can also get more detailled output:

# {:report=>[{"file"=>"spec/fixtures/Blueprint.swift", "offset"=>740, "remove"=>2, "text"=>"as!"}, {"file"=>"spec/fixtures/Blueprint.swift", "offset"=>6758, "remove"=>2, "text"=>"as!"}, {"file"=>"spec/fixtures/Blueprint.swift", "offset"=>10613, "remove"=>2, "text"=>"as!"}], :output=>""}

The value for the :report key represents the result of swift-update, a list of changes to perform to transform the current code to the version of Swift supported by the used Xcode. The value for the :output key is the aggregate of stdout and stderr of swift-update, e.g. compilation errors.


Add this line to your application's Gemfile:

gem 'grenouille'

And then execute:

$ bundle

Or install it yourself as:

$ gem install grenouille

Note: The swift-update tool is a part of Xcode since 6.3, so it needs at least that version to function.


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request